Skip to content

feat(tui): round 2 spacing, hover hierarchy and queued-row hover - #657

Merged
mohitranka merged 1 commit into
mainfrom
feat/tui-round2-spacing-hover
Sep 12, 2026
Merged

mohitranka merged 1 commit into
mainfrom
feat/tui-round2-spacing-hover

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Summary

Round 2 of the UI spacing work, following up #654 (airy pass) and #656 (emphasis hues). Prototyped and verified in a real tmux PTY against OpenCode and Codex before implementation; mockups, rationale and a file-level plan live in docs/ui-spacing-review/round-2/ (docs are gitignored — local artifacts).

Spacing

  • PANE_PAD_X 2 → 3, PANE_GAP_X 1 → 2, CHROME_GAP_Y 1 → 2: pane text starts four cells in (border + padding), panes and chrome rows no longer touch.
  • New height-gated COMPOSER_GAP_Y (2) for the transcript↔composer gutter; collapses to 1 below AIRY_MIN_ROWS, so 80×18 keeps its rows.
  • Airy density adds one blank row after the You / Answer speaker labels.
  • Deleted dead metrics TURN_GAP_H, REQUEST_GAP_H, COMPOSER_PAD_Y, TRANSCRIPT_MAX_W; live metrics pinned in the metric test.

Colour hierarchy

surface_hover was stronger than selection in dark (and weaker in light), inverting the intended focus > selection > hover ordering.

  • dark: hover #2E2E2E → #303030, selection #292929 → #373737
  • light: hover #D4D4D4 → #D0D0D0, selection #E2E2E2 → #C8C8C8
  • Selection depth is capped by the existing WCAG AA check (muted tag on selection ≥ 4.5:1); a new built-in test asserts the ordering in both themes.

Hover coverage

  • Queued-message rows: raised ground + weight step + reserved › gutter, via a hit test shared between paint and pointer routing.
  • File rows: weight step on hover.
  • Approval options: reserved › marker on the first row.
  • Selection still outranks hover; disabled rows and blocked overlays never take hover.

Docs

FORGE-DESIGN.md §5, §7.5, §7.5.1, §8.6, §9.4 updated.

Validation

  • cargo test --package forge-tui --locked — 1261 lib tests + integration pass
  • cargo test --package forge-config --locked — 100 pass
  • cargo fmt --all -- --check, cargo clippy --workspace --all-targets --locked -- -D warnings — clean
  • PTY verification at 80×18, 120×40, 160×50: label gaps, composer-gap collapse at 80×18, file/tab/footer-chip hover, queued strip render

No behaviour, keybinding, persistence or JSON changes.

Push the airy pass one step further and make hover honest about what is
clickable, without changing behaviour, focus ownership or persistence.

Spacing
- PANE_PAD_X 2 -> 3, PANE_GAP_X 1 -> 2, CHROME_GAP_Y 1 -> 2; pane text now
  starts four cells in (border + padding) and panes and chrome no longer
  touch.
- New COMPOSER_GAP_Y (2) for the transcript-composer gutter, gated on
  AIRY_MIN_ROWS so 80x18 collapses to the old single row.
- Airy density adds one blank row after the You and Answer speaker labels,
  so a label reads as a heading rather than a prefix.
- Delete the dead metrics TURN_GAP_H, REQUEST_GAP_H, COMPOSER_PAD_Y and
  TRANSCRIPT_MAX_W (no references outside design.rs) and pin the live ones
  in the metric test.

Colour
- Restore the selection > hover hierarchy: dark surface_hover #2E2E2E ->
  #303030 and selection #292929 -> #373737; light surface_hover #D4D4D4 ->
  #D0D0D0 and selection #E2E2E2 -> #C8C8C8. Selection depth is capped by the
  WCAG AA tag-on-selection check; a new built-in test asserts the ordering.

Hover
- Queued-message rows take the shared pointer treatment (raised ground,
  weight step, reserved marker gutter) through a hit test shared with paint.
- File rows gain a weight step; approval options gain the reserved `>` marker
  on the first row. Selection still outranks hover everywhere.

Docs: FORGE-DESIGN SS5, SS7.5, SS7.5.1, SS8.6 and SS9.4 updated to match.

Tests: forge-tui (1261 lib + integration) and forge-config suites pass;
fmt and clippy clean. Verified in a real PTY at 80x18, 120x40, 160x50,
including file/tab/chip hover and the composer-gap collapse.
@mohitranka
mohitranka merged commit bff4579 into main Sep 12, 2026
3 checks passed
mohitranka added a commit that referenced this pull request Sep 12, 2026
Follow-up to #657 (round 2), driven by a fresh PTY review of the merged
build.

Spacing
- Distinct tool/activity groups are separated by one blank row in airy
  density; rows inside one group stay tight. Compact density unchanged.
- Source viewer and diff pane render one blank row between the pane title
  and the content when the pane is tall enough, so the header reads as
  chrome rather than the first file/patch line.
- Session rows take a weight step on hover, matching file rows.

Overlay mouse support (round 2's deferred item)
- Overlay list rows record screen rects during paint
  (`OverlayWidget::row_sink`, `render_theme_dock`), so pointer hit-testing
  and the renderer share one geometry.
- Single click selects a row (and the focused column for the unified
  provider/model/effort picker); double-click confirms through the same
  `Enter` path the keyboard uses, so side effects stay in one place.
- Hover takes the shared treatment (surface_hover ground + weight step);
  selection keeps its stronger ground and `>` marker, and hover never moves
  the selection or pane focus.
- Coverage: unified picker (providers/models/effort), resume picker,
  session switcher, theme dock (hover re-previews, click selects,
  double-click applies). Slash palette stays keyboard-only by design.

Docs: FORGE-DESIGN SS7.5.1/SS8.6/SS9.4/SS9.7/SS9.8 updated.

Tests: forge-tui 1264 lib + integration pass; fmt and clippy clean. PTY
verified: hovered picker row #303030 bold, click moves selection, double
click applies the model; source/diff title spacer visible.

Co-authored-by: t <t@t>
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.

1 participant