Skip to content

Restyle Exposé tiles: state-tinted borders, inlined title, status pills - #150

Merged
TraderSamwise merged 2 commits into
masterfrom
chore/tui-next-6
Jun 16, 2026
Merged

Restyle Exposé tiles: state-tinted borders, inlined title, status pills#150
TraderSamwise merged 2 commits into
masterfrom
chore/tui-next-6

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jun 16, 2026

Copy link
Copy Markdown
Owner

What

Brings the Exposé tiles into the dashboard's design language (Direction C, approved in design review).

  • State-tinted borders — each tile's frame is colored by the agent's state (Working=cyan, Idle=muted, Needs input=amber, Error=red, Done=green, Blocked=magenta). Selected = bright border + accent badge; others = dimmed state border, so state-color and selection never conflict.
  • Title inlined in the top rule▸ badge · identity · context, matching the card() top-rule layout; rounded corners.
  • Status as a pill on its own row — new renderAgentStatusPill / agentStatusKind helpers in the shared agent-status module; uppercase, state-tinted.
  • Responsive header — context stays in the top rule when it fits, else drops to its own wrapped row(s); preview line count shrinks to make room. Handles dense, narrow grids.
  • Scope context — project scope always shows the worktree; meta scope shows project / worktree (new "project-worktree" sublabel in expose-model.ts).

Preview (ANSI stripped)

╭ ▸ 3 claude(coder) (here) · aimux / beautify-tui ────────╮     ╭ ▸ 3 claude(coder) (here) ──╮
│  NEEDS INPUT                                            │     │ aimux / beautify-tui       │
│ * Worked for 41s                                        │     │  NEEDS INPUT               │
╰─────────────────────────────────────────────────────────╯     ╰────────────────────────────╯
        wide: context in rule + pill row                          narrow: context drops to a row

Tests

  • typecheck ✓, lint ✓, build ✓
  • 1319 tests pass; added buildTileHeader (responsive breakpoint) + drawTile (border tint, pill, height) coverage; updated the meta-scope sublabel assertion.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Improvements
    • Enhanced tile visualization with improved border styling and status pill presentation.
    • Improved tile header layout with better context formatting and visibility handling.
    • Updated scope labeling terminology from "project" to "project-worktree".

Adopt the dashboard card vocabulary for Exposé tiles (Direction C):

- Tile border is tinted to the agent's state (bright when selected, dimmed
  otherwise), so the grid reads by state at a glance.
- Window title is inlined into the top rule (badge · identity · context),
  matching the card() top-rule layout.
- Status renders as an uppercase state-tinted pill on its own dedicated row
  (new renderAgentStatusPill/agentStatusKind helpers), so the signal stays
  legible at any tile width.
- Responsive header: the worktree/project context stays in the top rule when
  it fits, else drops to its own wrapped row(s); preview lines shrink to make
  room. Handles dense, narrow grids.
- Project scope always shows the worktree; meta scope shows project / worktree
  (new "project-worktree" sublabel).

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

vercel Bot commented Jun 16, 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 16, 2026 12:43am

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@TraderSamwise, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 11 minutes and 43 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: da361b49-5c6d-4c05-96e6-ab7b70b22adc

📥 Commits

Reviewing files that changed from the base of the PR and between 7d16bfd and 7195ba1.

📒 Files selected for processing (2)
  • src/tmux/expose-tile.test.ts
  • src/tmux/expose.ts
📝 Walkthrough

Walkthrough

Adds agentStatusKind and renderAgentStatusPill exports to the agent-status module. Renames the "project" ExposeSublabel variant to "project-worktree" throughout the model, model test, and tile renderer. Rewrites Exposé tile rendering in expose.ts with state-derived 256-color borders, a new exported buildTileHeader helper, and a redesigned drawTile. Adds 69 lines of Vitest tests covering both new functions.

Changes

Exposé Tile Rendering Overhaul

