Slice 3: activity feed and active project (SSE + MCP tools)
Add internal/activity (thread-safe active project + bounded event feed with subscriber fan-out). Service exposes active-project/activity methods and takes the feed. New MCP tools get_active_project/set_active_project/get_activity and HTTP endpoints GET/POST /api/active-project, /api/activity, and /events (SSE). New <activity-feed> component updates live via EventSource; <repo-list> sets the active project on selection. Verified end-to-end in the running app: user actions push live events and set the active project (actor=user), all readable by Claude over MCP. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -47,6 +47,13 @@ class RepoList extends HTMLElement {
|
||||
this.dispatchEvent(new CustomEvent('repo:select', {
|
||||
detail: repo, bubbles: true, composed: true,
|
||||
}));
|
||||
// Selecting a repo makes it the active project (a user action, §8.2). Fire
|
||||
// and forget — the SSE feed reflects the change; failure just skips it.
|
||||
fetch('/api/active-project', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ path: repo.path }),
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
#renderShell() {
|
||||
|
||||
@@ -21,6 +21,9 @@ component pattern the rest of the UI follows.
|
||||
- 2026-09-19: added a selected-item highlight — the clicked repo keeps an
|
||||
accent border/background (the item that `<repo-detail>` is showing). Caches the
|
||||
last `/api/repos` payload so re-selecting re-renders without a refetch.
|
||||
- 2026-09-20: selecting a repo now also `POST`s `/api/active-project` to make it
|
||||
the active project (a user action, §8.2) — surfaced in `<activity-feed>` and
|
||||
readable by Claude via `get_active_project`. Fire-and-forget.
|
||||
|
||||
## Notes / gotchas
|
||||
- Uses shared design tokens (`--git-*`, `--surface-*`, `--radius*`) for all
|
||||
|
||||
Reference in New Issue
Block a user