# TRUEREF-0015 — Web UI: Repository Dashboard **Priority:** P1 **Status:** Pending **Depends On:** TRUEREF-0002, TRUEREF-0009 **Blocks:** TRUEREF-0016 --- ## Overview Implement the main web interface for managing repositories. Built with SvelteKit and TailwindCSS v4. The dashboard lets users add repositories, view indexing status with live progress, trigger re-indexing, remove repositories, and view basic statistics. --- ## Acceptance Criteria - [ ] Repository list page at `/` showing all repositories with status, snippet count, last indexed date - [ ] Add repository modal/form (GitHub URL or local path input) - [ ] Per-repository card with: title, description, state badge, stats, action buttons - [ ] Live indexing progress bar (polls `GET /api/v1/jobs/:id` every 2s while running) - [ ] Trigger re-index button - [ ] Delete repository (with confirmation dialog) - [ ] View indexed versions per repository - [ ] Error state display (show error message when state = `error`) - [ ] Empty state (no repositories yet) with clear call-to-action - [ ] Responsive layout (mobile + desktop) - [ ] No page reloads — all interactions via `fetch` with SvelteKit load functions --- ## Page Structure ``` / (root) ├── Layout: navbar with TrueRef logo + nav links ├── / │ └── Repository list + add button ├── /repos/[id] │ └── Repository detail: versions, recent jobs, config └── /settings └── Embedding provider configuration ``` --- ## Repository Card Component ```svelte

{repo.title}

{repo.id}

{stateLabels[repo.state]}
{#if repo.description}

{repo.description}

{/if}
{repo.totalSnippets.toLocaleString()} snippets · Trust: {repo.trustScore.toFixed(1)}/10 {#if repo.stars} · ★ {repo.stars.toLocaleString()} {/if}
{#if repo.state === 'error'}

Indexing failed. Check jobs for details.

{/if}
Details
``` --- ## Add Repository Modal ```svelte ``` --- ## Live Progress Component ```svelte {#if job}
{job.processedFiles} / {job.totalFiles} files {job.progress}%
{#if job.status === 'failed'}

{job.error}

{/if}
{/if} ``` --- ## Main Page Data Loading ```typescript // src/routes/+page.server.ts import type { PageServerLoad } from './$types'; export const load: PageServerLoad = async ({ fetch }) => { const res = await fetch('/api/v1/libs'); const data = await res.json(); return { repositories: data.libraries }; }; ``` --- ## Files to Create - `src/routes/+page.svelte` — repository list - `src/routes/+page.server.ts` — load function - `src/routes/repos/[id]/+page.svelte` — repository detail - `src/routes/repos/[id]/+page.server.ts` — load function - `src/routes/settings/+page.svelte` — settings page - `src/lib/components/RepositoryCard.svelte` - `src/lib/components/AddRepositoryModal.svelte` - `src/lib/components/IndexingProgress.svelte` - `src/lib/components/ConfirmDialog.svelte` - `src/lib/components/StatBadge.svelte` - `src/routes/+layout.svelte` — nav + global layout