Skip to content

Refine Exposé tiles: aligned header, status detail + recency, heavy focus border - #151

Merged
TraderSamwise merged 3 commits into
masterfrom
chore/tui-next-7
Jun 16, 2026
Merged

Refine Exposé tiles: aligned header, status detail + recency, heavy focus border#151
TraderSamwise merged 3 commits into
masterfrom
chore/tui-next-7

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented Jun 16, 2026

Copy link
Copy Markdown
Owner

What

Follow-up polish on the Exposé tile restyle (#150), from live review.

  • Aligned header rows — the status pill (and the context row in compact mode) are inset by the marker width so they line up under the title text in the top rule instead of hugging the left border.
  • Status detail + recency on the pill row — the row now shows the agent's status text (the dashboard's "last message" semantics) plus a relative recency (41s ago). To make recency available, the agent's last-event timestamp is plumbed into the tmux window metadata as lastActivityAt (syncTmuxWindowMetadata), then rendered via formatRelativeRecency.
  • Focus = bolder outline, not a color — the selected tile uses a heavy-line border (┏━┓┃┗┛); unselected stays light (╭─╮│╰╯). Both always carry the agent's state color (bright when focused, dimmed otherwise), so there's no distinct "selection blue".

Preview

┏ ▸ 1 claude(coder) (here) · aimux / beautify-tui ━━━━━━━━━━━┓
┃    WORKING   41s ago · almost done thinking                ┃
┃ <live captured pane preview…>                              ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
╭   2 codex(coder) · aimux / agent-state ────────────────────╮
│    IDLE   2m ago · waiting for input                       │
╰────────────────────────────────────────────────────────────╯

Tests

  • typecheck ✓, lint ✓, build ✓
  • 1328 tests pass; added coverage for header inset, status detail, relative recency, and the heavy-vs-light focus border.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Tiles now display relative activity timestamps (e.g., "5 mins ago") in their headers for quick recency reference
    • Selected tiles feature a more prominent, heavier border style for improved visual distinction
    • Activity recency information is integrated with status details to provide clearer context about agent state

test and others added 2 commits June 16, 2026 09:23
- Inset the pill/context header rows by the marker width so they line up
  under the title text in the top rule (instead of hugging the left border).
- Show the agent's status text (the dashboard's "last message" semantics)
  after the pill on the status row.
- Indicate the focused tile with a bolder heavy-line border (┏━┓┃┗┛) instead
  of a distinct selection color; the border always reflects the agent state,
  bright when focused and dimmed otherwise.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Plumb the agent's last-event timestamp into the tmux window metadata
(lastActivityAt) so Exposé can show dashboard-style relative recency
("41s ago") next to the status pill, alongside the status text.

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 1:42am

@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 13 minutes and 1 second. 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: 208a8409-e8b1-4ebd-be0f-be3f25f64f59

📥 Commits

Reviewing files that changed from the base of the PR and between 3b164db and 3354172.

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

Walkthrough

Adds an optional lastActivityAt field to TmuxWindowMetadata, populated from session event history in buildTmuxWindowMetadata. The Exposé tile renderer uses this to show relative-recency text in tile headers alongside status, and switches between heavy and light box-drawing borders based on tile selection state.

Changes

Exposé tile recency display and heavy-border selection

Layer / File(s) Summary
TmuxWindowMetadata contract and data population
src/tmux/runtime-manager.ts, src/multiplexer/session-runtime-core.ts
Adds optional lastActivityAt?: string to TmuxWindowMetadata and populates it in buildTmuxWindowMetadata using sessionMetadata.derived.lastEvent.ts with fallback to sessionMetadata.updatedAt.
buildTileHeader signature extension and drawTile rewrite
src/tmux/expose.ts
Imports formatRelativeRecency; extends buildTileHeader with detail and inset parameters for aligned wrapped context rows and a combined pill+detail status row; rewrites drawTile to select heavy vs. light box characters based on selection state, compute recency from lastActivityAt, and render all borders with the chosen character set.
Tile rendering tests
src/tmux/expose-tile.test.ts
Updates buildTileHeader call sites with the new detail/inset arguments and adds assertions for inset alignment and pill+detail layout; updates drawTile frame-glyph expectations for heavy/light borders and adds tests verifying statusText pill display and lastActivityAt-derived "ago" recency strings.

