Repository navigation
Make the command palette a bindable action, shown in the footer - #1184
Merged
Merged
Conversation
tconbeer
force-pushed
the
feat/palette-footer-hint
branch
from
October 4, 2026 03:51
da2bcae to
7200621
Compare
tconbeer
commented
Oct 4, 2026
The palette is now the `command_palette` action, bound to ctrl+p in the VS Code keymap and listed in the footer as "Commands", right after Quit and Help. Textual's own ctrl+p binding is dropped, so a keymap that moves the palette really moves it. The help screen's tip names whatever key opens it. Closes #223 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015eYrDYJPPnVY7KeHm1oTBY
ENABLE_COMMAND_PALETTE = False stops Textual binding ctrl+p to the palette, and use_command_palette keeps the palette itself on, so the keymap's command_palette binding is the only one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015eYrDYJPPnVY7KeHm1oTBY
tconbeer
force-pushed
the
feat/palette-footer-hint
branch
from
October 4, 2026 05:21
a7242a4 to
f103700
Compare
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.
Closes #223
What are the key elements of this solution?
command_palette, inHARLEQUIN_ACTIONS, with the description "Commands",show=True, and priority, so it works while the Query Editor has focus. It can be rebound in a keymap like any other action.ctrl+p, right afterhelp. Footer keys follow binding order, so the footer reads^q Quit f1 Help ^p Commands f8 History ….HarlequinsetsENABLE_COMMAND_PALETTE = False, so Textual doesn't add its ownctrl+pbinding, and setsuse_command_palette = True, which keeps the palette on. Without that, a keymap that moved the palette to another key would leavectrl+popening it too.ctrl+p.Footerkeepsshow_command_palette=False. The key is an ordinary footer key, so no CSS is needed and it covers nothing.Why did you design your solution this way? Did you assess any alternatives? Are there tradeoffs?
f3 Find Nextat 120 columns, and^s Save Queryat 80. An ordinary key covers nothing.Harlequin.BINDINGS. A class-level binding onctrl+pshares its list across instances, because Textual'sBindingsMap.copy()is shallow, so userctrl+pbindings leaked between app instances in one process. Binding it through the keymap, like every other action, avoids that.ENABLE_COMMAND_PALETTEanduse_command_palette) turn off its built-in binding, so nothing reaches into_bindings.vscodeand don't bindcommand_palettegets no palette key. That's consistent with every other action.Does this PR require a change to Harlequin's docs?
^p Commands, and the palette is bindable ascommand_palette(defaultctrl+pin the VS Code keymap). Screenshots of the main screen in the docs will be missing the new footer key.Did you add or update tests for this change?
Yes.
No, I believe tests aren't necessary.
No, I need help with testing this change.
test_footer_shows_palette_key: the footer lists Quit, Help, Commands first, andctrl+popens the palette.test_palette_key_is_configurable: a keymap that bindscommand_palettetof11showsf11 Commands.f11opens the palette andctrl+pdoesn't.ENABLE_COMMAND_PALETTE = Falseoruse_command_palette = Truefails both this test and the footer test.test_help_screen_keys_panel_tip_without_a_binding: the tip names the palette's key, or none.Snapshots: 145 changed, 141 regenerated on Python 3.10 and 4 py12-only ones on 3.12. I compared every changed SVG to the base by script:
^p Commandsafter Help).Please complete the following checklist:
CHANGELOG.md, under the[Unreleased]section heading. That entry references the issue closed by this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_015eYrDYJPPnVY7KeHm1oTBY