Skip to content

which-sem: show all SemVer options with selected one highlighted#67

Merged
Uliboooo merged 4 commits into64-new-format-in-whichi-semfrom
copilot/add-new-format-for-semver
Mar 22, 2026
Merged

which-sem: show all SemVer options with selected one highlighted#67
Uliboooo merged 4 commits into64-new-format-in-whichi-semfrom
copilot/add-new-format-for-semver

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 22, 2026

  • Add SemVerSelector struct to cli_helper.rs that displays all three SemVer options with the selected one boxed
  • Update main.rs to use SemVerSelector for which-sem output
  • Add tests for SemVerSelector in cli_helper.rs
  • Refactor: replace String-based selection with enum SemVerPart { Major, Minor, Patch }
  • Bump version to 0.18.3 in Cargo.toml
Original prompt

This section details on the original issue you should resolve

<issue_title>new-format in whichi-sem</issue_title>
<issue_description>```
shoud increase at
╭──────╮
│ Minor │
╰──────╯


current format is difficult to read.

## new format

show list of SemVer and focus llm's response

  ╭──────╮

|MAJOR│ Minor | PATCH |
╰──────╯


## ref

> MAJOR version when you make incompatible API changes
> MINOR version when you add functionality in a backward compatible manner
> PATCH version when you make backward compatible bug fixes
https://semver.org/</issue_description>

<agent_instructions>please add this issue feature</agent_instructions>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Copilot AI changed the title [WIP] Add new format for SemVer representation which-sem: show all SemVer options with selected one highlighted Mar 22, 2026
Copy link
Copy Markdown
Owner

@Uliboooo Uliboooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request Changes

SemVer parts (MAJOR/MINOR/PATCH) are a closed and invariant domain, but the current implementation models them as dynamic strings (SEM_VER_ITEMS, self.selected: String, position, to_lowercase, unwrap_or).
This weakens semantics and introduces unnecessary runtime logic for a fixed structure.

Reasons

  • SemVer is a fixed structure and should be represented as an enum
  • String-based lookup allows invalid states
  • unwrap_or silently hides errors
  • The logic is more dynamic than the problem requires

Direction

  • Introduce enum SemVerPart { Major, Minor, Patch }
  • Replace string-based selection with SemVerPart
  • Use match and minimal rendering logic
  • Remove string comparison and index search

Goal: explicit domain modeling with enum and minimal logic.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 22, 2026

Request Changes

SemVer parts (MAJOR/MINOR/PATCH) are a closed and invariant domain, but the current implementation models them as dynamic strings (SEM_VER_ITEMS, self.selected: String, `posit...

Done in beea831.

  • enum SemVerPart { Major, Minor, Patch } with FromStr (case-insensitive match, explicit Err on unknown input) and a private label() method
  • SemVerSelector::new now takes SemVerPart directly — no string storage, no position(), no unwrap_or
  • Display for SemVerSelector compares via PartialEq on the enum
  • In main.rs the LLM response is parsed with res.0.trim().parse::<SemVerPart>().map_err(Error::InvalidSemVer)? — invalid input surfaces as an explicit error instead of silently falling back

Copilot AI requested a review from Uliboooo March 22, 2026 17:24
@Uliboooo Uliboooo marked this pull request as ready for review March 22, 2026 17:44
Copy link
Copy Markdown
Owner

@Uliboooo Uliboooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. thx.

Copy link
Copy Markdown
Owner

@Uliboooo Uliboooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update version info of Cargo.toml

@Uliboooo Uliboooo self-requested a review March 22, 2026 17:47
@Uliboooo Uliboooo dismissed their stale review March 22, 2026 17:48

sorry. i forgot order that update version info of Cargo.toml

This comment was marked as duplicate.

4 similar comments
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 22, 2026

@Uliboooo The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: bbe3e987-cf11-4c47-b18b-fa6c47b4c563

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 22, 2026

@Uliboooo The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: bbe3e987-cf11-4c47-b18b-fa6c47b4c563

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 22, 2026

@Uliboooo The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: bbe3e987-cf11-4c47-b18b-fa6c47b4c563

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 22, 2026

@Uliboooo The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: bbe3e987-cf11-4c47-b18b-fa6c47b4c563

Repository owner deleted a comment from Copilot AI Mar 22, 2026
Copy link
Copy Markdown
Owner

@Uliboooo Uliboooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please update version info of Cargo.toml

Co-authored-by: Uliboooo <190558756+Uliboooo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Uliboooo/ghost_git_writer/sessions/82a76db2-83fc-472b-ace3-98bdc3bceff6
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 22, 2026

please update version info of Cargo.toml

Done in 81123ff — bumped version from 0.18.2 to 0.18.3 in Cargo.toml.

Copilot AI requested a review from Uliboooo March 22, 2026 17:53
Copy link
Copy Markdown
Owner

@Uliboooo Uliboooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you choose patch field?

Copy link
Copy Markdown
Owner

@Uliboooo Uliboooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you choose patch field?

Copy link
Copy Markdown
Owner

@Uliboooo Uliboooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix by me

@Uliboooo Uliboooo merged commit dac2068 into 64-new-format-in-whichi-sem Mar 22, 2026
1 of 2 checks passed
@Uliboooo Uliboooo deleted the copilot/add-new-format-for-semver branch March 31, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants