Wrap the key bindings bar over several lines #33

Merged
Duckboot merged 1 commits from fix/wrap-footer-keys into main 2026-11-03 08:40:32 +01:00
Owner

Textual's Footer is a single horizontal row, so on a narrow terminal the keys at the end were cut off.

KeyBar replaces it on every screen:

  • It reads the same active bindings (one entry per action, plus ^p palette).
  • It packs them greedily into rows that fit the width, and its height grows as needed.

At 80 columns with real data the bar takes two lines; at 140 columns it takes one.

Trade-off: the keys can no longer be clicked with the mouse.

Tests:

  • a hypothesis property for wrap_rows: order is kept, rows fit the width, rows are packed greedily
  • the bar wraps on a narrow terminal
  • the bar is one line on a wide terminal
  • the bar follows the info screen's bindings

Full suite passes (681 tests); ruff and betterleaks are clean.

Helped along the way with Claude Code

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

Textual's `Footer` is a single horizontal row, so on a narrow terminal the keys at the end were cut off. `KeyBar` replaces it on every screen: - It reads the same active bindings (one entry per action, plus `^p palette`). - It packs them greedily into rows that fit the width, and its height grows as needed. At 80 columns with real data the bar takes two lines; at 140 columns it takes one. Trade-off: the keys can no longer be clicked with the mouse. Tests: - a hypothesis property for `wrap_rows`: order is kept, rows fit the width, rows are packed greedily - the bar wraps on a narrow terminal - the bar is one line on a wide terminal - the bar follows the info screen's bindings Full suite passes (681 tests); ruff and betterleaks are clean. Helped along the way with Claude Code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Duckboot added 1 commit 2026-11-03 08:35:29 +01:00
Wrap the key bindings bar over several lines
CI / pytest and ruff (pull_request) Successful in 4m43s
CI / pytest and ruff (push) Successful in 4m43s
9b472e8cf6
Textual's Footer is a single horizontal row, so on a narrow terminal the
keys at the end were cut off. KeyBar replaces it on every screen: it reads
the same active bindings, packs them greedily into rows that fit the width,
and grows in height as needed.

Generated with AI

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Duckboot merged commit 9b472e8cf6 into main 2026-11-03 08:40:32 +01:00
Duckboot deleted branch fix/wrap-footer-keys 2026-11-03 08:40:32 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Duckboot/cv4pve-cli-tui#33