phase: 163_pdf_strip_additive_selfheal
All gates verified. Final report: **Phase 163 — final verification pass (all 5 tasks already complete; verification-only run)** - Verified D1–D4 in code: `page_strip_mode` column + migration 0027, `DocContent` absent-never-null rule keyed off `page_count`; `_persist_pdf_pages` render → atomic tmp+`os.replace` writes → stale-tail-last + `strip_class` stamp; `_regate_pdf_strip` on both unchanged paths (mirror gate, heal, repair, fail-soft, one INFO line only when acting); viewer mode branch + Text/Pages toggle (Text default, `aria-pressed`, no innerHTML, lazy imgs). - `uv run pytest --cov=app --cov-report=term-missing` → **3796 tests, exit 0, coverage 99%** (>90%) - `uv run pytest tests/e2e/test_pdf_strip_additive_selfheal.py -v --no-cov` → **5 passed** in isolation - `test_pdf_pages_in_sources + test_pictorial_pdf + test_garbage_pdf` → 10 passed; `test_document_viewer(_context) + test_image_documents` → 20 passed - `uv run ruff check .` clean; `uv run pyright` → 0 errors; alembic **0027 downgrade→upgrade CLI round-trip clean** (+ integration pins) - Completion criteria: additive view w/ toggle ✅ · primary DOM byte-identity ✅ · write-first order/mid-write-failure/atomic pins ✅ · heal + repair E2E ✅ · zero vision/LLM on fast path (mock-captured) ✅ · non-qualifying payload byte-identity ✅ · docs pass ✅ - **Documentation**: README.md + AGENTS.md reviewed in full — the phase's updates are accurate; all config-table defaults cross-checked against `app/config.py` (no drift), every page route, script, and E2E command referenced exists, every `.env.example` var documented — **verified consistent, no changes needed**. - Notable: live `Letumdei` repair is owner-runtime post-deploy per D5 (next production Sync self-heals; no live changes made); the modified `.agents/screenshots/doc_modal_scrollbar_1280.png` is an E2E-regenerated artifact left for the pipeline commit. - **Next pending phase:** `164_chat_error_honesty`
This commit is contained in:
@@ -5311,6 +5311,59 @@ a.answer-image:hover { text-decoration: underline; } /* flat — the caption und
|
||||
padding: 0.35rem 0 0;
|
||||
}
|
||||
|
||||
/* Additive strip view (phase 163, task 04): the pictorial-class PDF
|
||||
— a USABLE text layer — keeps the text doc (Summary panel +
|
||||
content) with the page strip one Text/Pages toggle away (LOCKED
|
||||
A1/A6). The toggle is the house ghost-pill idiom (the .auth-link
|
||||
family): the two pills sit adjacent in the labeled group, ink-soft
|
||||
on the transparent pill (AA on --bg/--surface), hover the
|
||||
brand-soft/brand-ink pair; the PRESSED button is the brand fill +
|
||||
heavier weight — text + style, never color alone (B5) — with --bg
|
||||
ink on --brand (5.2:1, the .share-chat-btn pair). ≥44px targets
|
||||
(§7.1); :focus-visible rides the global 3px ring. The view swap is
|
||||
CSS-driven off the .doc-views wrapper's data-view: the strip is
|
||||
display:none by default (its lazy imgs never fetch while hidden)
|
||||
and shows on [data-view="pages"], which hides the text view instead
|
||||
— the nodes stay mounted across flips (no re-render, no refetch).
|
||||
Phase-08 tokens only (no new hue — the monochrome invariant). */
|
||||
.doc-view-toggle {
|
||||
display: flex;
|
||||
gap: 0.4rem;
|
||||
width: 100%;
|
||||
max-width: var(--chat-column);
|
||||
margin-inline: auto;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
.doc-view-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 44px;
|
||||
padding: 0.5rem 0.9rem;
|
||||
border-radius: 999px;
|
||||
border: 1px solid var(--line);
|
||||
background: transparent;
|
||||
color: var(--ink-soft);
|
||||
font: inherit;
|
||||
font-weight: 600;
|
||||
font-size: 0.95rem;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
}
|
||||
.doc-view-btn:hover { background: var(--brand-soft); color: var(--brand-ink); }
|
||||
.doc-view-btn[aria-pressed="true"] {
|
||||
background: var(--brand);
|
||||
border-color: var(--brand);
|
||||
color: var(--bg); /* dark ink on brand: 5.2:1 (AA) */
|
||||
font-weight: 700; /* pressed = weight + fill, never color alone (B5) */
|
||||
}
|
||||
.doc-views .doc-pages { display: none; } /* Text default — hidden lazy imgs never fetch */
|
||||
.doc-views[data-view="pages"] .doc-summary,
|
||||
.doc-views[data-view="pages"] .doc-md,
|
||||
.doc-views[data-view="pages"] .doc-raw,
|
||||
.doc-views[data-view="pages"] .doc-image { display: none; }
|
||||
.doc-views[data-view="pages"] .doc-pages { display: grid; }
|
||||
|
||||
/* Designed not-found state (no emoji — plain SVG mark, phase 08 rule). */
|
||||
.doc-not-found {
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user