a192a05aaa
New <repo-detail> component listens for repo:select and shows a repo's remotes, local branches (current + upstream), and recent commits. Backed by GET /api/repo (restricted to indexed repos) and read-only git readers LocalBranches/RecentCommits/RemoteDetails via repos.BuildDetail. <repo-list> highlights the selection; page docks the two panels left/right. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
32 lines
1.5 KiB
Markdown
32 lines
1.5 KiB
Markdown
# repo-list
|
|
|
|
## Intent
|
|
The dashboard's list of every discovered repository. It is the first
|
|
ActiveX-spirit control in the app (AGENT.md §1.1): a self-contained custom
|
|
element that fetches its own data, renders inside its shadow root, and
|
|
communicates outward only through events. It exists to prove and anchor the
|
|
component pattern the rest of the UI follows.
|
|
|
|
## Public surface
|
|
- **Tag:** `<repo-list>`
|
|
- **Attributes/properties:** none yet.
|
|
- **Fetches:** `GET /api/repos` on connect and every 15s (in-flight request is
|
|
aborted on refresh and on disconnect).
|
|
- **Emits:** `repo:select` — a `CustomEvent` (bubbles + composed) whose `detail`
|
|
is the clicked repo's state object. The detail panel (future) listens for this.
|
|
|
|
## History
|
|
- 2026-09-19: created — first component; renders name, branch, ahead/behind, and
|
|
a clean/dirty badge; establishes the shadow-DOM + self-fetch + event pattern.
|
|
- 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.
|
|
|
|
## Notes / gotchas
|
|
- Uses shared design tokens (`--git-*`, `--surface-*`, `--radius*`) for all
|
|
colors and radii — no hardcoded hex (AGENT.md §1.1).
|
|
- Server output is escaped before insertion (`#esc`); repo names come from the
|
|
filesystem, so treat them as untrusted.
|
|
- Polling is a placeholder cadence; a push/SSE update channel can replace it
|
|
later without changing the public surface.
|