Repository navigation
fix(tui): keep session directory filter toggle usable in the picker - #42056
thepigdestroyer wants to merge 1 commit into
Conversation
app.toggle.session_directory_filter was listed in appBindingCommands, which is gathered under mode OPENCODE_BASE_MODE. Opening a dialog pushes "modal" (ui/dialog.tsx), so the binding was inactive inside the session picker, the one place the toggle is worth reaching. Bound to a key it appeared to work on the main screen and do nothing in the picker. Move it to appGlobalBindingCommands, which is gathered without a mode and stays active while a dialog is open. Also keep the picker open when the toggle runs from inside it. The picker resource queries on sync.session.query(), so it re-lists in place; clearing the dialog hid the result of the toggle. Invocations from the command palette still clear as before.
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
|
Thanks for this — it looks like it was closed by the age/reaction cleanup, not on review. Rather than leave the fix dead I've re-submitted the same change (rebased on current dev, with a keymap test): #50432 — crediting you in the PR body. Happy to add you as co-author, or to hand it back if you'd rather reopen your own PR. |
Issue for this PR
Closes #42060
Type of change
What does this PR do?
A key bound to
app.toggle.session_directory_filterdoes nothing inside the session picker, which is where the toggle matters. It works on the main screen, so it looks intermittent.Cause: the command sits in
appBindingCommands, which is gathered withmode: OPENCODE_BASE_MODE. Opening a dialog pushes"modal"inui/dialog.tsx, so that layer goes inactive, and the picker is a dialog.Fix: move the command to
appGlobalBindingCommands, which is gathered without a mode. That list already holdssession.listand the quick-switch commands for the same reason. Dialog-owned layers still win keys they bind, since dialog bindings are registered by the dialog itself, and this keybind defaults tononeso no new conflict is introduced.Second change in the same command:
dialog.clear()ran unconditionally, so toggling from inside the picker closed it and hid the result. The picker's resource queries onsync.session.query(), so leaving it open re-lists in place. Palette invocations still clear as before. Happy to drop this part if you would rather keep the PR to the layer move.How did you verify your code works?
ctrl+alocally. Before: works on main screen, dead in the picker. After: works in both, and the picker stays open and re-lists."modal"viagetOpencodeModeStack(keymap).push("modal")and readinggetCommandBindings({ visibility: "active" })gives 0 active bindings before the change and 1 after.bun run typecheckinpackages/tui, clean.bun test test/keymap.test.tsx test/component/dialog-session-list.test.ts test/config.test.tsx, 16 pass.I have a regression test for the modal case but left it out, because asserting it needs
appBindingCommandsandappGlobalBindingCommandsexported fromapp.tsxand I did not want to widen the module API uninvited. Say the word and I will add it.Screenshots / recordings
No visual change. The keybind defaults to
none, so nothing differs unless a user binds it.Checklist