feat(ui): one consistent navbar on every page (TODO.md L3)

This commit is contained in:
2026-08-26 15:39:42 -04:00
parent 0a46f07fa8
commit b2d8696741
19 changed files with 2122 additions and 678 deletions
+20 -3
View File
@@ -18,6 +18,14 @@ Phase 16 adaptation: the auth control (Sign in / Sign out) joins the chat
header's ``.header-inner`` — the desktop test verifies its presence in
both auth states without the bar's height moving (height assertions
unchanged).
Phase 34 adaptation (two-row viewer header, owner confirmation
2026-08-26): the viewer's ``<header>`` is now TWO rows — row 1 is the
standard shared bar (``.doc-header .app-header``, the phase-12/19
``--header-h`` contract) and row 2 is the ``.doc-titlebar`` (back +
title + meta, content-sized). The height assertions are pointed at ROW
1 — the standard bar — which must equal the chat/sources bars exactly;
the titlebar row is asserted present (height > 0), not height-pinned.
"""
from __future__ import annotations
@@ -95,7 +103,9 @@ def _header_heights(page: Page, app_url: str) -> dict[str, float]:
page.goto(app_url + VIEWER_URL)
expect(page.locator("#doc-title")).to_have_text("Kubernetes Homelab Cluster", timeout=15_000)
heights["document"] = _box_height(page, ".doc-header")
# Phase 34: the viewer header is two rows — measure ROW 1 (the
# standard bar), which must equal the other pages' bars exactly.
heights["document"] = _box_height(page, ".doc-header .app-header")
return heights
@@ -158,6 +168,9 @@ def test_header_height_identical_across_pages_mobile(
def test_viewer_header_content_still_fits(
page: Page, app_url: str, mock_llm: int, db_ready: None
) -> None:
"""Phase 34: the phase-10 viewer content (title, badges, back link)
survives in the titlebar ROW, and row 1 stays the pinned standard
bar — single-line on both desktop and mobile."""
_seed_db(mock_llm)
for width, expected_h in ((1280, DESKTOP_HEADER_H), (375, MOBILE_HEADER_H)):
@@ -176,10 +189,14 @@ def test_viewer_header_content_still_fits(
expect(page.locator(".format-badge", has_text="md")).to_be_visible()
expect(page.locator(".doc-path", has_text="homelab/kubernetes.md")).to_be_visible()
# Back link still there, ≥44px touch target, in the shared bar.
# Back link still there, ≥44px touch target, in the titlebar row.
back = page.locator("#doc-back")
expect(back).to_be_visible()
assert _box_height(page, "#doc-back") >= 44
expect(page.locator(".doc-header")).to_have_css(
# Phase 34 two-row contract: ROW 1 is the standard bar (the
# pinned --header-h), and the titlebar row is present below it.
expect(page.locator(".doc-header .app-header")).to_have_css(
"height", f"{expected_h}px"
)
assert _box_height(page, ".doc-titlebar") > 0, ("the titlebar row must render")