cmux-next sidebar: a workspace's hover card says what its agents did since you looked

Merged
TE
15d ago
+2342-1652

This is slice S6 of Leo's sidebar-organization ask (item A, the "since you last looked" digest).

What changes

When the selection leaves a workspace, the sidebar stamps when you last looked at it. The hover card of a workspace you aren't looking at now opens with what its agents did since then: "Since you looked: Done: 2 路 Asked: 1 路 Failed: 1".

  • What counts: the workspace's own history (WorkspaceTimelineReader, the same history the card lists): finished turns, questions or permission asks, and failed turns, counted after the stamp. With nothing new, there is no line. The workspace on screen gets no line.
  • Stamps: they stay on this Mac (SidebarLookedStore, UserDefaults cmux.next.sidebar.lastLooked). Only the newest 256 are kept.
  • Where it hooks in: the stamp comes from SidebarModel.selectedItem, which every selection path sets. The existing "a collapsed group's member stays shown" line moved into SidebarModel+Looked.noteLeft, so SidebarModel.swift doesn't grow. The App target is untouched.
  • Layouts: the line also shows in the log and minimal hover card layouts. The classic layout reads no history, so it shows no line.
  • Toggle: Debug toggle sidebar.sinceLooked, on by default.
  • Strings: four new strings, in all 21 locales. Each count gets a label ("Done: 3") instead of a plural.
  • Not yet: pull request merges aren't counted. The app keeps only each pull request's current state, so a merge since the stamp can't be detected yet; that is a follow-up.

No capture: the line only appears on a hover card for a workspace with agent turns logged after you left it. A fresh capture slot has no agent history, and the steps file has no way to hover a row, so a still would show nothing new. The tests check the card's content directly.

Tests

Tests/CmuxNextAppTests/SidebarSinceLookedTests.swift (committed first):

  • leaving a workspace stamps it;
  • the digest counts only what happened after the stamp;
  • the card leads with the digest;
  • the store keeps its newest stamps.

The fleet compile passed at abe64d0. The independent review passed (SHIP); its notes are follow-ups: stamp on quit or window close, cross-window display, and the 100-entry history cap.

Observed / Not run

  • Ran: scripts/cmux-next/prepush-gate.py, which reports no new violations.

Changelog

  • Added: A workspace's hover card says what its agents did since you last looked.

Agent session: cosmic-gray

馃 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

When the selection leaves a workspace, the sidebar now stamps the time you last looked at it. The hover card for a workspace you aren't viewing leads with "Since you looked: Done: 2 路 Asked: 1 路 Failed: 1", counting finished, waiting, and failed turns from the workspace's history after that stamp.

  • Stamps persist on this Mac in SidebarLookedStore (UserDefaults key cmux.next.sidebar.lastLooked), keeping only the newest 256.
  • The line appears in log and minimal hover card layouts; the classic layout reads no history, so it shows nothing.
  • Controlled by the sidebar.sinceLooked debug toggle, on by default.
  • Pull request merges aren't counted yet; only the current PR state is stored, so a merge since the stamp can't be detected (follow-up).