TUI: make the focused panel unmistakable #123

Closed
opened 2026-08-25 12:18:01 +01:00 by naps62-yolo · 0 comments
Collaborator

Focus in the TUI is nearly invisible. render.rs tints the sidebar's right-edge rule and the pane's top rule cyan when that side has focus, and that is the entire cue — a single line changing colour at the edge of the screen. Worse, the sidebar's highlighted card keeps its filled selection background whether or not the sidebar has focus, so the sidebar always looks like the active panel.

Two changes, and both are wanted:

The selection goes hollow when the sidebar is unfocused. The highlighted card keeps its filled background only while focus is on the sidebar. Unfocused, it drops to an outline or an edge marker that still says "this is where the cursor is" without claiming the keys. The thing that looks selected should only look selected when your keystrokes go there.

The active panel gets a coloured border. Use the palette's focused and unfocused border roles.

The border costs screen space, and the layout must not move when focus changes — a border that appears on focus would reflow the screen under the cursor. So both panels carry a border at all times and only its colour changes. That is 2 of the sidebar's 28 columns, and 2 rows plus 2 columns off the pane. render.rs:110 records that the current 1-row-rule layout deliberately replaced Length(3) + Borders::ALL to reclaim exactly those rows; this issue knowingly spends some of them back, and the sidebar's usable width drops accordingly. Check that the card truncation logic in sidebar.rs still behaves at the narrower width.

The pane renders a live terminal's own output, which sets its own colours. Do not dim or restyle the pane's contents to signal focus — the border is the cue there.

Tests: the highlighted card renders filled when the sidebar is focused and hollow when it is not, the border style follows AppState::focus, and the layout's pane and sidebar rectangles are identical in both focus states.

Depends on: #118, #121

Focus in the TUI is nearly invisible. `render.rs` tints the sidebar's right-edge rule and the pane's top rule cyan when that side has focus, and that is the entire cue — a single line changing colour at the edge of the screen. Worse, the sidebar's highlighted card keeps its filled selection background whether or not the sidebar has focus, so the sidebar always looks like the active panel. Two changes, and both are wanted: **The selection goes hollow when the sidebar is unfocused.** The highlighted card keeps its filled background only while focus is on the sidebar. Unfocused, it drops to an outline or an edge marker that still says "this is where the cursor is" without claiming the keys. The thing that looks selected should only look selected when your keystrokes go there. **The active panel gets a coloured border.** Use the palette's focused and unfocused border roles. The border costs screen space, and the layout must not move when focus changes — a border that appears on focus would reflow the screen under the cursor. So both panels carry a border at all times and only its colour changes. That is 2 of the sidebar's 28 columns, and 2 rows plus 2 columns off the pane. `render.rs:110` records that the current 1-row-rule layout deliberately replaced `Length(3) + Borders::ALL` to reclaim exactly those rows; this issue knowingly spends some of them back, and the sidebar's usable width drops accordingly. Check that the card truncation logic in `sidebar.rs` still behaves at the narrower width. The pane renders a live terminal's own output, which sets its own colours. Do not dim or restyle the pane's contents to signal focus — the border is the cue there. Tests: the highlighted card renders filled when the sidebar is focused and hollow when it is not, the border style follows `AppState::focus`, and the layout's pane and sidebar rectangles are identical in both focus states. Depends on: #118, #121
naps62-yolo added this to the TUI shell milestone 2026-08-25 12:18:01 +01:00
naps62-yolo added the area/tuidifficulty/mediumtype/feat labels 2026-08-25 12:18:01 +01:00
naps62-yolo added a new dependency 2026-08-25 12:18:57 +01:00
naps62-yolo added a new dependency 2026-08-25 12:22:14 +01:00
naps62-yolo added a new dependency 2026-08-25 12:22:14 +01:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Reference: naps62/maestro#123