phase: 165_prose_word_wrap
All verification complete. Final report:
**Phase 165 — Prose word wrap (final verification pass)**
- Verified: `PROSE_FORMATS={txt,text}` + `isProseDoc` (single-site, image arm wins); `renderDocument` three-way branch (md → `.doc-md`, prose → `.doc-prose` text node, else `pre.doc-raw` byte-identical); `.doc-prose` CSS = 72rem column, `pre-wrap` + `overflow-wrap: anywhere`, tokens only, zero literals; `[data-view="pages"]` hide list includes `.doc-prose` as one grouped declaration; phase-116 scrollbar rules intact and modal-scoped; no `innerHTML` in the prose path.
- Tests/lint (all 100% green):
- `uv run pytest` → **3854 passed** (unit + integration)
- `uv run pytest --cov=app --cov-report=term-missing` → **TOTAL 99%** (>90%)
- `uv run ruff check .` → All checks passed; `uv run pyright` → **0 errors**
- `uv run pytest tests/e2e/test_prose_word_wrap.py -v --no-cov` → **5 passed** (isolation)
- Isolation regressions: document_viewer 8, image_documents 4, pdf_pages_in_sources 4, pdf_strip_additive_selfheal 5, edit_summaries 4, summary_in_viewer 4, chat_answer_clusters 4, garbage_pdf 3, pdf_support 6, sticky_navbar 3, smoke 3 — all passed
- Completion criteria: image description wraps, full text, both surfaces ✔; `.txt` wraps same way ✔; `py`/`json`/code keep `pre.doc-raw` + horizontal overflow + themed modal scrollbar (E2E negative control + pins) ✔; no innerHTML, AA `--ink`/`--surface` pair ✔; full gates green ✔; commit + phase-dir move are harness-owned (not executed per pipeline rules).
- Documentation: README already updated by task 03 (viewer section + image-docs section); full README/AGENTS.md review found no further inconsistencies — **verified consistent, no changes needed**.
- Notable deviations: `.doc-prose` omits `font-family: inherit` from 00_phase D2's snippet — task 01's authoritative "exact property set" excludes it and `div` inherits fonts anyway (behavior identical). PDF deferral (A4) intact: `format == "pdf"` stays in `.doc-raw`, owner call recorded.
- Next pending phase: `166_hide_empty_answer_bubble`.
This commit is contained in:
@@ -5214,7 +5214,9 @@ a.answer-image:hover { text-decoration: underline; } /* flat — the caption und
|
||||
}
|
||||
.doc-date-status:empty, .doc-date-error:empty { display: none; } /* an empty live line takes no space */
|
||||
|
||||
/* Raw (non-markdown) formats: full-width mono pre, horizontal scroll. */
|
||||
/* Raw (non-markdown, non-prose) formats: full-width mono pre,
|
||||
horizontal scroll (locked A3, phase 165 — the prose set renders in
|
||||
the wrapping .doc-prose block below, never here). */
|
||||
.doc-raw {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
@@ -5230,6 +5232,33 @@ a.answer-image:hover { text-decoration: underline; } /* flat — the caption und
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* Prose (phase 165, task 01 — TODO.md L3, LOCKED A1/A2): the image
|
||||
description and plain-text (txt/text) docs as WRAPPING prose — the
|
||||
.doc-md column geometry (72rem reading column, the surface card)
|
||||
with pre-wrap rhythm. The defect: these docs landed in the .doc-raw
|
||||
pre above (white-space: pre), so every generated line was one
|
||||
unbreakable line and a long sentence scrolled sideways. The content
|
||||
stays a text node (pre-wrap carries the paragraph breaks — no
|
||||
markdown parsing: a description is prose, not markup). Tokens only
|
||||
(no new hue — the monochrome invariant; --ink on --surface is the
|
||||
documented 14.5:1 AA pair). Static content — no animation (nothing
|
||||
for prefers-reduced-motion to still). Code keeps the .doc-raw
|
||||
scroller (phase 116 locked A1, here locked A3). */
|
||||
.doc-prose {
|
||||
width: 100%;
|
||||
max-width: var(--chat-column);
|
||||
margin-inline: auto;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--radius);
|
||||
box-shadow: var(--shadow);
|
||||
padding: 1.5rem 1.75rem;
|
||||
color: var(--ink);
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: anywhere;
|
||||
line-height: 1.55;
|
||||
}
|
||||
|
||||
/* Image documents (phase 122, task 04): the viewer's image block —
|
||||
the document's persistent bytes (the /api/documents/{id}/image
|
||||
route) above its description (the .doc-raw content slot below). The
|
||||
@@ -5358,9 +5387,14 @@ a.answer-image:hover { text-decoration: underline; } /* flat — the caption und
|
||||
font-weight: 700; /* pressed = weight + fill, never color alone (B5) */
|
||||
}
|
||||
.doc-views .doc-pages { display: none; } /* Text default — hidden lazy imgs never fetch */
|
||||
/* The text views hide behind the strip on Pages. .doc-prose (phase
|
||||
165, task 01) joins the list DEFENSIVELY today — an image/txt doc
|
||||
never page-qualifies — and becomes load-bearing the day the owner
|
||||
adds "pdf" to PROSE_FORMATS (phase 165 D1 + phase 163 A2). */
|
||||
.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-prose,
|
||||
.doc-views[data-view="pages"] .doc-image { display: none; }
|
||||
.doc-views[data-view="pages"] .doc-pages { display: grid; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user