Show label-only footer bindings, gate Visual on a tree selection#223
Merged
Maxteabag merged 1 commit intoMay 23, 2026
Merged
Conversation
The state-machine `allows(..., label="...")` API silently dropped any binding that didn't also pass `key=...` inline. Footer rendering already resolves keys from the global keymap at display time, so the inline key was redundant — but the gate meant a first-time user with an empty explorer saw only `<space>` and `<?>` and couldn't discover `n` for New. Relax the gate so `label` alone is enough to register a display binding, and guard `enter_tree_visual_mode` on actually having a highlighted node so it doesn't appear in the empty state.
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.
The state-machine
allows(..., label="...")API silently dropped any binding that didn't also passkey=...inline. Footer rendering already resolves keys from the global keymap at display time, so the inline key was redundant — but the gate meant a first-time user with an empty explorer saw only<space>and<?>in the footer and had no way to discovernfor New connection.This relaxes the gate so
labelalone is enough to register a display binding, and adds a guard onenter_tree_visual_modeso it doesn't show in the empty state (where there's nothing to visual-select).Blast radius is small: every other state with label-only
allows(...)calls already overridesget_display_bindingsand builds its footer manually, so the relaxed gate only takes effect inTreeFocusedState— exactly the empty-explorer case.