Layer / File(s) Summary
Agent status kind and pill rendering utilities
src/tui/render/agent-status.ts
Adds pill import from theme and exports agentStatusKind (returns StatusKind | null) and renderAgentStatusPill (returns an uppercase, status-tinted pill string or "").
ExposeSublabel type rename and model update
src/tmux/expose-model.ts, src/tmux/expose-model.test.ts
Replaces "project" with "project-worktree" in the ExposeSublabel union type and the "global" scope branch of loadExposeScopeItems; updates the matching test assertion.
buildTileHeader, drawTile rewrite, and tileSublabel update
src/tmux/expose.ts
Swaps imports to use agentStatusKind/renderAgentStatusPill and ANSI width utilities; introduces STATE_BORDER/NEUTRAL_BORDER palettes and exported buildTileHeader; rewrites drawTile to derive border colors from agentStatusKind and assemble box-drawing output; updates tileSublabel to handle only "worktree" and "project-worktree".
Tile rendering tests
src/tmux/expose-tile.test.ts
Adds tests for buildTileHeader layout variants and drawTile ANSI output (selected/unselected borders, inline context), with a shared renderTile helper.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • TraderSamwise/aimux#134: Overlaps at the same ExposeSublabel/loadExposeScopeItems model fields being switched from "project" to "project-worktree".
  • TraderSamwise/aimux#133: Modifies the same drawTile/header building code path in src/tmux/expose.ts, overlapping with the tile rendering rewrite here.
  • TraderSamwise/aimux#135: Touches the same theme.ts pill/status primitives that renderAgentStatusPill now depends on in agent-status.ts.

Poem

🐇 Hop hop, the tiles now glow,
With borders tinted, row by row!
project-worktree takes the stage,
A pill adorns each header page.
The bunny renders, sharp and bright —
Box-drawing frames in ANSI light! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% 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 clearly and concisely summarizes the primary visual and functional changes: state-tinted borders, inlined titles, and status pills for Exposé tiles.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/tui-next-6

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

@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

🤖 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/tmux/expose.ts`:
- Around line 203-206: The bodyRows construction unboundedly includes all
headerRows without checking if they fit within the bodyCapacity limit. When
wrapped context generates more header rows than available space, the tile
exceeds layout.tileHeight causing visual corruption. Modify the line where
bodyRows is constructed to cap headerRows by slicing it to only include rows
that fit within the remaining bodyCapacity after accounting for previewRows,
ensuring that headerRows.length plus previewRows.length does not exceed
bodyCapacity. This will prevent overflow while still preserving preview content
priority.
🪄 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: 1171dc6e-92a6-4770-9d6a-4b6c182dd7ce

📥 Commits

Reviewing files that changed from the base of the PR and between 87eb944 and 7d16bfd.

📒 Files selected for processing (5)
  • src/tmux/expose-model.test.ts
  • src/tmux/expose-model.ts
  • src/tmux/expose-tile.test.ts
  • src/tmux/expose.ts
  • src/tui/render/agent-status.ts

Comment thread src/tmux/expose.ts
- fitHeaderRows() caps header rows to the tile's body capacity so a wrapped
  context header can never push a tile past its height and overwrite the tile
  below; context rows drop first, the status pill is preserved.
- Reserve the selection-marker slot whether or not selected, so the title (and
  the wide/narrow header breakpoint) doesn't shift as selection moves.
- Top-rule dash count floors at 0 (not 2) so the rule width matches the body
  rows at degenerate tile widths.

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

Copy link
Copy Markdown
Owner Author

Concurrent sub-agent review — additional findings beyond the CodeRabbit thread (all fixed in 7195ba1):

  • Selection-marker layout shift (low). The marker added 2 visible columns only when selected, so navigating could flip a tile between wide (context in rule) and narrow (context dropped to a row), making the preview jump by a line. Now the marker slot is reserved (2 cols, rendered as spaces when unselected) so the header breakpoint is stable across selection.
  • Top-rule width at degenerate widths (low). dashCount floored at 2, so at pathological tile widths (e.g. width 4, reachable only at a 4-column terminal) the top rule rendered wider than the body rows. Floored at 0 instead; added a test asserting every rendered tile line has identical visible width.

(The header-overflow issue CodeRabbit raised is handled on its review thread.)

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