Skip to content

Flat box-free dashboard + subscreen footers; hide dashboard cursor - #165

Merged
TraderSamwise merged 3 commits into
masterfrom
chore/tui-next-20
Jun 18, 2026
Merged

Flat box-free dashboard + subscreen footers; hide dashboard cursor#165
TraderSamwise merged 3 commits into
masterfrom
chore/tui-next-20

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jun 18, 2026

Copy link
Copy Markdown
Owner

What

A footer redesign pass after the grouped two-row layout proved fragile at unpredictable terminal widths (category labels orphan once a row wraps).

Flat, box-free footer

  • The footer is now a flat, ordered list of every active key, rendered as one line that wraps naturally to the available width — no grouping, no width-conditional dropping/hiding (no faked responsiveness). buildDashboardFooterRows (FooterRow/FooterGroup) → flat buildDashboardFooterHints + renderFooterHints; the row/group machinery is removed.
  • Box-free keys (footerKey): a bold glyph (red for destructive x) instead of a filled pill, so a dense row stays light and there are no gray padding blocks flanking each key. Boxed keycaps are kept where they aid affordance/alignment (overlays, inline list selection numbers).
  • Propagated the box-free style to the subscreen footers (coordination/project/library/topology/graveyard) via footerHints, so every bottom hint bar matches.

Cursor

  • Hide the terminal cursor on the dashboard so it no longer parks as a block after the last footer key. Input overlays already draw their own _ caret; the cursor is restored on exit.

Theme

  • Drop the now-unused accentSoft tone; keep the named keycap color constants (KEYCAP_BG/KEYCAP_FG/KEYCAP_DANGER_FG). Title-case tabs and red destructive x are retained.

Presentation-only — no key bindings or behavior change; each state variant keeps its exact key set (covered by tests).

Tests

  • renderFooterHints / footerKey / footerHints: flat wrap to width (all hints shown), box-free rendering, red destructive key.
  • buildDashboardFooterHints: flat ordered list + per-variant key coverage.
  • writeFrame asserts the cursor-hide sequence.
  • Full suite green: typecheck, lint (max-warnings 0), 1410 tests, build.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added “danger” tinting for destructive actions so delete/kill/stop keys render in red.
    • Updated dashboard footer to use a flat, wrapping hint list with improved keycap styling (including destructive hint tint).
  • Improvements

    • Improved dashboard terminal refresh behavior by hiding the cursor, repositioning to the home location, and clearing before drawing the updated frame.
    • Footer hint layout now truncates/wraps cleanly to fit the terminal width.

test and others added 2 commits June 18, 2026 10:26
Rework the dashboard footer after the grouped two-row layout proved fragile at
unpredictable widths (category labels orphan once rows wrap).

- Flat list of every active key, rendered as one line that wraps naturally to
  width — no grouping, no width-conditional dropping. buildDashboardFooterRows
  (FooterRow/FooterGroup) is replaced by a flat buildDashboardFooterHints +
  renderFooterHints; FooterGroup/FooterRow/renderFooterRows are removed.
- Box-free keys: footerKey renders a bold glyph (red for destructive) instead of
  a filled pill, so a dense row stays light and has no padding blocks. Boxed
  keycaps are kept elsewhere (overlays, inline list numbers) where they aid
  affordance/alignment.
- Hide the terminal cursor on the dashboard so it no longer parks as a block
  after the last key; input overlays draw their own caret and the cursor is
  restored on exit.
- Drop the now-unused accentSoft tone; keep the named keycap color constants.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add footerHints (box-free variant of keycapHints) and use it for the
coordination/project/library/topology/graveyard footer bars, so every bottom
hint row matches the dashboard's box-free style. Inline list selection numbers
stay boxed (keycap) as an affordance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Jun 18, 2026 3:20am

@TraderSamwise

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c9308db8-f57a-4205-8674-139c947eb473

📥 Commits

Reviewing files that changed from the base of the PR and between 3201914 and fe4ff78.

📒 Files selected for processing (1)
  • src/tui/screens/dashboard-renderers.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/tui/screens/dashboard-renderers.ts

📝 Walkthrough

Walkthrough

The PR replaces the grouped FooterRow/FooterGroup footer rendering model in the TUI theme with a flat FooterHint tuple type and renderFooterHints greedy-wrapping function. keycap and keycapHint gain an optional "danger" tone parameter for red destructive key styling. The dashboard footer is rewired to buildDashboardFooterHints, and all subscreen renderers switch from keycapHints to footerHints. Separately, writeFrame adds an ANSI cursor-hide escape before screen clearing.

Changes

Footer rendering refactor: flat hints model

