Skip to content

make variant modal less annoying#19998

Merged
Hona merged 3 commits intoanomalyco:devfrom
Hona:make-variant-modal-less-annoying
Mar 30, 2026
Merged

make variant modal less annoying#19998
Hona merged 3 commits intoanomalyco:devfrom
Hona:make-variant-modal-less-annoying

Conversation

@Hona
Copy link
Copy Markdown
Member

@Hona Hona commented Mar 30, 2026

Summary

  • remember the variant choice per model, including choosing the default
  • only prompt for a variant once per model; after that ctrl+t cycles variants and /variants opens the modal manually

Copilot AI review requested due to automatic review settings March 30, 2026 05:28
@Hona Hona enabled auto-merge (squash) March 30, 2026 05:29
@Hona Hona disabled auto-merge March 30, 2026 05:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the TUI’s model-variant UX so variant selection is remembered per model and the variant picker modal is shown only when needed, with keyboard cycling support thereafter.

Changes:

  • Persist a per-model variant “selection” (including an explicit “default” choice) and add validation for the active/usable variant.
  • Add an explicit “Default” option to the variant selection dialog and adjust model selection flow to avoid re-prompting once a choice is recorded.
  • Introduce a dedicated “Variant cycle” command/action and add /variants to manually open the variant modal.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/opencode/src/cli/cmd/tui/context/local.tsx Adds selected() vs validated current() variant accessors; persists "default" sentinel for explicit default selection; updates cycling logic accordingly.
packages/opencode/src/cli/cmd/tui/component/prompt/index.tsx Switches prompt submission to use the stored variant selection value.
packages/opencode/src/cli/cmd/tui/component/dialog-variant.tsx Adds an explicit “Default” entry and uses selected() to highlight the stored choice.
packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx Avoids showing the variant modal if a prior selection exists for that model; otherwise prompts once when variants are available.
packages/opencode/src/cli/cmd/tui/app.tsx Adds a new “Variant cycle” action and introduces /variants for manual modal access.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Hona Hona merged commit 186af27 into anomalyco:dev Mar 30, 2026
8 checks passed
afanty2021 pushed a commit to afanty2021/opencode that referenced this pull request Mar 30, 2026
balcsida pushed a commit to balcsida/opencode that referenced this pull request Apr 8, 2026
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