test(e2e): assert sidebar folder alignment guides by measured x (#3914) - #3942
Conversation
UX Review (Fable 5) — ✅ PASSAdvisory UX-level review of The diff touches only two test files — a new Playwright spec and the executed-spec floor bump. No component code, no user-facing strings, no rendered pixels change. The spec itself exists to protect a UX property (the sidebar's alignment guides) that regressed four times. Nothing in this PR reaches a user's screen, so there is no UX surface to fault. UX-Verdict: PASS Test-only change with zero rendered-pixel delta; it adds the first real-geometry guard for a sidebar alignment that shipped broken four times. [UX-REVIEWED] fba3640 |
Design Review (Fable 5) — ✅ PASSAdvisory design-level review of Design-Verdict: PASS Right layer for a geometry invariant: the fourth-time regression is finally asserted on rendered pixels, in the existing offline E2E gate, with fail-loud diagnostics. Suggestions
[DESIGN-REVIEWED] fba3640 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsThis is a test-only PR: a No findings. [OPUS-REVIEWED] fba3640 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
The sidebar's three folder alignment guides have regressed four times (#1211, #3766, #3903, and twice on paper inside #3905), every time via a Tailwind-class derivation that omitted the 2px FOLDER_BODY_INSET_PX container differential between the folder header's box and the nested body's box. The jsdom test (ChatSidebar.folderAlignment.test.tsx) cannot catch that class of break: jsdom has no layout engine, so it asserts class tokens and an arithmetic identity between constants, never the rendered geometry. Add a Playwright spec to the `E2E (stub ACP backend, offline)` gate that seeds one folder, one subfolder, and sessions in both plus one ungrouped session via the harness gateway API, then asserts the guides on getBoundingClientRect().left of the real rendered elements: - guide 1: folder glyph on its border-l connector line (depth 1 and 2) - guide 2: folder name on the agent label / title of its sessions (depth 1 and 2) - guide 3: nested folder glyph on its sibling sessions' content column, and the root-lane identity (ungrouped content on the root glyph) - depth invariance: the depth-2 connector on depth 1's content column Falsified against the historical regression class: rebuilding with FOLDER_BODY_INSET_PX bumped 2 -> 4 fails the spec with "fGlyph=259 vs fConnector=261" while the jsdom test stays green. The missing-selector diagnostics were falsified the same way (a broken selector fails with "missing: [aAgent, ...]", not a bare timeout). Pre-push review (GPT + Opus model-pinned): no blocking. Fixed advisory findings: absolute coherence anchors so difference-only assertions cannot hold vacuously at left=0; seeding requests assert response.ok() so a 4xx fails as a seeding fault, not an alignment fault; the settle poll subsumes the render wait (budget fits the 30s test timeout) and names missing selectors; the serial-run dependency on the wipe discipline in session-tags-folders.spec.ts is documented in the header. The tool-call subtitle is not asserted: it needs a live agent turn to render, is a sibling of the title inside the same block container (equal left by construction), and its class parity is pinned by the jsdom test. MIN_EXECUTED_SPECS raised 219 -> 220 for the added spec. Closes #3914
e6641d5 to
fba3640
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (2 files). Criteria: no conflict, no requested changes, security path denylist clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: e2e test asserting sidebar folder alignment guides by measured x-coordinate.
bolichen97
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: test (2 files). Criteria: no conflict, no requested changes, security path denylist clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: e2e test asserting sidebar folder alignment pixel guides, no production code changes.
…dotdev#3914) (kirodotdev#3942) The sidebar's three folder alignment guides have regressed four times (kirodotdev#1211, kirodotdev#3766, kirodotdev#3903, and twice on paper inside kirodotdev#3905), every time via a Tailwind-class derivation that omitted the 2px FOLDER_BODY_INSET_PX container differential between the folder header's box and the nested body's box. The jsdom test (ChatSidebar.folderAlignment.test.tsx) cannot catch that class of break: jsdom has no layout engine, so it asserts class tokens and an arithmetic identity between constants, never the rendered geometry. Add a Playwright spec to the `E2E (stub ACP backend, offline)` gate that seeds one folder, one subfolder, and sessions in both plus one ungrouped session via the harness gateway API, then asserts the guides on getBoundingClientRect().left of the real rendered elements: - guide 1: folder glyph on its border-l connector line (depth 1 and 2) - guide 2: folder name on the agent label / title of its sessions (depth 1 and 2) - guide 3: nested folder glyph on its sibling sessions' content column, and the root-lane identity (ungrouped content on the root glyph) - depth invariance: the depth-2 connector on depth 1's content column Falsified against the historical regression class: rebuilding with FOLDER_BODY_INSET_PX bumped 2 -> 4 fails the spec with "fGlyph=259 vs fConnector=261" while the jsdom test stays green. The missing-selector diagnostics were falsified the same way (a broken selector fails with "missing: [aAgent, ...]", not a bare timeout). Pre-push review (GPT + Opus model-pinned): no blocking. Fixed advisory findings: absolute coherence anchors so difference-only assertions cannot hold vacuously at left=0; seeding requests assert response.ok() so a 4xx fails as a seeding fault, not an alignment fault; the settle poll subsumes the render wait (budget fits the 30s test timeout) and names missing selectors; the serial-run dependency on the wipe discipline in session-tags-folders.spec.ts is documented in the header. The tool-call subtitle is not asserted: it needs a live agent turn to render, is a sibling of the title inside the same block container (equal left by construction), and its class parity is pinned by the jsdom test. MIN_EXECUTED_SPECS raised 219 -> 220 for the added spec. Closes kirodotdev#3914 Co-authored-by: Joe Guo <zejiangg@amazon.com>
Problem / Motivation
The chat sidebar's three left-edge alignment guides — folder glyph on its connector line; folder name on the agent label / title / subtitle of the sessions inside it; a nested folder's glyph on its sibling sessions' content column — have been broken four times (#1211, #3766, #3903, and twice on paper inside the fix for #3766, PR #3905). Every break was a Tailwind-class derivation that omitted the 2px
FOLDER_BODY_INSET_PXcontainer differential between the folder header's box and the nested body's box. Nothing in the class list expresses that 2px, andChatSidebar.folderAlignment.test.tsxcannot catch it: jsdom has no layout engine, so the file asserts the inputs (class tokens) plus an arithmetic identity whose terms are constants declared in the test itself — it stayed green through every regression.Why it matters
The alignment guides are the sidebar's visual grammar: when they drift, folders stop reading as heads of their subtrees and nested folders float off their siblings' column. Each of the four regressions shipped a visibly misaligned sidebar and cost a rediscovery-plus-refix cycle, because the only geometry check ran in an engine that cannot measure geometry.
What changed (motivation → approach → change)
Symptom: class-derivation regressions invisible to jsdom. Root cause: no test measures the rendered x-coordinates. Change: add a Playwright spec to the
E2E (stub ACP backend, offline)gate — which already runs a real browser against a seeded harness gateway — that seeds one folder, one subfolder, sessions in both, and one ungrouped session via the gateway API, then asserts the guides ongetBoundingClientRect().leftof the real elements:border-lconnector line (depth 1 and 2)Difference assertions are anchored (root glyph at x>0, indentation strictly increasing with depth) so they cannot hold vacuously on box-less nodes. Seeding requests assert
response.ok(), so a seeding 4xx fails as a seeding fault rather than an alignment fault. The settle poll doubles as the render wait and names any selector that never resolves (missing: [aAgent, ...]) instead of timing out bare. The spec seeds and deletes only its own fixtures — no harness-wide wipes.The tool-call subtitle is not asserted: it requires a live agent turn to render, is a sibling of the title inside the same block container (equal left by construction), and its class parity is pinned by the jsdom test.
MIN_EXECUTED_SPECSintest/test_playwright_e2e.pyis raised 219 → 220 for the added spec.Tests
website/playwright/sidebar-folder-alignment.spec.ts(new): the nine measured-x assertions above, plus three absolute anchors.FOLDER_BODY_INSET_PXmutated 2 → 4 fails the spec withguide 1 depth 1 (glyph on connector): fGlyph=259 vs fConnector=261while the jsdom test stays green. The missing-selector diagnostics were falsified the same way (a deliberately broken selector fails withmissing: [aAgent, aTitle, bAgent, bTitle, uAgent]).Manual verification
Ran the spec against the same isolated harness the CI gate uses (
spawn_feature_gateway+ fake ACP backend, throwaway home): green on clean main, red under the injected 2px mutation, green again after revert. Frontend gates (npx tsc -b,npx vitest run— one pre-existingCliPanelCoverageflake, passes in isolation) and backend gates (isort / flake8 / mypy / targeted pytest of the floor-helper tests) all pass.Why no screenshot: test-only change — a new Playwright spec and a test constant bump; no rendered pixel changes.
Related Issues
Closes #3914
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)