fix(tui): keep session directory filter toggle usable in the picker - #42056
Open
thepigdestroyer wants to merge 1 commit into
Open
fix(tui): keep session directory filter toggle usable in the picker#42056thepigdestroyer wants to merge 1 commit into
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.
Contributor
|
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. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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