Files
TBNilles a192a05aaa Add repo-detail panel and /api/repo endpoint
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>
2026-09-19 16:43:01 -04:00

33 lines
1.6 KiB
Markdown

# repo-detail
## Intent
The detail panel for the repository selected in the dashboard. It fulfills the
right-docked "detail panel" role (AGENT.md §4) and demonstrates cross-component
communication done the sanctioned way (AGENT.md §1.1): it holds no reference to
`<repo-list>` — it only listens for the `repo:select` event and fetches its own
data.
## Public surface
- **Tag:** `<repo-detail>`
- **Attributes/properties:** none.
- **Listens:** `repo:select` on `document` — the bubbling/composed event emitted
by `<repo-list>`; `event.detail.path` selects the repo.
- **Fetches:** `GET /api/repo?path=<abs path>` (in-flight request aborted on the
next selection and on disconnect). The endpoint only serves repos already in
the scanner index — it never runs git against an arbitrary query path.
- **Renders:** name + status badges, path, current branch, remotes (name + URL),
local branches (current flagged, upstream shown), and the 20 most recent
commits.
## History
- 2026-09-19: created — first detail panel; consumes `repo:select`, backed by the
new `/api/repo` endpoint and `internal/git` branch/commit/remote readers.
## Notes / gotchas
- Server output is escaped before insertion (`#esc`); branch names, commit
subjects, and remote URLs all originate from repo contents — treat as untrusted.
- Uses shared design tokens for all colors/radii — no hardcoded hex (AGENT.md §1.1).
- Data is fetched on selection only (no polling); it will not auto-refresh while a
repo stays selected. A push/refresh signal can be added without changing the
public surface.