Skip to content

dashboard: add an opt-in window index column - #227

Open
alebiscotto wants to merge 2 commits into
raine:mainfrom
alebiscotto:dashboard-window-column
Open

dashboard: add an opt-in window index column#227
alebiscotto wants to merge 2 commits into
raine:mainfrom
alebiscotto:dashboard-window-column

Conversation

@alebiscotto

Copy link
Copy Markdown
Contributor

Note

Builds on #225 (dashboard.columns), which the new column is selected through. The first commit here is that PR; review it first, and this branch rebases cleanly once it lands.

Why

The sidebar can show the tmux window index since the {window_index} token, but the dashboard cannot — and the dashboard is the view that lists every agent across sessions, so it is where lining the table up with the tmux status bar is most useful. Knowing that an agent is in window 3 means prefix + 3 gets you there.

The number was simply not available: LivePaneInfo carried window_id but no index, and the sidebar gets its own from a separate query in the sidebar daemon.

What

  • LIVE_PANE_FORMAT asks tmux for #{window_index} and LivePaneInfo carries it.
  • Reconciliation stamps it onto each agent, and treats it as a live property: a stored index goes stale as soon as windows are moved or renumbered. window_id is refreshed from the live pane in the same place, for the same reason.
  • The column is opt-in through dashboard.columns, so nothing changes unless it is asked for:
dashboard:
  columns: [window, status, time, title]
  • Backends that do not number their windows (wezterm, zellij, kitty) leave the cell blank rather than printing a placeholder.

A latent bug this surfaced

parse_live_pane_line_strict required exactly 9 fields, while the lossy parser reads trailing fields with get(). Adding one field to the format made the strict path reject real tmux output outright — workmux status failed with tmux returned malformed pane information on live panes. It now accepts the required prefix and treats later fields as optional, so the format can grow again without breaking. This is the same shape of problem as #213: strict parsing turning a benign difference into a hard failure.

Testing

  • Three parser tests: the index is read, its absence yields None, and the strict parser accepts fields beyond the required prefix.
  • Full suite green (1424 passed), cargo fmt --check clean.
  • Verified against a real tmux server: the format string and strict parser handle live output (that is how the bug above was found), and the rendered header shows Win in the configured position.

The columns after Git were fixed as status, time, title, so reading the title
meant skipping over a timer that is rarely the interesting part. Header cells,
row cells and width constraints now all derive from dashboard.columns, which
keeps them in sync by construction, and an omitted column simply is not
rendered. Defaults are unchanged.
The sidebar shows the tmux window index since {window_index}, but the dashboard
could not: LivePaneInfo carried window_id and no index, so the number that
prefix + <n> uses was missing from the one view that lists every agent.

LIVE_PANE_FORMAT now asks tmux for it and LivePaneInfo carries it, so
reconciliation can stamp it on each agent as a live property rather than a
stored one that goes stale when windows are renumbered. The column is opt-in
through dashboard.columns and blank on backends that do not number windows.

parse_live_pane_line_strict required exactly 9 fields, so it rejected live tmux
output the moment the format grew: it now accepts the required prefix and reads
later fields with get(), like the lossy parser already did.
@raine

raine commented Aug 17, 2026

Copy link
Copy Markdown
Owner

I'll try to have look at your PRs soon

@alebiscotto

alebiscotto commented Aug 19, 2026 via email

Copy link
Copy Markdown
Contributor Author

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.

2 participants