Skip to content

test(ui): computed-style smoke test — assert rendered DOM layout catches #2517-class regressions (#2519)#2532

Merged
alexey-pelykh merged 1 commit intomainfrom
test/2519-computed-style-smoke
Apr 24, 2026
Merged

test(ui): computed-style smoke test — assert rendered DOM layout catches #2517-class regressions (#2519)#2532
alexey-pelykh merged 1 commit intomainfrom
test/2519-computed-style-smoke

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

Closes #2519.

Acceptance criteria

  • New test file at ui/src/ui/app.computed-style.test.ts
  • Tests run via dedicated pnpm test:ui:smoke script (the AC's "or a dedicated pnpm test:browser" alternative — root-level script, CI job uses same)
  • All 4 example assertions pass on a healthy build (4 tests, 2.09s locally)
  • Re-introducing the fix(ui): restore shell-nav + sidebar-shell wrappers — sidebar layout broken after #2501 migration #2517 regression makes the sidebar-height test FAIL — empirically verified in development: removing the .shell-nav / .sidebar-shell / .sidebar-nav wrapper hierarchy produces expected 52 to be greater than 300 (sidebar) AND expected 90.31 to be less than or equal to 53.31 (nav-section header position). Double-barrel regression catch.
  • CI runs the browser-mode tests on PRs — new test-ui-smoke job, installs Chromium via pnpm --dir ui exec playwright install --with-deps chromium, wired into CI aggregator needs
  • Documented in CLAUDE.md — new § Testing → Browser-mode smoke tests subsection + CI section entry
  • Test runtime overhead < 30s on CI — 2.64s locally for both smoke suites combined; CI adds one-shot Chromium install

Design notes

  • Desktop viewport is essential. The default browser-mode viewport is mobile-portrait (414×896), which triggers @media max-width: 1100px and hides the sidebar. The suite forces page.viewport(1280, 720) in beforeAll via vitest/browser.
  • Explicit ../styles.css import. Matches navigation.browser.test.ts. Without it, CSS grid doesn't apply and assertions are meaningless.
  • Uses mountApp helper rather than the issue's literal document.createElement+innerHTML — consistent with chat-markdown.browser.test.ts / navigation.browser.test.ts and benefits from registerAppMountHooks cleanup.
  • Assertions check layout outcomes, not wrapper existence — robust to intentional refactors that preserve the grid contract.

Scope discipline

The test-ui-smoke CI lane runs only app.smoke.test.ts + app.computed-style.test.ts. The broader pnpm test:ui has unrelated pre-existing failures (cron.test.ts, sessions.test.ts, verbose=full selector tests) that are out of scope for #2519 — documented in CLAUDE.md.

Test plan

🤖 Generated with Claude Code

…hes #2517-class regressions (#2519)

Extends app.smoke.test.ts (#2495/#2496) with a browser-mode smoke suite
that mounts <remoteclaw-app> into a desktop viewport (1280x720 via
page.viewport() from vitest/browser), waits for layout (updateComplete
+ double rAF), and asserts getBoundingClientRect dimensions on
.sidebar / .topbar-status / .nav-section / section.chat — catching the
#2517 regression class where production class renders but structural
wrappers are missing, so the sidebar lands in the wrong grid cell and
nav content escapes the visible area.

Scope:
- ui/src/ui/app.computed-style.test.ts — 4 tests, ~2.1s runtime, uses
  mountApp helper + explicit ../styles.css import (matches
  navigation.browser.test.ts pattern)
- .github/workflows/ci.yml — new test-ui-smoke job, installs Chromium
  via "pnpm --dir ui exec playwright install --with-deps chromium",
  runs pnpm test:ui:smoke; wired into CI aggregator needs
- package.json — root test:ui:smoke script runs the two smoke suites
- CLAUDE.md — new "Browser-mode smoke tests" subsection under
  § Testing documenting the lane and its scope discipline

AC #4 verified empirically: removing the .shell-nav / .sidebar-shell /
.sidebar-nav wrapper hierarchy makes the sidebar-fits-viewport test
fail ("expected 52 to be greater than 300") and the nav-section header
position test fail ("expected 90.31 to be less than or equal to 53.31").

The test-ui-smoke CI lane is scoped to the two sync-regression suites
only — the broader pnpm test:ui has unrelated pre-existing failures
(cron.test.ts / sessions.test.ts / etc.) that are out of scope.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) April 24, 2026 10:56
@alexey-pelykh alexey-pelykh merged commit 50d2537 into main Apr 24, 2026
16 checks passed
@alexey-pelykh alexey-pelykh deleted the test/2519-computed-style-smoke branch April 24, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(ui): computed-style smoke test — assert sidebar/topbar/chat layout properties on rendered DOM

1 participant