Harden document-mode smoke switching follow-up#80
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix unresolved PR review comments from PR #78
Harden document-mode smoke switching follow-up
Jun 27, 2026
BigSimmo
marked this pull request as ready for review
June 27, 2026 09:54
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the Playwright UI smoke helper that switches the dashboard into “Documents” mode by supporting both the legacy toggle and a newer “current app mode” menu path, and failing fast with a clear error when neither control is available.
Changes:
- Add a small
isVisibleWithoutThrow()helper to probe locator visibility without strict-mode exceptions aborting the flow. - Update
switchToDocumentSearchMode()to (1) use the legacy toggle when present, otherwise (2) fall back to the app-mode menu, and (3) throw a clear error when neither control is visible.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+56
to
+60
| await expect(legacyDocumentsMode).toBeEnabled(); | ||
| await expect(async () => { | ||
| await legacyDocumentsMode.click(); | ||
| await expect(legacyDocumentsMode).toHaveAttribute("aria-pressed", "true", { timeout: 1_000 }); | ||
| }).toPass({ timeout: 8_000 }); |
Comment on lines
72
to
79
| await expect(async () => { | ||
| await appModeMenu.click(); | ||
| await expect(appModeMenu).toHaveAttribute("aria-expanded", "true", { timeout: 2_000 }); | ||
| const documentsMode = page.getByRole("menuitemradio", { name: /^Documents\b/ }); | ||
| await expect(documentsMode).toBeVisible({ timeout: 3_000 }); | ||
| await documentsMode.click(); | ||
| await expect(documentsMode).toHaveAttribute("aria-pressed", "true", { timeout: 1_000 }); | ||
| await expect(appModeMenu).toHaveAccessibleName("Current app mode: Documents", { timeout: 2_000 }); | ||
| }).toPass({ timeout: 8_000 }); |
12 tasks
cursor Bot
pushed a commit
that referenced
this pull request
Jul 25, 2026
…mplate cleanup (#1204) * fix(#30): match expected files by distinct document identity The merged #30 fix assigned each expectation to a distinct source position. Positions are not documents: answer.citations carries one entry per cited chunk, so a single combo-titled document arrives several times and could still fill both comparison slots. First-come assignment was also order-dependent -- a document matching two expectations could consume the only source a narrower expectation needed, so the same inputs produced different allHit results depending on expectedFiles order. Dedupe the window by document text and assign sources by maximum bipartite matching, so coverage is both distinct-by-document and order-independent. RAG impact: no retrieval behaviour change -- eval matching only. Also append label rows in place when building labelsByDocument; paging past the 1,000-row cap (#75) means that loop now sees the full label set, where per-row array rebuilds were quadratic. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com> * chore: remove leftover PR_POLICY_BODY.md after #1153 The sync-pr-policy-body CI job overwrites a pull request description with this file whenever it exists on the head commit. The copy on main holds the audit-remediation body from #1153, so every branch cut from main silently inherits that description -- which is how #1177 lost its own body. Remove it, as #953 did after #939; the job skips cleanly when no template is present. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com> * docs(issues): record the #30 follow-up and open #80 Drop the stale queue row for #30/#75, which stayed in the recommended queue after both were archived, note the distinct-identity hardening on the #30 archive row, and open #80 to re-test the removed admission-to-discharge widening under approved eval evidence. Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com> * docs(ledger): append #1177 SHA correction and this review record Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: BigSimmo <BigSimmo@users.noreply.github.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
npm run verify:cheapnpm run verify:uiwhen UI, routing, styling, browser behavior, reduced-motion, or forced-colors behavior changednpm run verify:releasebefore release or handoff confidence claimsnpm run format:checknpm run check:production-readinesswhen clinical workflow, privacy, environment, Supabase, source governance, or deployment behavior changedClinical Governance Preflight
Complete this section when the change touches ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, or clinical output.
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
Smoke helper hardening
Scope
tests/ui-smoke.spec.tsDocumentViewer.tsxno longer carries the staleDocumentBadgeimport