[PR #12318] feat(cli): make prompt elements clickable to open dialogs #14165

Open
opened 2026-02-16 18:18:58 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12318

State: open
Merged: No


What does this PR do?

This PR addresses the issue where the prompt elements (agent name, model, provider, and variant) in the TUI are displayed as static text, making it harder for users to change them without keyboard shortcuts. I added click handlers to these elements so users can click them to open selection dialogs or cycle options, improving usability for mouse users.

The changes were made in index.tsx:

  • Imported the necessary dialog components (DialogAgent, DialogModel).
  • Added onMouseUp handlers to the <text> elements for agent, model, provider, and variant.
  • For agent: Opens the agent dialog (only in normal mode).
  • For model: Opens the model dialog.
  • For provider: Opens the provider connection dialog.
  • For variant: Cycles through variants using the existing cycle method.

How did you verify your code works?

I verified by running bun dev locally, starting the TUI, and clicking each element to ensure the dialogs open or variants cycle as expected. I also tested that keyboard shortcuts (like agent cycling) still work and that the UI doesn't break in shell mode. No errors appeared, and the changes don't affect other parts of the app.

closes #12315

https://github.com/user-attachments/assets/c8ab38cb-b466-4d19-96ca-7168a2f90f68

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12318 **State:** open **Merged:** No --- ### What does this PR do? This PR addresses the issue where the prompt elements (agent name, model, provider, and variant) in the TUI are displayed as static text, making it harder for users to change them without keyboard shortcuts. I added click handlers to these elements so users can click them to open selection dialogs or cycle options, improving usability for mouse users. The changes were made in index.tsx: - Imported the necessary dialog components (`DialogAgent`, `DialogModel`). - Added `onMouseUp` handlers to the `<text>` elements for agent, model, provider, and variant. - For agent: Opens the agent dialog (only in normal mode). - For model: Opens the model dialog. - For provider: Opens the provider connection dialog. - For variant: Cycles through variants using the existing cycle method. ### How did you verify your code works? I verified by running `bun dev` locally, starting the TUI, and clicking each element to ensure the dialogs open or variants cycle as expected. I also tested that keyboard shortcuts (like agent cycling) still work and that the UI doesn't break in shell mode. No errors appeared, and the changes don't affect other parts of the app. closes #12315 https://github.com/user-attachments/assets/c8ab38cb-b466-4d19-96ca-7168a2f90f68
yindo added the pull-request label 2026-02-16 18:18:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14165