Skip to content

Add Repo Watch as a native Repos section#201

Open
arach wants to merge 2 commits into
mainfrom
feat/macos-repos
Open

Add Repo Watch as a native Repos section#201
arach wants to merge 2 commits into
mainfrom
feat/macos-repos

Conversation

@arach
Copy link
Copy Markdown
Owner

@arach arach commented Jun 5, 2026

Ports the broker's Repo Watch snapshot into a fourth Scout section in the native macOS app (apps/macos), organized repo → worktree. Agents and sessions are attributes on a worktree, never the spine. Ordering is attention-first everywhere and clean-&-idle worktrees fold away behind a "quiet" toggle so unfinished work floats to the top.

Built against the pinned Repo Watch contract from #185 (GET /v1/repo-watch/snapshot); this is the native counterpart to that PR's web surface. Web convergence to the same design line follows separately.

What's here

  • ScoutRepoModelsDecodable mirror of RepoWatchSnapshot (house decode style: CodingKeys + decodeIfPresent defaults, so a partial/forward-evolved snapshot never hard-fails the section), plus the Swift twins of the web ui.ts derivations: churn parse, live-first agent dedupe, attention rank, branch split, deterministic relative time, and the drift flag (SCAN ERR / DIVERGED / REBASE / AHEAD N / IN SYNC).
  • ScoutRepoStore — broker polling on a calmer 4s cadence (a snapshot shells out to git per worktree), worst-first project ordering, a Table/Drift lens toggle, and the clean-idle fold state.
  • ScoutReposView — keyboard-first repo·worktree tree mirroring the Agents tree exactly (j/k, h/l, g/⇧G, selection band, inspector-follows-cursor), Table and Drift lenses reading one model, and a Context inspector (status, churn, branch drift, changed files, last commit, agents, sessions).
  • WiringScoutSection.repos, sidebar entry, content + inspector switches, keyboard chords, lifecycle start/stop, status-bar count, and the keyboard cheatsheet. ⌘↩ / double-click reveals the focused worktree in Finder.

Design line

The spine is repo → worktree; one vocabulary across pills; attention-first ordering with clean-&-idle folded away; three lenses (Table · Drift · Context) over one model — native leads with Table + Context, Drift as a toggle.

Verification

swift build --target Scout is green — zero warnings, zero errors.

🤖 Generated with Claude Code

Port the broker's Repo Watch snapshot into a fourth Scout section
(`apps/macos`), organized repo → worktree. Agents and sessions are
attributes on a worktree, never the spine. Ordering is attention-first
everywhere and clean-&-idle worktrees fold away behind a "quiet" toggle
so unfinished work floats to the top.

- ScoutRepoModels: Decodable mirror of the RepoWatchSnapshot contract
  plus the Swift twins of the web ui.ts derivations (churn parse, agent
  dedupe, attention rank, branch split, relative time, drift flag).
- ScoutRepoStore: broker polling on a calmer 4s cadence (a snapshot
  shells out to git per worktree), worst-first project ordering, a
  Table/Drift lens toggle, and the clean-idle fold state.
- ScoutReposView: keyboard-first repo·worktree tree mirroring the Agents
  tree (j/k, h/l, g/⇧G, inspector-follows-cursor), Table and Drift
  lenses over one model, and a Context inspector (status, churn, branch
  drift, changed files, last commit, agents, sessions).
- Wire Repos into ScoutSection, the sidebar, content + inspector
  switches, keyboard chords, lifecycle, status bar, and the cheatsheet.
  ⌘↩ / double-click reveals the focused worktree in Finder.

Builds green against the current macOS base; web convergence to follow.
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openscout Ready Ready Preview, Comment Jun 5, 2026 8:43pm

Replace the harsh per-worktree verdict pills (DIVERGED / SCAN ERR /
REBASE) with a calm reading of *current state* — where each branch sits
relative to its upstream — per design feedback that the verdicts were
"doing all the talking" and the rows were too sparse.

- RepoDriftGauge: a behind◀upstream▶ahead position gauge (muted fill
  left, accent fill right, center tick at the fork, head dot at the
  ahead tip; in sync = dot on the line). It is the row + inspector hero.
- Column-aligned driftline rows: branch · POSITION · WORK · LAST, with a
  quiet second line on active worktrees (upstream · a descriptive
  "behind N · ahead M" phrase · agents). Clean/in-sync trees stay one
  line. No verdict words anywhere.
- Context inspector leads with a Position block (gauge + phrase +
  branch/upstream/HEAD), replacing the harsh drift badge.
- Scan errors read in plain language ("couldn't read this worktree —
  moved, deleted, or not a git repo") with the raw git output kept in
  the inspector for detail.
- ScoutRepoSample: an env-gated (OPENSCOUT_REPOS_SAMPLE) fixture so the
  section can be exercised without a broker that serves the snapshot.
  Inert in normal runs.

swift build --product Scout is green.
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