phase: 100_page_width_consistency
Build and Push Containers / build-and-push-app (push) Successful in 4m3s
Build and Push Containers / build-and-push-db (push) Successful in 18s

**Phase 100 — final verification pass: all green.**

- Verified the shipped CSS contract directly: `--chat-column: 72rem` in `:root`; 0 literal `max-width: 46rem`; no `@media (min-width: 1500px)` block; exactly 4 token-capped reading columns; tuning/theme/doc-edit shells cap-free, structurally `.sources-shell`; `mock_llm.py` diff is comment-only.
- Defect found & fixed (phase-93 suite): `test_theme_semantic_completion.py::test_reset_removes_tag_byte_identical` raced theme.js's post-PUT refetch — it asserted the `#bor-theme` tag was gone right after the result line, but tag removal lands in the reconcile after the re-fetch (failed ~1 in 5 runs after `test_chat_rag`, reproduced). Fixed with an auto-waiting `expect(...).to_have_count(0)` (settled-state wait, the file's existing house pattern). 6/6 clean on the repro loop after.
- Tests/lint/coverage: `uv run pytest --cov=app --cov-report=term-missing` → 2052 passed, **99%** on `app/`; `uv run ruff check .` + `uv run pyright` → 0 errors.
- E2E in isolation (all passed): `test_wide_desktop_column.py` 3 (the phase suite — chat==tuning==theme==RAG ±4px at 1280 & 1920, ≈1152px; shared ≈1152px; standalone doc ≈1112px; modal unchanged ≈1100px; 360px overflow-free), `test_ui_customization` 4, `test_admin_theme_tab` 5, `test_document_viewer` 7, `test_save_share_ux` 5, `test_sticky_navbar` 3, `test_markdown_tables` 6, `test_responsive_polish` 7, `test_chat_rag` 3, `test_theme_semantic_completion` 8.
- Completion criteria: ① measured 72rem everywhere (≥~1200px, ±4px) + full-width below + 360px clean — **PASS** (E2E); ② zero 46rem rules / no 1500px block / four token selectors — **PASS** (grep + unit pins); ③ B4 byte-identical no-op + mobile squeeze — **PASS** (theme + responsive suites green); ④ full suite / coverage / lint — **PASS**; ⑤ atomic commit — left to the harness per executor protocol (all changes in the working tree, uncommitted).
- Deviations: none from phase decisions; only change in this pass is the race fix above (test-only, behavior unchanged).
- Next pending phase: `98_sync_summary_visibility` (numeric order in `todo/`; also pending: 99, 101–105).
This commit is contained in:
2026-09-12 13:37:19 -04:00
parent a2ca2f905f
commit 58e9d94cff
35 changed files with 1295 additions and 428 deletions
+16 -11
View File
@@ -10,8 +10,9 @@ without a browser:
* the house shell (AGENTS.md rule 5 + the login.html/shared.html
minimal-flow-page lineage): skip-link, the SLIM header (brand +
"Back to chat" — no nav), the 46rem base column (hard-coded — a form
column, NOT ``--chat-column``), the ``container`` frame;
"Back to chat" — no nav), the full 72rem container (the phase-59
form-column cap is retired — owner instruction 2026-09-12), the
``container`` frame;
* the form contract: ``#draft-title`` / ``#draft-path`` /
``#draft-body`` with visible labels, ``#push-doc-btn`` (the exact
"Push to docs branch" copy) + the back link, ``#push-status``
@@ -455,21 +456,25 @@ def test_trim_git_detail_behavior_is_pinned_by_the_markers() -> None:
# ---------- styles.css: the new classes ----------
def test_doc_edit_shell_is_the_hardcoded_46rem_column() -> None:
""".doc-edit-shell: the 46rem base column — HARD-CODED 46rem (a
form column, not a reading column — it must NOT ride
--chat-column, so phase 58's wide-desktop doubling never stretches
the form), centered, a flex column on the container frame."""
def test_doc_edit_shell_rides_the_full_container() -> None:
""".doc-edit-shell: the full 72rem container (owner instruction
2026-09-12 — the phase-59 form-column cap is superseded): no
max-width, no margin-inline (the .container ancestor centers), a
flex column on the container frame."""
css = _css()
block = re.search(r"\.doc-edit-shell \{([\s\S]*?)\n\}", css)
assert block, "styles.css must style .doc-edit-shell"
body = block.group(1)
assert "max-width: 46rem" in body, "the 46rem base column (hard-coded)"
assert "max-width" not in body, (
"no cap — the shell rides the .container's 72rem frame"
)
assert "--chat-column" not in body, (
"the form column does not ride --chat-column (phase 58 must "
"not stretch it)"
"the shell rides the .container frame, not the reading-column "
"token"
)
assert "margin-inline" not in body, (
"the .container ancestor centers (no shell-level centering)"
)
assert "margin-inline: auto" in body
assert "flex-direction: column" in body
+2 -1
View File
@@ -206,7 +206,8 @@ def test_header_comment_notes_the_table_pass() -> None:
def test_table_wrap_is_the_horizontal_scroller() -> None:
""".md-table-wrap { overflow-x: auto } — the wrapper (not the
table) is the scroller, so a wide table scrolls inside the bubble
instead of breaking the 46rem column (story AC5)."""
instead of breaking the 72rem column (story AC5 — the width
contract is now the 72rem container, phase 100)."""
css = _text(STYLES_CSS)
block = re.search(r"\.md-table-wrap\s*\{([^}]*)\}", css)
assert block, "styles.css must define .md-table-wrap"
+2 -2
View File
@@ -6,8 +6,8 @@ be at the bottom of the screen on an EMPTY chat too, which sticky alone
cannot do).
The chat page scrolls at the DOCUMENT level and `.chat-shell` (the
centered 46rem column, PLAN §7.1) is the composer's sticky containing
block. The pin is therefore TWO rules, and both are pinned here:
centered 72rem column — the .container width, phase 100) is the
composer's sticky containing block. The pin is therefore TWO rules, and both are pinned here:
* `.messages { flex: 1 1 auto }` absorbs the free space of a short page,
so the composer's RESTING (in-flow) position is already the bottom of
+6 -3
View File
@@ -450,8 +450,9 @@ def test_modal_css_targets_and_contrast_pairs() -> None:
9.3:1, the err-line border — the .tuning-delete / .steering-delete
convention; the hover inverts to --bg on --err-line, 5.2:1);
Cancel is the ghost ink-soft family (5.1:1 on --surface); the
error line is the err pair; the panel caps at the 46rem
chat-column width or the viewport."""
error line is the err pair; the panel caps at the chat-column
width (the --chat-column token — 72rem, owner instruction
2026-09-12) or the viewport."""
css = _css()
btn = css[css.find(".remove-confirm-btn {"):]
btn = btn[: btn.find("\n}")]
@@ -473,4 +474,6 @@ def test_modal_css_targets_and_contrast_pairs() -> None:
assert "var(--err-ink)" in err and "var(--err-bg)" in err
panel = css[css.find(".remove-confirm-panel {"):]
panel = panel[: panel.find("\n}")]
assert "min(46rem" in panel, "the 46rem chat-column cap (or the viewport)"
assert "min(var(--chat-column)" in panel, (
"the chat-column cap via the token (or the viewport)"
)
+9 -8
View File
@@ -19,8 +19,8 @@ silent regression is caught without a browser:
chat page's interactive builders, and the rendered messages contain
no button/form/link — the chips are plain spans, the source chips
carry no ``href``;
* the shared shell's reading-column mapping (--chat-column token,
phase 58) + the static-chip and
* the shared shell's reading-column mapping (--chat-column token —
the 72rem container width, phase 100) + the static-chip and
invalid-state CSS (the ≤640px squeeze included).
"""
from __future__ import annotations
@@ -384,17 +384,18 @@ def test_brand_note_resolves_at_call_time() -> None:
def test_shared_shell_maps_to_the_reading_column() -> None:
"""The PLAN §7 column contract (phase 58): .shared-shell is the
centered chat column riding the --chat-column token (46rem base,
92rem at >=1500px wide desktops — owner instruction 2026-08-31,
TODO L5 / D2). The conversation reads exactly like the chat
page's, so the existing .msg/.bubble CSS applies unchanged."""
"""The 72rem-everywhere contract (phase 100, owner instruction
2026-09-12): .shared-shell is the centered chat column riding the
--chat-column token — equal to the .container's cap, so the shared
page reads at the RAG page's width. The conversation reads exactly
like the chat page's, so the existing .msg/.bubble CSS applies
unchanged."""
css = _css()
block = re.search(r"\.shared-shell \{([\s\S]*?)\n\}", css)
assert block, "styles.css must style .shared-shell"
body = block.group(1)
assert "max-width: var(--chat-column)" in body, (
"the PLAN §7 centered chat column (phase 58 token)"
"the centered chat column riding the token (the 72rem width)"
)
assert "46rem" not in body.split("/*")[0], (
"no hard-coded cap — the width rides the token"
+5 -2
View File
@@ -499,7 +499,8 @@ def test_dialog_button_and_target_contrast_pairs() -> None:
brand-soft hover (12.4:1); Save is the solid brand family (--bg
text on --brand 5.2:1, the .new-chat-btn convention) with the
lightened hover; the error line is the err pair; the panel caps
at the 46rem chat-column width or the viewport; the visible
at the chat-column width (the --chat-column token — 72rem, owner
instruction 2026-09-12) or the viewport; the visible
label is ink-soft (5.1:1) — never a label-less textarea."""
css = _css()
btn = _css_rule(css, ".ignore-editor-btn")
@@ -517,7 +518,9 @@ def test_dialog_button_and_target_contrast_pairs() -> None:
err = _css_rule(css, ".ignore-editor-error")
assert "var(--err-ink)" in err and "var(--err-bg)" in err
panel = _css_rule(css, ".ignore-editor-panel")
assert "min(46rem" in panel, "the 46rem chat-column cap (or the viewport)"
assert "min(var(--chat-column)" in panel, (
"the chat-column cap via the token (or the viewport)"
)
label = _css_rule(css, ".ignore-editor-label")
assert "display: block" in label and "var(--ink-soft)" in label, (
"a visible block label (WCAG — never aria-label-only)"
+125 -110
View File
@@ -1,29 +1,33 @@
"""Unit: the 2x reading column on wide desktops (phase 58, task 01).
"""Unit: every page matches the RAG page's 72rem width (phase 100).
The measured-width browser proof is E2E-gated by the phase-58 story
suite (task 02); like the other frontend-adjacent unit files (the
The measured-width browser proof is E2E-gated by the phase's width
suite (task 03); like the other frontend-adjacent unit files (the
test_save_chat_ui.py pattern), this module pins the styles.css markers
the wide-column contract depends on, so a silent regression is caught
the width contract depends on, so a silent regression is caught
without a browser:
* the ``--chat-column`` custom property in ``:root`` — 46rem base
(the PLAN §7 column lineage) with the provenance comment (owner
instruction 2026-08-31, TODO L5 / D2);
* the ``@media (min-width: 1500px)`` block at the bottom of the
responsive region — the SINGLE place that doubles the token to
92rem (2x);
* the ``--chat-column`` custom property in ``:root`` — 72rem, EQUAL to
the ``.container``'s 72rem cap (owner instruction 2026-09-12:
"match the width of the RAG page for all other pages" — supersedes
the 2026-08-31 instruction), with the provenance comment;
* NO ``@media (min-width: 1500px)`` block anywhere in the file — the
phase-58 wide-desktop doubling is deleted in full (the token is
72rem at every viewport);
* the four reading-column selectors — ``.chat-shell``,
``.shared-shell``, ``.doc-md``, ``.doc-summary:has(+ .doc-md)`` —
each capped with ``max-width: var(--chat-column)`` and NOTHING else
in the file uses the token (exactly four rules);
* the negative pin — the form columns (``.tuning-shell``; and from
phase 59, task 06, ``.doc-edit-shell`` — forms, not reading
surfaces) are the only literal ``max-width: 46rem`` rules left in
the file, kept hard-coded so the wide-desktop doubling never
stretches a form;
* the "46rem column contract" block comments were updated to name the
base value + the wide override (the stale "≤46rem" contract claims
are gone from the reading-column comments).
in the file uses the token for a max-width (exactly four rules);
* the flipped negative pin — ZERO literal ``max-width: 46rem`` rules
remain (the phase-27/59/91 form-column caps are retired): the form
shells (``.tuning-shell``, ``.theme-shell``, ``.doc-edit-shell``)
carry no cap, no token, and no ``margin-inline`` — structurally
``.sources-shell``;
* the two source-page dialogs (phase 69 remove-confirm, phase 89
ignore-editor) cap at the chat-column width THROUGH THE TOKEN —
``min(var(--chat-column), calc(100vw - 2rem))`` — or the viewport;
* the stale width comments are gone — no "46rem base" / "92rem at
>=1500px" / "1500px" width claims remain (the "46rem column
contract" wording was rewritten to the 72rem contract, 2026-09-12).
"""
from __future__ import annotations
@@ -58,57 +62,52 @@ def _rule_block(css: str, selector: str) -> str:
# ---------- the --chat-column token ----------
def test_root_declares_chat_column_46rem_base() -> None:
""":root declares --chat-column: 46rem (the PLAN §7 base) with the
owner-provenance comment (instruction 2026-08-31, TODO L5)."""
def test_root_declares_chat_column_72rem_equal_to_the_container() -> None:
""":root declares --chat-column: 72rem — EQUAL to the .container's
72rem cap (one width for everything) — with the owner-provenance
comment (instruction 2026-09-12)."""
css = _css()
root = _rule_block(css, ":root")
assert "--chat-column: 46rem" in root, (
":root must declare the --chat-column base (46rem)"
assert "--chat-column: 72rem" in root, (
":root must declare the --chat-column width (72rem)"
)
pre = css[: css.index("--chat-column: 46rem")]
# The token equals the container's cap (the RAG page's width).
container = _rule_block(css, ".container")
assert "max-width: 72rem" in container, (
".container's 72rem cap is the width the token now equals"
)
pre = css[: css.index("--chat-column: 72rem")]
comment = pre[pre.rindex("/*") : pre.rindex("*/")]
assert "owner instruction 2026-08-31" in comment, (
assert "owner instruction 2026-09-12" in comment, (
"the token's comment must cite the owner instruction "
"(2026-08-31, TODO L5)"
"(2026-09-12 — match the width of the RAG page)"
)
def test_wide_media_block_doubles_the_token() -> None:
"""A @media (min-width: 1500px) block sets --chat-column: 92rem on
:root — the single wide override (2x the base)."""
def test_the_wide_desktop_doubling_is_retired() -> None:
"""No @media (min-width: 1500px) block remains (the phase-58 2x
override is deleted in full, 2026-09-12) and the token is never
assigned the old wide value — 72rem at every viewport."""
css = _css()
m = re.search(r"@media \(min-width: 1500px\) \{", css)
assert m, "styles.css must carry the @media (min-width: 1500px) block"
start = css.index("{", m.start())
depth = 0
for i in range(start, len(css)):
if css[i] == "{":
depth += 1
elif css[i] == "}":
depth -= 1
if depth == 0:
block = css[m.start() : i + 1]
break
else:
raise AssertionError("unbalanced braces in the wide media block")
assert ":root { --chat-column: 92rem; }" in block, (
"the wide block must set :root { --chat-column: 92rem; }"
assert "@media (min-width: 1500px)" not in css, (
"the wide-desktop media block must be deleted (retired 2026-09-12)"
)
assert "--chat-column: 92rem" not in css, (
"the token is never doubled to the old wide value"
)
# The wide block is the ONLY min-width:1500 media in the file and
# the only place 92rem is assigned to the token.
assert css.count("@media (min-width: 1500px)") == 1
assert css.count("--chat-column: 92rem") == 1
def test_wide_block_lives_in_the_bottom_responsive_region() -> None:
"""The min-width sibling sits alongside the max-width responsive
blocks at the bottom of the file (after the <=640px block)."""
def test_no_literal_46rem_width_remains() -> None:
"""Flipped negative pin (phase 100 D1): ZERO literal
max-width: 46rem rules remain in the file — the phase-27/59/91
form-column caps are retired, and the dialog panels ride the
token, not a 46rem literal."""
css = _css()
wide = css.index("@media (min-width: 1500px)")
mobile = css.rindex("@media (max-width: 640px)")
assert wide > mobile, (
"the wide override belongs in the bottom media-query region"
assert css.count("max-width: 46rem") == 0, (
"no literal max-width: 46rem rule may remain (retired 2026-09-12)"
)
assert "min(46rem" not in css, (
"the dialog panels must ride the token, not a 46rem literal"
)
@@ -119,7 +118,7 @@ def test_the_four_reading_columns_use_the_token() -> None:
""".chat-shell, .shared-shell, .doc-md and
.doc-summary:has(+ .doc-md) each cap with
max-width: var(--chat-column) — and exactly those four rules use
the token (no other selector)."""
the token for a max-width (no other selector)."""
css = _css()
for selector in (
".chat-shell",
@@ -135,73 +134,89 @@ def test_the_four_reading_columns_use_the_token() -> None:
)
def test_shared_shell_keeps_the_centered_column_comment() -> None:
""".shared-shell's inline comment keeps the "centered chat column"
wording and notes the wide override (task 01 work item)."""
css = _css()
rule = css[css.index(".shared-shell {") : css.index(".shared-shell {") + 400]
assert "the PLAN §7 centered chat column" in rule
assert "92rem at >=1500px" in rule, "the comment must note the wide override"
def test_doc_md_keeps_width_100_under_the_cap() -> None:
""".doc-md stays width:100% under the token cap (the modal's
1100px panel remains its effective ceiling there)."""
1100px panel remains its effective ceiling there — phase 100 D2)."""
assert "width: 100%" in _rule_block(_css(), ".doc-md")
# ---------- the negative pins ----------
# ---------- the form shells + the dialog panels ----------
def test_tuning_shell_stays_hardcoded_46rem() -> None:
""".tuning-shell (the form column, out of scope) keeps its
hard-coded max-width: 46rem at every width — it never widens."""
def test_the_form_shells_ride_the_full_container() -> None:
"""The form shells (.tuning-shell — phase 27, .theme-shell —
phase 91, .doc-edit-shell — phase 59) carry NO cap, NO token, and
NO margin-inline: the .container ancestor centers them, so they
ride the 72rem frame like .sources-shell (flex column,
gap 1.25rem, flex: 1 — the owner instruction 2026-09-12 retires
the form-column caps)."""
css = _css()
tuning = _rule_block(css, ".tuning-shell")
assert "max-width: 46rem" in tuning, (
".tuning-shell must stay hard-coded 46rem (negative pin)"
)
assert "var(--chat-column)" not in tuning, (
".tuning-shell must NOT reference the reading-column token"
)
for selector in (".tuning-shell", ".theme-shell", ".doc-edit-shell"):
block = _rule_block(css, selector)
assert "max-width" not in block, (
f"{selector} must carry no cap (retired 2026-09-12)"
)
assert "var(--chat-column)" not in block, (
f"{selector} rides the .container frame, not the token"
)
assert "margin-inline" not in block, (
f"{selector} is centered by the .container ancestor"
)
for decl in (
"display: flex",
"flex-direction: column",
"gap: 1.25rem",
"flex: 1",
):
assert decl in block, (
f"{selector} keeps the .sources-shell shape ({decl})"
)
def test_no_other_hardcoded_46rem_rule_remains() -> None:
"""After the switch, the form columns are the ONLY rules with a
literal max-width: 46rem: .tuning-shell (phase 27),
.doc-edit-shell (phase 59, task 06 — the doc edit screen is a
FORM column, not a reading column, so it must not ride
--chat-column and phase 58's wide-desktop doubling must never
stretch the form), and .theme-shell (phase 91 task 04 — the
admin Theme editor is a form column too: the palette grid +
fieldsets must never ride the wide-desktop doubling). Every
reading column rides the token (the --chat-column base
declaration is the other non-rule occurrence of 46rem)."""
def test_the_dialog_panels_ride_the_token() -> None:
"""The two source-page dialogs (phase 69 remove-confirm, phase 89
ignore-editor) cap at the chat-column width THROUGH THE TOKEN —
min(var(--chat-column), calc(100vw - 2rem)) — or the viewport,
whichever is narrower (the 46rem literals ride no more)."""
css = _css()
assert css.count("max-width: 46rem") == 3, (
"only the form columns (.tuning-shell, .doc-edit-shell, "
".theme-shell) may keep a literal max-width: 46rem"
)
assert "max-width: 46rem" in _rule_block(css, ".tuning-shell")
assert "max-width: 46rem" in _rule_block(css, ".doc-edit-shell")
assert "max-width: 46rem" in _rule_block(css, ".theme-shell")
for selector in (".remove-confirm-panel", ".ignore-editor-panel"):
block = _rule_block(css, selector)
assert "min(var(--chat-column), calc(100vw - 2rem))" in block, (
f"{selector} must ride the token (the chat-column width "
"or the viewport)"
)
def test_comments_cite_the_wide_override_with_provenance() -> None:
"""The block comments that claimed the "46rem column contract" now
name base 46rem + the 2x wide override, with the owner
instruction (2026-08-31, TODO L5) as the provenance at the token
and the media block."""
# ---------- the comment contract ----------
def test_comments_carry_the_72rem_contract() -> None:
"""The stale width claims are gone from the file: no "≤46rem",
"46rem base", "92rem at >=1500px" or "1500px" wording (the
2026-08-31 contract was rewritten to the 72rem contract), with the
owner instruction (2026-09-12) as the provenance at the token and
the reading-column comments naming 72rem."""
css = _css()
# The stale "≤46rem" contract claims are gone from the file.
assert "≤46rem" not in css, (
"the stale '≤46rem' contract wording must be updated"
)
# Provenance at the two authoritative spots (token + wide block).
token_idx = css.index("--chat-column: 46rem")
wide_idx = css.index("@media (min-width: 1500px)")
assert "owner instruction 2026-08-31" in css[max(0, token_idx - 400) : token_idx]
assert "owner instruction 2026-08-31" in css[max(0, wide_idx - 500) : wide_idx]
# The chat-shell comment names base + override.
assert "46rem base" not in css, "no stale '46rem base' claim may remain"
assert "92rem at >=1500px" not in css, (
"no stale wide-override claim may remain"
)
assert "1500px" not in css, (
"the wide-desktop breakpoint wording is retired (2026-09-12)"
)
# Provenance at the authoritative spot (the token).
token_idx = css.index("--chat-column: 72rem")
assert "owner instruction 2026-09-12" in css[max(0, token_idx - 400) : token_idx]
# The chat-shell + shared-shell comments name the 72rem contract.
chat_comment = css[: css.index(".chat-shell {")]
assert "46rem base" in chat_comment and "92rem" in chat_comment
assert "72rem" in chat_comment, (
"the chat-shell comment must name the 72rem contract"
)
shared_idx = css.index(".shared-shell {")
shared_rule = css[shared_idx : shared_idx + 400]
assert "72rem" in shared_rule, (
"the shared-shell comment must name the 72rem contract"
)