Layer / File(s) Summary
Theme API: FooterHint type, danger tone, footerKey/footerHints/renderFooterHints
src/tui/render/theme.ts, src/tui/render/theme.test.ts
keycap/keycapHint gain tone?: "danger" support. footerKey (bold, box-free) and footerHints (line formatter) are added. FooterGroup/FooterRow/renderFooterRows are replaced by FooterHint tuple type and renderFooterHints(hints, width) for greedy-width wrapping. Tests cover danger tinting and multi-line wrapping.
Dashboard footer: buildDashboardFooterHints + renderDashboardFrame
src/tui/screens/dashboard-renderers.ts, src/tui/screens/dashboard-renderers.test.ts
buildDashboardFooterRows is replaced by buildDashboardFooterHints, returning a flat ordered FooterHint[] based on navigation level, selection, and worktree/session state, with the x kill action tagged "danger". renderDashboardFrame renders hints left-aligned with a gutter and per-line truncation. Tests validate ordering, danger tagging, and active key coverage.
Subscreen renderers: footerHints adoption
src/tui/screens/subscreen-renderers.ts
Coordination, project, topology, graveyard, and library screen renderers switch from keycapHints to footerHints at each call site, with matching import update.

writeFrame cursor-hide fix

Layer / File(s) Summary
writeFrame cursor-hide escape + test
src/multiplexer/dashboard-state-methods.ts, src/multiplexer/dashboard-view-methods.test.ts
writeFrame now emits \x1b[?25l before \x1b[H\x1b[J in dashboard mode. The test assertion is updated to expect the additional escape code.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • TraderSamwise/aimux#135: Introduces the keycap/keycapHint theme primitives in src/tui/render/theme.ts that this PR extends with the tone: "danger" parameter and new footer helpers.
  • TraderSamwise/aimux#149: Touches keycapHint and related keycap hint rendering utilities in theme.ts that this PR further modifies with the tone parameter and replaces as part of the footer model change.
  • TraderSamwise/aimux#164: Modifies the grouped FooterRows/buildDashboardFooterRows dashboard footer layout APIs that this PR directly replaces with the flat footerHints/renderFooterHints model.

Poem

🐇 Hop hop, the footer's flat now, no more rows in a group,
The danger key glows red — a warning in the loop!
The cursor hides before the frame, all tidy on screen,
footerHints replaces the old, keeps the layout clean.
From graveyard to library, the helpers all align,
A rabbit's TUI polish — every keycap a sign! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the three main changes: flat box-free footer redesign, consistency across subscreen footers, and cursor hiding on dashboard.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/tui-next-20

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/tui/screens/dashboard-renderers.test.ts (1)

30-99: ⚡ Quick win

Add a narrow-terminal footer rendering test.

Current footer tests validate key selection/order, but not rendered wrapping under small cols (where truncation risk exists). A renderDashboardFrame(..., cols < 72, ...) assertion that all expected footer labels remain present would lock this behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/tui/screens/dashboard-renderers.test.ts` around lines 30 - 99, Add a new
test case within the "buildDashboardFooterHints" describe block that validates
footer rendering behavior under narrow terminal conditions. Use
renderDashboardFrame with a cols parameter less than 72 and assert that all
expected footer hint labels remain present in the rendered output without being
truncated. This test should verify that the footer wrapping behavior preserves
all hints when terminal width is constrained, complementing the existing key
selection and ordering tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/tui/screens/dashboard-renderers.ts`:
- Around line 817-822: The footer hints rendering is using contentWidth (which
has a minimum of 72) for wrapping via renderFooterHints, but then truncating to
cols on line 821. This causes hints to get hidden on narrow terminals instead of
wrapping properly. Change the renderFooterHints call to use Math.max(0, cols)
instead of footerWidth so that hints are wrapped to the actual terminal width
rather than a minimum width of 72, ensuring proper wrapping behavior on narrow
terminals.

---

Nitpick comments:
In `@src/tui/screens/dashboard-renderers.test.ts`:
- Around line 30-99: Add a new test case within the "buildDashboardFooterHints"
describe block that validates footer rendering behavior under narrow terminal
conditions. Use renderDashboardFrame with a cols parameter less than 72 and
assert that all expected footer hint labels remain present in the rendered
output without being truncated. This test should verify that the footer wrapping
behavior preserves all hints when terminal width is constrained, complementing
the existing key selection and ordering tests.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ea927e4c-528f-47e8-98ec-c9e3638b801f

📥 Commits

Reviewing files that changed from the base of the PR and between 82317ea and 3201914.

📒 Files selected for processing (7)
  • src/multiplexer/dashboard-state-methods.ts
  • src/multiplexer/dashboard-view-methods.test.ts
  • src/tui/render/theme.test.ts
  • src/tui/render/theme.ts
  • src/tui/screens/dashboard-renderers.test.ts
  • src/tui/screens/dashboard-renderers.ts
  • src/tui/screens/subscreen-renderers.ts

Comment thread src/tui/screens/dashboard-renderers.ts Outdated
renderFooterHints was wrapping to contentWidth (min 72) but each line is
truncated to cols, so on panes narrower than 72 trailing keys were clipped
instead of wrapping. Wrap to cols - indent instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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