32ae17cc9f
Reduce .env to just REPOS_HOST_PATH (the projects root); runtime bootstrap moves to compose/defaults. Projects are the subdirectories of the single root — removed the project-directories feature (store table, service methods, /api/config/project-dirs, Settings section). Each project's forge is derived from its git remote (matched to a configured forge, else the bare host) and shown as a pill next to its name (State.Forge via scanner ForgeFor + svc.ForgeDisplay). Removed first-run .env seeding; forges + identity are managed in Settings. Added forge.HostOf. AGENT.md updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2.4 KiB
2.4 KiB
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.
- Search + filter: a search box (matches name/path, case-insensitive) plus
"Dirty" and "Ahead/behind" toggle chips, with a "N of M" count. Filtering is
client-side over the fetched list; the state persists per-viewer in
localStorage["gitmanager.repolist.filters"](§4). - Fetches:
GET /api/reposon connect and every 15s (in-flight request is aborted on refresh and on disconnect). - Emits:
repo:select— aCustomEvent(bubbles + composed) whosedetailis 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/repospayload so re-selecting re-renders without a refetch. - 2026-09-20: selecting a repo now also
POSTs/api/active-projectto make it the active project (a user action, §8.2) — surfaced in<activity-feed>and readable by Claude viaget_active_project. Fire-and-forget. - 2026-09-20: right-clicking a repo emits
repo:contextmenu{repo, x, y}for<repo-menu>(§6). Right-click does not change the selection/active project. - 2026-09-20: added search + "Dirty"/"Ahead-behind" filter chips with a count, persisted in localStorage; filtering is client-side (slice 13).
- 2026-09-22: show each project's forge (derived from its git remote,
State.Forge) as a pill next to the name.
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.