Skip to content

test(ui-smoke): scope the DSM page-root assertions to the visible owner - #2714

Open
BigSimmo wants to merge 8 commits into
mainfrom
claude/magical-heisenberg-8ilf3g
Open

test(ui-smoke): scope the DSM page-root assertions to the visible owner#2714
BigSimmo wants to merge 8 commits into
mainfrom
claude/magical-heisenberg-8ilf3g

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Production UI shard 1 failed on PR fix(ui): give the mode-menu search box a search-shell focus owner #2638 with a strict-mode violation: getByTestId("dsm-search-page") resolved to two elements — the live one under mobile-composer-reserve-pad and a hidden streaming twin beside it.
  • Established it was not that PR's: its diff was two class names on the header mode-menu search box (a control the failing test never opens), the branch differed from the main commit it merged by exactly those two lines, and that same commit ran the identical shard minutes earlier and passed.
  • Root cause is the known #093 artefact recorded in tests/playwright-settlement.ts: Next streaming can leave a hidden duplicate page root in the tree under full-suite load, so a bare getByTestId trips strict mode.
  • The repository already adjudicated this as a test-side concern and ships visibleByTestId for it. Its docstring names page-root and shell surfaces as the intended callers, tests/dsm-ui-smoke.spec.ts already scopes the same testid that way, and ui-smoke.spec.ts already imports the helper. These two call sites were simply never converted.
  • expectSingleSettledOwner is deliberately not used: the duplicate is hidden and invisible to users, so requiring it to disappear would assert more than the established decision supports.

Verification

  • npm run test:e2e -- tests/ui-smoke.spec.ts --project=chromium --grep "DSM"2 passed (8.0s), covering both changed assertions
  • npx eslint tests/ui-smoke.spec.ts --max-warnings 0 — clean
  • npx vitest run tests/playwright-project-cadence.test.tsTest Files 1 passed (1) / Tests 2 passed (2)
  • npm run format — no change to the edited file
  • npm run verify:pr-local — not run in this session; deferred to CI
  • npm run verify:uiUI verification not run in full: focused browser proof at the two changed tests only, full suite left to CI
  • npm run verify:release — not applicable, no release or handoff confidence claim

Note on what the focused run does and does not prove: the duplicate only appears under full-suite load, so a local pass shows the change is correct and non-regressive, not that it exercises the failing condition. The helper it adopts is the repository's existing, documented remedy for exactly that condition.

Risk and rollout

  • Risk: Very low. Test-only, two assertions in one spec, adopting a helper already used for the same testid elsewhere.
  • Rollback: Revert this single commit.
  • Provider or production effects: None. No production code, network, database, or environment surface is touched.
  • RAG impact: none

Clinical Governance Preflight

Not applicable. Test-only change to browser assertion scoping; no ingestion, answer generation, search or ranking, source rendering, document access, privacy, production environment, or clinical output is affected.

Notes

🤖 Generated with Claude Code

https://claude.ai/code/session_01WJ1C29Kazq72SbLHUYZLQX


Generated by Claude Code


Note

Low Risk
Test-only assertion scoping in one spec file; no production, auth, or data paths touched.

Overview
Fixes Playwright strict-mode failures when Next.js streaming leaves a hidden duplicate of DSM page roots in the DOM during full-suite runs.

Two DSM tests in ui-smoke.spec.ts now resolve dsm-search-page and dsm-diagnosis-page via the existing visibleByTestId helper and chain ribbon, result rows, and diagnosis headings from that scoped root—matching dsm-ui-smoke.spec.ts and the #093 settlement documented in playwright-settlement.ts. Comments note that category filter panels and breadcrumb back links stay page-scoped because they render through portals outside the page subtree.

Reviewed by Cursor Bugbot for commit 053891b. Configure here.

claude and others added 6 commits September 5, 2026 08:45
Clicking into "Find a mode" in the header mode menu drew a sharp accent
rectangle around the text while the magnifier icon sat outside it. The
input's Tailwind `outline-none` cannot win against the unlayered shared
text-field rule in globals.css, which paints an outline on any nested
input on focus-visible.

Adopt the established fix pair instead of inventing a new override: the
container becomes the `search-shell` focus owner and the input carries
`search-shell-input`, whose unlayered rule clears the outline and the
inset shadow. The Tailwind `focus-within:border-*` utility is dropped
because `.search-shell:focus-within` already owns that border shift, so
the control keeps a single focus affordance.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJ1C29Kazq72SbLHUYZLQX
Production UI shard 1 failed on PR #2638 with a strict-mode violation:
`getByTestId("dsm-search-page")` resolved to two elements, the live one
under `mobile-composer-reserve-pad` and a hidden streaming twin beside it.
The PR's diff was two class names on the header mode-menu search box, which
that test never opens, and the same shard passed on the base commit minutes
earlier.

This is the known `#93` artefact: Next streaming can leave a hidden
duplicate page root in the tree under full-suite load. The repository
already adjudicated it as a test-side concern and ships `visibleByTestId`
for exactly this — its docstring names page-root and shell surfaces as the
intended callers, and `tests/dsm-ui-smoke.spec.ts` already scopes the same
testid that way. These two call sites in `ui-smoke.spec.ts` were simply
never converted, and the file already imports the helper.

`expectSingleSettledOwner` is deliberately not used here: the duplicate is
hidden and invisible to users, so requiring it to disappear would assert
more than the established decision supports.

Verified: `npm run test:e2e -- tests/ui-smoke.spec.ts --project=chromium
--grep "DSM"` — 2 passed (8.0s); eslint clean on the changed file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJ1C29Kazq72SbLHUYZLQX
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 5dea8479-683a-4811-a07a-09bb1996f777


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T09:21:35.923789Z 293d064 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@supabase

supabase Bot commented Sep 7, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_4e02d503-6fbd-4a04-890f-ae8d6f31df5e)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 293d0641cf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/ui-smoke.spec.ts Outdated
claude and others added 2 commits September 7, 2026 09:37
Addresses the Codex review finding on PR #2714. Scoping only the
`dsm-search-page` root assertion left every locator after it resolving
across both copies, so the same strict-mode violation would reappear one
line later as soon as the #93 streaming twin exists: the query ribbon and
`dsm-search-result` in the first test, `dsm-category-filter-desktop` in the
second, and the diagnosis page root and its h1 after navigation.

Each test now owns its visible page root and derives the in-page locators
from it, as tests/dsm-ui-smoke.spec.ts already does.

Two locators deliberately stay page-scoped, because scoping them is wrong
rather than merely unnecessary: `dsm-category-filter-panel` renders through
`OverlayPortal` (result-filter-control.tsx), and the "Back to dsm-5" control
sits in the in-page nav header, which also portals out of the page root.
Both live outside the subtree, so a page-root scope cannot find them —
confirmed by the back-link assertion failing under the over-scoped form
before this correction.

Verified: `npm run test:e2e -- tests/ui-smoke.spec.ts --project=chromium
--grep "DSM"` — 2 passed (6.4s); eslint and prettier clean on the file.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJ1C29Kazq72SbLHUYZLQX
@cursor

cursor Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_e4501e9b-fae3-46ee-92ed-28743a9875a5)

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.

2 participants