phase: 165_prose_word_wrap
Build and Push Containers / build-and-push-app (push) Successful in 1m44s
Build and Push Containers / build-and-push-db (push) Successful in 11s

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:
2026-10-07 22:57:40 -04:00
parent 8d70aa946c
commit b0c7aed613
36 changed files with 2198 additions and 64 deletions
+17 -8
View File
@@ -38,10 +38,13 @@ Test → story mapping (Playwright Mapping Rule):
inner content).
7. ``test_modal_theme_and_no_cdn`` — dark page background, the panel on
the Phase-08 surface colour, every asset same-origin or ``data:``.
8. ``test_raw_code_block_themed_scrollbar`` — phase 116: the raw code
block (``pre.doc-raw``) overflows horizontally, a scroll action moves
it, the themed scrollbar tokens are in effect via computed style, and
a screenshot records the themed (not native light-gray) bar.
8. ``test_raw_code_block_themed_scrollbar`` — phase 116: the raw CODE
block (``pre.doc-raw`` — a seeded ``.json`` doc since phase 165;
prose — image descriptions and ``txt``/``text`` — now WRAPS in
``.doc-prose`` and never lands here) overflows horizontally, a
scroll action moves it, the themed scrollbar tokens are in effect
via computed style, and a screenshot records the themed (not native
light-gray) bar.
"""
from __future__ import annotations
@@ -153,14 +156,20 @@ def _seed_long_line_doc() -> None:
a non-markdown doc whose one long line is deliberately longer than
the modal width — the shape of the TODO's quest .pl ``quest::say``
line. Direct DB seed, the ``test_modal_xss_safe`` pattern (the
viewer is database-only; no chunks needed)."""
viewer is database-only; no chunks needed). Phase 165: the path is
``.json`` — txt/text joined the PROSE set (wrapped in .doc-prose),
so the code-scroll fixture is a CODE doc, keeping the locked A1
proof on the branch that still scrolls."""
long_line = "quest::say(\"" + ("the quick brown fox jumps over the lazy dog " * 20) + "\")"
with SessionLocal() as db:
db.add(
Document(
source="docs",
path="notes/long-line.txt",
full_path="/tmp/long-line.txt",
# Phase 165: .json, NOT .txt — txt/text joined the PROSE
# set (wrapped in .doc-prose); the phase-116 scroll
# contract binds CODE, and json stays code-ish (D1).
path="notes/long-line.json",
full_path="/tmp/long-line.json",
title="Long Line Fixture",
content=(
"# long-line-fixture: the line below is deliberately\n"
@@ -551,7 +560,7 @@ def test_raw_code_block_themed_scrollbar(
login(page, app_url)
_drill(page, "docs", "notes")
row = page.locator("#docs-tbody tr", has_text="long-line.txt")
row = page.locator("#docs-tbody tr", has_text="long-line.json")
expect(row).to_have_count(1)
row.locator("td:nth-child(2) a.doc-link").click()