Sequence Diagram(s)

sequenceDiagram
  participant Session as session-runtime-core
  participant Meta as TmuxWindowMetadata
  participant Draw as drawTile
  participant Recency as formatRelativeRecency
  participant Header as buildTileHeader

  Session->>Meta: populate lastActivityAt (lastEvent.ts ?? updatedAt)
  Draw->>Recency: lastActivityAt
  Recency-->>Draw: "3m ago"
  Draw->>Header: context, pillStr, detail="3m ago · statusText", inset
  Header-->>Draw: ruleTitle, headerRows (pill row + wrapped context)
  Draw->>Draw: render borders with heavy box chars (selected) or light (unselected)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • TraderSamwise/aimux#150: Directly modifies the same buildTileHeader/drawTile rendering flow and expose-tile.test.ts assertions that this PR extends.
  • TraderSamwise/aimux#122: Touches both src/tmux/expose.ts tile/header composition and src/tmux/runtime-manager.ts, the same files where lastActivityAt is now wired.

Poem

🐰 Hop, hop! A timestamp arrives,
From the last event that survived.
Heavy borders glow when tiles are picked,
"3m ago" beside the pill is fixed.
The rabbit watches time tick by—
Recency rendered, displayed up high! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.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 PR title accurately summarizes the three main changes: refined header alignment ('aligned header'), status detail with recency indicator ('status detail + recency'), and the new heavy focus border ('heavy focus border'). It is concise, specific, and directly reflects the core objectives described in the PR summary.
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-7

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-tile.test.ts`:
- Around line 112-121: The test is using real wall-clock time (Date.now()) to
calculate the lastActivityAt timestamp, but then asserting an exact "41s ago"
string in the expectations. Small execution delays can cause the elapsed time to
increment to 42 seconds or more, causing intermittent failures. Mock the current
time (using a testing utility like jest.useFakeTimers or similar) to fix the
current time before creating the lastActivityAt timestamp and calling
renderTile, ensuring the elapsed time calculation is always deterministic. Set
the mocked "now" such that the expected 41 second difference matches exactly
when the tile is rendered.
🪄 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: 8fd4ac34-e71e-497c-bbe2-59bb93dc5ba8

📥 Commits

Reviewing files that changed from the base of the PR and between 14ad639 and 3b164db.

📒 Files selected for processing (4)
  • src/multiplexer/session-runtime-core.ts
  • src/tmux/expose-tile.test.ts
  • src/tmux/expose.ts
  • src/tmux/runtime-manager.ts

Comment thread src/tmux/expose-tile.test.ts Outdated
…cy test

- fitHeaderRows is now told the status row is worth keeping when it carries
  the recency/status detail even if there's no status pill, so a recency-only
  row isn't dropped on a short tile.
- Use a minutes-bucket delta in the recency tests so the assertion can't flake
  on sub-second wall-clock drift.

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

Copy link
Copy Markdown
Owner Author

Concurrent sub-agent review — one finding beyond the CodeRabbit thread (fixed in 3354172):

  • Recency-only status row could be dropped (correctness). fitHeaderRows was told to preserve the status row only when a status pill was present (hasPill = pillStr !== ""). An agent with no recognized status kind (no pill) but with lastActivityAt set produces a row carrying just the recency/status detail — under capacity pressure on a short tile that row was treated as droppable context. Now hasPill = pillStr !== "" || detail !== "", so the row survives. Regression test added (short tile, no pill, recency present → row kept).

@TraderSamwise
TraderSamwise merged commit f9ec9ce into master Jun 16, 2026
3 checks passed
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