TUI: render line 2 on every session card #121

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

Implement the amended card contract in the TUI sidebar. Read docs/SIDEBAR.md after #116 lands — it is the specification for both clients, and this issue is not licensed to depart from it.

What changes in crates/maestro-tui/src/sidebar.rs:

  • meta_row returns Option<Vec<Span>> and its early return at line 145 is the gate that hides line 2. Both go: meta_row always produces a row, and render_with_focus always pushes it.
  • The TUI has never rendered the session's command. It must now: the amended contract drops the permission to omit it, and without it a fresh card's second line would be a lone dot. The command is the trailing fragment, in the muted style, after the blocked-work and exited fragments.
  • META_LINE_AFTER_SECS keeps its value and its meaning narrows: under 30 seconds no duration is rendered, but the dot is. Update the constant's doc comment, which currently says time-in-state "earns a meta line".
  • The module's own header comment describes line 2 as "Absent entirely when it has nothing to say". Correct it.

Every card is now exactly two lines, which makes the sidebar's line count a simple function of the session count. Do not leave code in place that computes it as if rows were variable — later work in this milestone depends on that predictability.

Truncation: the existing budget logic exists so a long activity_detail truncates ahead of the trailing fragments instead of pushing them off the line. The command is now one of those trailing fragments and joins the same reservation. On a narrow panel where even the command cannot fit, the command is what truncates — the dot and duration are never dropped.

Tests: the existing sidebar.rs tests assert the absence of a meta line in several places and need rewriting rather than deleting. Add the cases the change is about — a fresh session renders two lines with no duration, a session past 30 seconds renders one, and a card renders its command whether or not the name came from metadata.name.

Depends on: #116, #118

Implement the amended card contract in the TUI sidebar. Read `docs/SIDEBAR.md` after #116 lands — it is the specification for both clients, and this issue is not licensed to depart from it. What changes in `crates/maestro-tui/src/sidebar.rs`: - `meta_row` returns `Option<Vec<Span>>` and its early return at line 145 is the gate that hides line 2. Both go: `meta_row` always produces a row, and `render_with_focus` always pushes it. - The TUI has never rendered the session's command. It must now: the amended contract drops the permission to omit it, and without it a fresh card's second line would be a lone dot. The command is the trailing fragment, in the muted style, after the blocked-work and exited fragments. - `META_LINE_AFTER_SECS` keeps its value and its meaning narrows: under 30 seconds no duration is rendered, but the dot is. Update the constant's doc comment, which currently says time-in-state "earns a meta line". - The module's own header comment describes line 2 as "Absent entirely when it has nothing to say". Correct it. Every card is now exactly two lines, which makes the sidebar's line count a simple function of the session count. Do not leave code in place that computes it as if rows were variable — later work in this milestone depends on that predictability. Truncation: the existing budget logic exists so a long `activity_detail` truncates ahead of the trailing fragments instead of pushing them off the line. The command is now one of those trailing fragments and joins the same reservation. On a narrow panel where even the command cannot fit, the command is what truncates — the dot and duration are never dropped. Tests: the existing `sidebar.rs` tests assert the absence of a meta line in several places and need rewriting rather than deleting. Add the cases the change is about — a fresh session renders two lines with no duration, a session past 30 seconds renders one, and a card renders its command whether or not the name came from `metadata.name`. Depends on: #116, #118
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: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
Author
Collaborator

Out-of-scope full-suite failure observed while validating #121:

  • crates/maestro-e2e/tests/e2e.rs::retained_store_survives_a_daemon_restart failed because the restarted daemon reset the /api/worktrees connection (connection reset by peer).

This is outside the TUI sidebar ownership fence and was not changed here.

Out-of-scope full-suite failure observed while validating #121: - `crates/maestro-e2e/tests/e2e.rs::retained_store_survives_a_daemon_restart` failed because the restarted daemon reset the `/api/worktrees` connection (`connection reset by peer`). This is outside the TUI sidebar ownership fence and was not changed here.
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Reference: naps62/maestro#121