Repository navigation
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
20170c2 to
1fa0b7f
Compare
There was a problem hiding this comment.
Looks good. I ran OpenCode from source with the simulated model on the base and on this branch. On the base, clicking Build or the model name in the prompt footer does nothing. With this PR they open "Select agent" and "Select model". Dragging across the footer still selects and copies the text without opening a picker. I couldn't click the variant label live because the simulated model has no variants, but your unit test covers it. The new test file passes (3/3) and typecheck in packages/tui is clean.
The public API is unchanged; the change is internal to the TUI.
No blocking concerns. One small note: ui/link.tsx already handles clicks in its own way (clickedLink, which checks isDragging and the cell selection), so the TUI now has two ways of telling a click from a selection. Your helper is small and is reused across all three labels, so that's fine as it is. Also, #48563 suggested that a single click on the variant should cycle it; opening the picker on click, as here, seems a reasonable choice.
|
Addressed the duplication note: the click-vs-selection check now lives in one place. Adopting the shared check also fixed a subtle gap in my original version: it now rejects a press-dragged-round-trip back to its cell the same way link clicks always have, instead of relying on my own bookkeeping. Tests now cover the drag cases with real motion sequences ( |
f419fde to
534af3e
Compare


Issue for this PR
Closes #48563
Type of change
What does this PR do?
The prompt footer shows
agent · model · variantas plain text (#48563). This wires each label to the picker its keyboard shortcut already opens, by dispatching the existing keymap commands on click: agent →agent.list, model and provider →model.list, variant →variant.list.Clicks are detected by the same check
clickedLinkhas always used for Markdown links, now shared asisPlainClickinui/click.ts: only a release ending a fresh cell selection (isDragging+ no ctrl/alt/shift) is a click, so drag-to-select over the footer keeps working. This redo of the closed v1 attempt #53871 follows the v2 codebase's own conventions.(Supersedes #55660, which was auto-closed for targeting the now-obsolete
v2base.)How did you verify your code works?
bun test test/component/prompt-metadata-click.test.tsx— 4 tests: clicking each label picks the matching target (agent,model,variant); releasing a transcript drag over the labels, dragging from one label onto another, and shift-clicking a label do not pick anything.bun test test/ui/link.test.tsx— regression forclickedLink, which now delegates to the sharedisPlainClick.bun run typecheckandbunx oxlinton the touched files.bun testin packages/tui: 1485 pass. The only 2 failures (dialog-shell-outputtimeouts) reproduce identically on the unmodified base commit, so they are pre-existing environment flakes, not from this change.Screenshots / recordings
Interaction-only change — the footer renders exactly as before, no visual diff.
Checklist