Files
GitManager/components/activity-feed/activity-feed.md
T
TBNilles 2b77e15b36 Slice 4: graceful project handoff (pending switch + ack)
Add pending-switch coordination to internal/activity (RequestSwitch/PendingSwitch/AckSwitch/CancelSwitch); AckSwitch atomically sets the active project and records switch-completed with Claude's summary. New MCP tools get_pending_switch and ack_switch (request is user-only via HTTP). HTTP GET/POST/DELETE /api/switch. New <handoff-bar> component (ask/waiting/cancel/completed) over SSE; activity-feed reflects switch-completed. Test covers request->ack->clear. Verified live: request/waiting/cancel over SSE.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-20 08:27:22 -04:00

31 lines
1.4 KiB
Markdown

# activity-feed
## Intent
Shows the **active project** and a **live feed** of what happened — both user and
Claude actions. It makes the coordination state visible (AGENT.md §8.2): the same
active project and events Claude reads over MCP (`get_active_project`,
`get_activity`), so the user can watch the two stay in sync. Groundwork for the
graceful project handoff (§8.3).
## Public surface
- **Tag:** `<activity-feed>`
- **Attributes/properties:** none.
- **Fetches (initial):** `GET /api/active-project`, `GET /api/activity`.
- **Subscribes:** `EventSource('/events')` — SSE stream; listens for `activity`
events (auto-reconnects if the stream drops). Closed on disconnect.
- **Renders:** active project (basename, full path on hover) + newest-first list
of events, each with an actor badge (user/claude/system), a humanized kind,
the repo, optional detail, and a timestamp.
## History
- 2026-09-20: created — slice 3; live active-project + activity view over SSE.
- 2026-09-20: also update the active-project display on `switch-completed` events
(slice 4 handoff), not only `active-project-changed`.
## Notes / gotchas
- All server-derived text is escaped before insertion (repo paths, details,
kinds) — treat as untrusted (§1.1).
- Uses shared design tokens for colors/radii — no hardcoded hex.
- The feed is capped client-side at 200 events to mirror the server ring buffer;
it does not paginate history.