fix(TUI): dont submit prompt when switching sessions #8016
+2
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes ux issue, where prompt gets auto submitted when switching sessions / conversations via the keyboard
How did you verify your code works?
Tested it manually after straight forward fix.
Fixes
#8019
A screen recording of the issue is attached to make it easy to understand what was undesired and is now fixed.
undesired-behaviour.mp4
To ensure no other functionalities are negatively impacted, I have checked where the component is used in the codebase. For all functions I am familiar with the return-key binding still works as someone expects. For transparency, here is the full reference list:
✅ := controlled, everything works fine
[?] not familiar enough with opencode to know where to find it, since all other occurrences were fine i assume those are too.
✅ packages/opencode/src/cli/cmd/tui/component/dialog-agent.tsx
3, 10: import { DialogSelect } from "@tui/ui/dialog-select"
21, 6: <DialogSelect
✅ packages/opencode/src/cli/cmd/tui/component/dialog-command.tsx
2, 10: import { DialogSelect, type DialogSelectOption, type DialogSelectRef } from "@tui/ui/dialog-select"
118, 6: <DialogSelect
✅packages/opencode/src/cli/cmd/tui/component/dialog-mcp.tsx
5, 10: import { DialogSelect, type DialogSelectRef, type DialogSelectOption } from "@tui/ui/dialog-select"
76, 6: <DialogSelect
✅ packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx
5, 10: import { DialogSelect, type DialogSelectRef } from "@tui/ui/dialog-select"
207, 6: <DialogSelect
✅packages/opencode/src/cli/cmd/tui/component/dialog-provider.tsx
4, 10: import { DialogSelect } from "@tui/ui/dialog-select"
54, 20: <DialogSelect
97, 11: return
✅ packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx
2, 10: import { DialogSelect } from "@tui/ui/dialog-select"
74, 6: <DialogSelect
[?] packages/opencode/src/cli/cmd/tui/component/dialog-stash.tsx
2, 10: import { DialogSelect } from "@tui/ui/dialog-select"
55, 6: <DialogSelect
[?] packages/opencode/src/cli/cmd/tui/component/dialog-tag.tsx
2, 10: import { DialogSelect } from "@tui/ui/dialog-select"
35, 6: <DialogSelect
✅ packages/opencode/src/cli/cmd/tui/component/dialog-theme-list.tsx
1, 10: import { DialogSelect, type DialogSelectRef } from "../ui/dialog-select"
24, 6: <DialogSelect
[?] packages/opencode/src/cli/cmd/tui/routes/session/dialog-fork-from-timeline.tsx
3, 10: import { DialogSelect, type DialogSelectOption } from "@tui/ui/dialog-select"
63, 11: return <DialogSelect onMove={(option) => props.onMove(option.value)} title="Fork from message" options={options()} />
[?] packages/opencode/src/cli/cmd/tui/routes/session/dialog-message.tsx
3, 10: import { DialogSelect } from "@tui/ui/dialog-select"
20, 6: <DialogSelect
[?] packages/opencode/src/cli/cmd/tui/routes/session/dialog-subagent.tsx
1, 10: import { DialogSelect } from "@tui/ui/dialog-select"
8, 6: <DialogSelect
[?] packages/opencode/src/cli/cmd/tui/routes/session/dialog-timeline.tsx
3, 10: import { DialogSelect, type DialogSelectOption } from "@tui/ui/dialog-select"
46, 11: return <DialogSelect onMove={(option) => props.onMove(option.value)} title="Timeline" options={options()} />