Skip to content

Show label-only footer bindings, gate Visual on a tree selection#223

Merged
Maxteabag merged 1 commit into
Maxteabag:mainfrom
PeterAdams-ecitsolutions:fix-empty-state-footer-bindings
May 23, 2026
Merged

Show label-only footer bindings, gate Visual on a tree selection#223
Maxteabag merged 1 commit into
Maxteabag:mainfrom
PeterAdams-ecitsolutions:fix-empty-state-footer-bindings

Conversation

@PeterAdams-ecitsolutions
Copy link
Copy Markdown

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 <?> in the footer and had no way to discover n for New connection.

This relaxes the gate so label alone is enough to register a display binding, and adds a guard on enter_tree_visual_mode so 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 overrides get_display_bindings and builds its footer manually, so the relaxed gate only takes effect in TreeFocusedState — exactly the empty-explorer case.

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.
@Maxteabag Maxteabag merged commit 84cbfa1 into Maxteabag:main May 23, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants