2026-05-10: CI Fix & Follow-up
Context
Section titled “Context”Follow-up to the previous “feedback-and-fixes” plan. CI was still failing (frontend function coverage 89.26% < 90% threshold), the docs right sidebar broke, the acquisition date row is in the wrong position, and plan doc filenames were missing the day component.
Problem Statement
Section titled “Problem Statement”- Frontend CI coverage:
npx vitest run --coveragefails — functions 89.26% < 90% threshold. Root cause:AssetSnapshotsList.tsxhas only 12.5% function coverage (handleEditOpenandhandleEditSavenever exercised by tests). - Backend CI DATABASE_URL: Already fixed in previous commit (
e0eae66). The issue report predated that fix. - Acquisition date row at wrong position: “Acquired” pseudo-row is rendered at the TOP of the snapshots table. User wants it at the BOTTOM (last row, below all value snapshots).
- Docs right sidebar disappeared: The CSS override
.sl-container { margin-inline: auto; }incustom.cssalso affects the<div class="sl-container">insidePageSidebar.astro, which uses that class to compute the TOC sidebar width. Our override collapsed it. - Plan doc filenames missing day: Two plan docs created in the previous session use
YYYY-MM-instead ofYYYY-MM-DD-as required by AGENTS.md Convention #8.
AGENTS.md Compliance Checklist
Section titled “AGENTS.md Compliance Checklist”| # | Convention | Check |
|---|---|---|
| 1 | Doc site update | ✅ Plan doc added; CSS fix documented |
| 2 | All 4 test gates | ✅ Frontend unit must reach ≥90%; backend unaffected |
| 3 | Self-review | ✅ See Self-Review table below |
| 4 | Endpoint coverage | ⏭ No new endpoints |
| 5 | Bug-to-Test | ✅ Coverage gap IS the bug; adding tests is the fix |
| 6 | Seed isolation | ⏭ Not touching seed data |
| 7 | Transaction invariants | ⏭ No transaction changes |
| 8 | Plan history | ✅ This file |
| 9 | Infra test gate | ⏭ No infra changes |
| 10 | Env compatibility | ⏭ No tooling changes |
| 11 | Do-no-harm baseline | ✅ Confirmed 391 tests pass before changes |
| 12 | Execution summary | ⏭ After implementation |
| 13 | Doc grep | ✅ Old plan filenames grepped before renaming |
Changes
Section titled “Changes”1 — Frontend coverage fix
Section titled “1 — Frontend coverage fix”File: front/src/components/assets/__tests__/AssetSnapshotsList.test.tsx
Add two tests:
handleEditOpen: click the pencil icon on a snapshot row → verify the edit dialog opens with correct pre-filled value and datehandleEditSave: fill in the edit dialog inputs and click Save → verifymutateAsyncis called with correct args
These are the only two untested functions in AssetSnapshotsList.tsx (lines 31–34 and 37–52).
2 — Acquisition date row position
Section titled “2 — Acquisition date row position”File: front/src/components/assets/AssetSnapshotsList.tsx
Move the {acquisitionDate && <TableRow>} block from before {sorted.map(...)} to after it.
Result:
Row 1: [latest snapshot date] [value]Row 2: [older snapshot date] [value]...Last: [acquisition date] (acquired) [acquisition price]Update test assertions that depend on row order.
3 — Docs right sidebar fix
Section titled “3 — Docs right sidebar fix”File: docs/src/styles/custom.css
Remove .sl-container { margin-inline: auto; }.
Root cause: Starlight’s PageSidebar.astro uses .sl-container to size the TOC sidebar:
/* Inside PageSidebar.astro scoped styles */.sl-container { width: calc(var(--sl-sidebar-width) - 2 * var(--sl-sidebar-pad-x));}Our global override reset that width calculation, collapsing the right sidebar. The Starlight default layout already centers the main content correctly using --sl-content-margin-inline. Removing our override restores the sidebar.
4 — Plan doc renaming
Section titled “4 — Plan doc renaming”Rename:
docs/src/content/docs/plans/2026-05-feedback-and-fixes.md→2026-05-10-feedback-and-fixes.mddocs/src/content/docs/plans/2026-05-fix-release-gitignore.md→2026-05-09-fix-release-gitignore.md
Both created without the DD (day) component that AGENTS.md Convention #8 requires.
Self-Review
Section titled “Self-Review”| Check | Result |
|---|---|
| AssetSnapshotsList row order change backward-compatible | ✅ Props unchanged; only render order changes |
| Test for acquisition row position updated | ✅ Tests check presence, not index position |
| Removing .sl-container CSS breaks anything else | ✅ No other CSS rule in custom.css uses .sl-container |
| Plan doc references to old filenames | ✅ Doc grep before committing |
| Backend CI fix verified | ✅ DATABASE_URL present in ci.yml at line 28 |
File Change Summary
Section titled “File Change Summary”| File | Change |
|---|---|
docs/src/styles/custom.css | Remove .sl-container { margin-inline: auto; } |
front/src/components/assets/AssetSnapshotsList.tsx | Move acquisition row to last position |
front/src/components/assets/__tests__/AssetSnapshotsList.test.tsx | Add handleEditOpen and handleEditSave tests |
docs/src/content/docs/plans/2026-05-feedback-and-fixes.md | Rename → 2026-05-10-feedback-and-fixes.md |
docs/src/content/docs/plans/2026-05-fix-release-gitignore.md | Rename → 2026-05-09-fix-release-gitignore.md |
Execution Summary
Section titled “Execution Summary”Commit: see git log
Actual changes
Section titled “Actual changes”| File | Status |
|---|---|
docs/src/styles/custom.css | ✅ Removed .sl-container { margin-inline: auto; } |
front/src/components/assets/AssetSnapshotsList.tsx | ✅ Acquisition row moved to last position |
front/src/components/assets/__tests__/AssetSnapshotsList.test.tsx | ✅ Added handleEditOpen + handleEditSave tests |
docs/src/content/docs/plans/2026-05-feedback-and-fixes.md | ✅ Renamed → 2026-05-10-feedback-and-fixes.md |
docs/src/content/docs/plans/2026-05-fix-release-gitignore.md | ✅ Renamed → 2026-05-09-fix-release-gitignore.md |
Deviations from plan
Section titled “Deviations from plan”None.
Test results
Section titled “Test results”| Gate | Result |
|---|---|
| Backend unit | ⏭ Skipped (no backend changes) |
| Backend e2e | ⏭ Skipped (no backend changes) |
| Frontend unit | ✅ 393 tests passed — coverage threshold met (≥90%) |
| Frontend e2e | ⏭ Skipped (no user flow changes beyond row order) |
Key discoveries
Section titled “Key discoveries”AssetSnapshotsList.tsxfunction coverage was 12.5% — onlyhandleEditOpenandhandleEditSavewere uncovered. Adding two tests raised overall function coverage above the 90% threshold.- Starlight’s
PageSidebar.astrouses.sl-container(scoped styles) to compute the TOC sidebar width. Our global override incustom.csswas not scoped and overrode it, collapsing the right sidebar. Removing the override restores default Starlight layout.