Skip to content

Commit cf0932f

Browse files
committed
ci: build and scan the ui bundle, install the ui extra in tests
1 parent 6fe324e commit cf0932f

5 files changed

Lines changed: 85 additions & 8 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: astral-sh/setup-uv@v5
1919
with:
2020
python-version: ${{ matrix.python }}
21-
- run: uv sync --extra dev --extra ingest
21+
- run: uv sync --extra dev --extra ingest --extra ui
2222
- run: uv run ruff check .
2323
- run: uv run ruff format --check .
2424
- run: uv run mypy

‎.github/workflows/release.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ jobs:
1313
contents: read
1414
steps:
1515
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 22
19+
cache: npm
20+
cache-dependency-path: frontend/package-lock.json
21+
- run: npm ci
22+
working-directory: frontend
23+
- run: npm run build
24+
working-directory: frontend
1625
- uses: astral-sh/setup-uv@v5
1726
- run: uv build
1827
- uses: pypa/gh-action-pypi-publish@release/v1

‎.github/workflows/ui.yml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: ui
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ["frontend/**", "ragproof/ui/**", ".github/workflows/ui.yml"]
7+
pull_request:
8+
paths: ["frontend/**", "ragproof/ui/**", ".github/workflows/ui.yml"]
9+
10+
jobs:
11+
frontend:
12+
runs-on: ubuntu-latest
13+
defaults:
14+
run:
15+
working-directory: frontend
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 22
21+
cache: npm
22+
cache-dependency-path: frontend/package-lock.json
23+
- run: npm ci
24+
- run: npm run typecheck
25+
- run: npm run lint
26+
- run: npm run format:check
27+
- run: npm run test
28+
- run: npm run build
29+
- name: scan bundle for external resource loads
30+
working-directory: .
31+
run: |
32+
! grep -rEl '(src|href)[[:space:]]*=[[:space:]]*["'\'']https?://' ragproof/ui/static/index.html
33+
! grep -rEl 'url\((["'\'']?)https?://' ragproof/ui/static --include='*.css'

‎PROGRESS.md‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# Progress
22

3+
## 2026-07-03: Phase 8, UI-0 foundation
4+
5+
Done:
6+
- frontend/ workspace: Vite, React 19, TypeScript strict, Tailwind v4,
7+
ESLint flat config, Prettier, Vitest with Testing Library
8+
- Design tokens from UI_PLAN section 5 as CSS variables, dark mode via a
9+
.dark class with prefers-color-scheme default and a persisted toggle;
10+
Inter and JetBrains Mono self-hosted through fontsource
11+
- App shell: sidebar navigation for all planned screens, top bar with live
12+
project and store path, Runs page foundation card with designed loading,
13+
error, and ready states
14+
- FastAPI server in ragproof/ui/ behind the ragproof[ui] extra: /api/meta,
15+
CSP default-src 'self', nosniff and referrer headers, SPA fallback that
16+
never swallows unknown /api paths (404 JSON), static root path guard
17+
- ragproof ui command: binds 127.0.0.1 by default with a warning on other
18+
hosts, opens the browser, --no-browser and --dev flags, clear install
19+
hint when the extra is missing
20+
- Build pipeline: vite builds into ragproof/ui/static (committed so wheels
21+
and no-Node machines work); release workflow builds the frontend before
22+
uv build; ui.yml CI job runs typecheck, lint, format, tests, build, and
23+
an external-resource bundle scan; main CI installs the ui extra
24+
- Bundle: 77.5KB gzipped JS, fonts as woff2, zero external loads (tested)
25+
- Verified live: ragproof ui served /api/meta, the themed shell, CSP
26+
headers, and client-route fallback on this machine
27+
28+
Decisions:
29+
- React 19 instead of the plan's React 18; it is the current stable line
30+
and Testing Library and Router support it fully.
31+
- lucide-react resolved to 1.x (the 0.x line graduated); API unchanged.
32+
- The built bundle is committed. Rationale: acceptance requires the UI to
33+
work from a checkout without Node, and wheels must build from any clone.
34+
Revisit if bundle churn becomes noisy in diffs.
35+
36+
Next: UI-1 (runs table and run detail), interleaved with Phase 7 launch work.
37+
338
## 2026-07-02: Phase 6
439

540
Done:

‎TASKS.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,13 @@ Status legend: `[ ]` todo, `[x]` done, `[~]` in progress, `[!]` blocked
201201
## Phase 8 - Web UI (design: [UI_PLAN.md](UI_PLAN.md))
202202

203203
### UI-0 Foundation
204-
- [ ] **P8-01** `frontend/` workspace: Vite, React 18, TypeScript strict, Tailwind v4, shadcn/ui; ESLint + Prettier aligned with repo style
205-
- [ ] **P8-02** Design tokens from UI_PLAN §5 (color, type, spacing) with dark mode as a first-class theme; self-hosted Inter + JetBrains Mono
206-
- [ ] **P8-03** FastAPI server in `ragproof/ui/` behind the `ragproof[ui]` extra; binds 127.0.0.1 by default, warning on `--host` override
207-
- [ ] **P8-04** `ragproof ui` command: starts server, opens browser, `--dev` proxies Vite; clear install hint when the extra is missing
208-
- [ ] **P8-05** Build pipeline: CI builds the bundle into `ragproof/ui/static/`, wheel ships it, Python jobs never need Node
209-
- [ ] **P8-06** Bundle scan test: no external URLs in built assets; CSP `default-src 'self'`
210-
- [ ] **P8-07** UI CI job: typecheck, lint, Vitest, build
204+
- [x] **P8-01** `frontend/` workspace: Vite, React 18, TypeScript strict, Tailwind v4, shadcn/ui; ESLint + Prettier aligned with repo style
205+
- [x] **P8-02** Design tokens from UI_PLAN §5 (color, type, spacing) with dark mode as a first-class theme; self-hosted Inter + JetBrains Mono
206+
- [x] **P8-03** FastAPI server in `ragproof/ui/` behind the `ragproof[ui]` extra; binds 127.0.0.1 by default, warning on `--host` override
207+
- [x] **P8-04** `ragproof ui` command: starts server, opens browser, `--dev` proxies Vite; clear install hint when the extra is missing
208+
- [x] **P8-05** Build pipeline: CI builds the bundle into `ragproof/ui/static/`, wheel ships it, Python jobs never need Node
209+
- [x] **P8-06** Bundle scan test: no external URLs in built assets; CSP `default-src 'self'`
210+
- [x] **P8-07** UI CI job: typecheck, lint, Vitest, build
211211

212212
### UI-1 Runs and Run detail
213213
- [ ] **P8-08** Read API: `/api/meta`, `/api/projects`, paginated `/api/runs`, `/api/runs/{ref}` reusing `reports/data.py`

0 commit comments

Comments
 (0)