2
0
Fork 0

feat: show the session age and mark the last opened window #43

Merged
aleksei merged 7 commits from feat/session-activity-and-last-window into main 2026-11-24 00:15:37 +00:00
Owner

Summary

  • The portal now lists tmux #{session_activity} on every session. Session gained an activity field (unix seconds), so the session format has five fields.
  • The session header shows that value as a short age (now, 7m, 2h, 3d) in fg.subtle, left of the ellipsis trigger and right-aligned so its right edge lines up with the bell dots in the window cards. It refreshes with the two-second tree poll.
  • Session also carries lastWindow: the head of #{session_stack}, the window index the session used last. No browser storage is involved, so a window selected by any tmux client is picked up. An empty stack gives null; a non-numeric head is a parse error.
  • Every window card keeps the plain 1px border. The window the session used last keeps the normal foreground title; every other window name is drawn in border.emphasized (#5c6370), so the last window is the only bright one. No icon, no extra edge, no layout shift.
  • Update the README, adr/tmux.md and adr/ui.md.

Test plan

  • npm run typecheck
  • npm run build
  • MUX_PORTAL_UI_SKIP_BUILD=1 cargo test --workspace (57 + 9 + 4 + 1 tests pass, including new cases for an empty and a malformed stack)
  • Playwright against a temp server:
    • ages match tmux, e.g. 02:roombox at 4241 s old renders 1h, a fresh session now, 06:print 38m;
    • the age right edge is 846px against the 845px bell column on the same row;
    • the title of the stack-head window computes rgb(171, 178, 191) while the rest compute rgb(92, 99, 112); every card stays at 1px rgb(62, 68, 81) on all four edges and 500px wide;
    • marks follow session_stack live: selecting another window in tmux moved the emphasis within one poll, without a reload;
    • localStorage stays empty — mux-portal:last-windows is no longer written.
## Summary - The portal now lists tmux `#{session_activity}` on every session. `Session` gained an `activity` field (unix seconds), so the session format has five fields. - The session header shows that value as a short age (`now`, `7m`, `2h`, `3d`) in `fg.subtle`, left of the ellipsis trigger and right-aligned so its right edge lines up with the bell dots in the window cards. It refreshes with the two-second tree poll. - `Session` also carries `lastWindow`: the head of `#{session_stack}`, the window index the session used last. No browser storage is involved, so a window selected by any tmux client is picked up. An empty stack gives `null`; a non-numeric head is a parse error. - Every window card keeps the plain 1px border. The window the session used last keeps the normal foreground title; every other window name is drawn in `border.emphasized` (`#5c6370`), so the last window is the only bright one. No icon, no extra edge, no layout shift. - Update the README, `adr/tmux.md` and `adr/ui.md`. ## Test plan - `npm run typecheck` - `npm run build` - `MUX_PORTAL_UI_SKIP_BUILD=1 cargo test --workspace` (57 + 9 + 4 + 1 tests pass, including new cases for an empty and a malformed stack) - Playwright against a temp server: - ages match tmux, e.g. `02:roombox` at 4241 s old renders `1h`, a fresh session `now`, `06:print` `38m`; - the age right edge is 846px against the 845px bell column on the same row; - the title of the stack-head window computes `rgb(171, 178, 191)` while the rest compute `rgb(92, 99, 112)`; every card stays at `1px rgb(62, 68, 81)` on all four edges and 500px wide; - marks follow `session_stack` live: selecting another window in tmux moved the emphasis within one poll, without a reload; - `localStorage` stays empty — `mux-portal:last-windows` is no longer written.
Sessions expose tmux session_activity, and the session header renders it as a relative age right-aligned with the window bell dots. The window the user opened last is remembered in localStorage and marks its session with a small left-arrow after the name.
Every session remembers its own last opened window in localStorage, and the arrow moves from the session header to that window card, 0.5em after the window name. The marker is now an arrow with a shaft at 12px rather than the bare chevron.
aleksei changed title from feat: show the session age and the last opened window to feat: show the session age and mark the last opened window 2026-11-23 23:54:34 +00:00
Session carries lastWindow, the head of #{session_stack}, so the marker no longer depends on browser storage and follows a window selected by any client. The arrow doubles to 24px and the localStorage store is dropped.
The marker goes from 24px to 18px, midway between the first 12px chevron and the doubled arrow.
The card of the window a session used last draws a 3px border.emphasized left border instead of an arrow in the row. The arrow icon variant is dropped again.
The marked window card keeps a slightly thicker left border, now 2px instead of 3px.
Cards go back to a plain 1px border. The window the session used last keeps the normal foreground title, and every other window name is drawn in border.emphasized, so the last window stands out without a separate marker.
aleksei deleted branch feat/session-activity-and-last-window 2026-11-24 00:15:37 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
zoo/mux-portal!43
No description provided.