fix(search): close the loose ends left by the also-matches disclosure - #2727
fix(search): close the loose ends left by the also-matches disclosure#2727BigSimmo wants to merge 5 commits into
Conversation
…ind it
Four small follow-ups to the "Also matches" disclosure, each independent.
The "Also in your library" tray dropped its match count from assistive tech at
every width. The visible count carries aria-hidden with a comment saying the
button's name should not read it twice, but that tray has no live region to say
it once, and below sm the count is display:none anyway. An sr-only copy now
carries it, so the closed control announces what it opens onto.
On phones the same panel showed "Tap to open", because the cross-mode lookup
waited for the click there. That is the blind door the desktop path was
deliberately built to avoid: the header could not state a count, and an empty
tray was still offered. The lookup is now eager at every width and the no-match
tray is dropped at every width. The cost is one extra cross-mode lookup per
phone search.
The page thumbnails kept the 3px accent top bar that was removed from the
best-match card, so the strip the owner asked to lose simply moved down the
page. Removed, leaving the hairline border.
One inline style={{ maxWidth }} in a design-scratch mockup became max-w-[30ch],
which puts the design-drift ratchet at 232 against its 233 ceiling. It had no
headroom, so the next PR to add a legitimate inline style would have failed on
a limit unrelated to it.
Verified: lint, typecheck, drift ratchet 232/233. Focused browser proof on the
specs the planner attributes to these files; the full Chromium suite is left to
CI, which runs it on this change.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KYV1sTeo2DHUyJBjzprTRU
… now vanish It requires the cross-mode panel to exist at 320px and to sit below the medication results, but it never mocked /api/search/universal. That passed only because the phone lookup was lazy, so the panel rendered a "Tap to open" header whether or not anything was behind it. With the lookup eager the panel correctly drops itself when the query has no cross-mode match, and the ordering assertion went with it. Mocks one documents-domain match for this test only, so the ordering guarantee stays real rather than vacuous. The body is NDJSON, matching the endpoint: a single JSON object parses to no groups and reproduces the same empty panel. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KYV1sTeo2DHUyJBjzprTRU
…ained The aggregate went red several times on a UI-only branch while every local gate was green, and CI log access stayed blocked by the babysit marker for the whole session, so the failing job was never read. Recorded with the next action, which is to unlock the marker and read the log before offering a cause. Inbox request only. It applies to the canonical ledger via issues:reconcile after this lands. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KYV1sTeo2DHUyJBjzprTRU
…at was removed It asserted the exact `(isWide || modeId === "answer" || expanded)` gate, which was the deferral that produced the phone blind door. Repointed at the eager gate, at the empty-tray guard that now runs at every width, and at the three-way header so the "Tap to open" arm cannot come back unnoticed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KYV1sTeo2DHUyJBjzprTRU
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Bugbot couldn't run - usage limit reachedBugbot 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_6d7a3f49-4212-4ba7-a511-299a5452f816) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3040e1e092
ℹ️ 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".
|
@codex resolve actionable Codex review findings for this pull request and current head using the repository instructions. This is the pull request's single automatic repair pass: do not perform a fresh review, create new standalone findings, or request another review. Work only the existing unresolved Codex threads on the current head. The only repository destination is BigSimmo/Database, and the only branch destination is the pull request head branch claude/jolly-keller-vy36h2 at starting commit 3040e1e; never publish fixes to a detached or synthetic work branch and never create a stacked pull request. Use the authenticated GitHub connector to commit each approved fix to BigSimmo/Database:claude/jolly-keller-vy36h2, then verify that the pull request head contains the published commit before reporting success. Always fix P0 and P1 findings. For P2 and lower findings, fix only clear, scoped, low-risk issues; otherwise disposition them with a concise reason. For a fixed thread, reply with as the first line and as the second line. For a no-code disposition, use followed by . These result markers authorize the workflow to close that exact thread only after it verifies a fixed commit is the pull request head; a local-only commit is not a fix. If publication or verification fails, do not use either result marker, do not claim success, and leave the thread open with the blocker. If human input or new authorization is required, do the same. Finish only after every actionable thread is fixed or dispositioned and closed, or explicitly left open for a human decision. Do not update the branch from main, address unrelated reviews, broaden scope, or create more than one scoped fix commit. Do not use external APIs, paid services, credentials, dependency changes, or broad refactors unless explicitly authorized. Add targeted tests where behavior changes and run the narrowest relevant validation. |
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…query Editing the bottom composer on a result view calls setQuery alone: the results and modeSearchSubmitted both stay as they were. The lookup was keyed on that live query, so a paused draft fetched cross-mode matches for a search the reader never ran, replaced the tray and its "N related modes" count, and left those matches disagreeing with the primary cards still on screen for the last submitted search. The dashboard now holds the submitted query separately from the draft. Every submission records the text it submitted, clearing the flag clears the query with it, and an auto-run URL seeds it so a restored result view is not blank. Answer mode is unchanged, since it already keyed off the generated answer's query. Tools and Favourites never record a submission and fall through to the draft, which is the only query they have. Prescribing is deliberately left alone. Its medication list is itself debounced against the same draft, so the tray following the draft agrees with the cards above it there rather than contradicting them. tests/universal-also-matches-submitted-query.test.ts pins the derivation, that only the submission wrapper may write the submitted query, and that every submission passes its text. 7 passed, and 113 passed across the 13 dashboard, seed, thread and also-matches suites. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0142trjgjRAP2GA9wzqoYUAE
Bugbot couldn't run - usage limit reachedBugbot 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_a52f1d99-96ed-4874-ab0e-744b0c54ca23) |
|
Consolidated into #2736 at db6376e. The complete original head 2a327b1 is retained as an ancestor, including its code, tests and audit requests. Closing this duplicate review/CI stream under the authorised consolidation; source branch retained. Current verification and remaining merge prerequisites are recorded on #2736. This closure does not claim that the successor is merged or that its required CI is green. |
Summary
aria-hiddenwith a comment saying the button's name should not read it twice, but that tray has no live region to say it once, and belowsmthe count isdisplay: noneanyway. Ansr-onlycopy now carries it, so the closed control announces what it opens onto.style={{ maxWidth }}in a design-scratch mockup becamemax-w-[30ch], putting the design-drift ratchet at 232 against its 233 ceiling. It had no headroom, so the next PR to add a legitimate inline style would have failed on a limit unrelated to it.ui-stressrequired the tray to exist at 320px without ever mocking/api/search/universal(it passed only because the lazy phone path rendered a header regardless), andaudit-navigation-auth-regressionsasserted the exact(isWide || modeId === "answer" || expanded)gate.pr-requiredfailures on the predecessor branch that were never explained. Local gates were green throughout and CI log access stayed blocked by the babysit marker, so the failing job was never read. The recorded next action is to unlock the marker and read the log before offering a cause.Verification
npm run verify:pr-local— all 36 gates green includingtest(18,034 passed) andbuild.buildattempt failed on a torn.next/dev/types/routes.d.tswritten by an interrupted dev server on 2026-09-06 (ontacts": nevermid-file). Cleared.next/devand rebuilt clean; not related to this diff.ui-universal-search20 passed,ui-smoke+ui-stress112 passed. The full Chromium suite is left to CI, which runs it on this change — the planner escalated to full only because the mockup file has no spec attribution.npm run check:design-drift-ratchet—inline style={{ }} attributes: 232 (ceiling 233).ui-ward-discharges2 passed,ui-ward-morning2 skipped by the documented owner-approvedtest.skipfrom MERGE 02. No change needed, no code touched.npm run verify:ui— UI verification not run in full: superseded by the focused proof above plus CI's complete Chromium run on a non-draft PR.eval:retrieval:quality,eval:rag,check:production-readiness,check:deployment-readiness.Risk and rollout
ad1b84b8; the three test commits stand or fall with it.Clinical Governance Preflight
Not applicable. This change touches presentation and accessibility of the cross-mode suggestion tray only. No ingestion, answer generation, ranking, source rendering, document access, privacy, or clinical output behaviour changes.
Notes
npm run issues:reconcileafter this lands.🤖 Generated with Claude Code
https://claude.ai/code/session_01KYV1sTeo2DHUyJBjzprTRU
Generated by Claude Code
Note
Low Risk
Changes are UI, cross-mode fetch timing on mobile, and query-state wiring for the also-matches tray—no auth, RAG, or data-path changes; extra universal search requests on phone are the main behavioral cost.
Overview
This PR finishes the Also matches / cross-mode tray work: it fixes a draft-vs-submitted query bug, makes phone behavior match desktop for counts and empty trays, and cleans up a11y and small UI drift.
Cross-mode lookup now follows the last submitted search, not the composer draft.
ClinicalDashboardaddssubmittedModeQueryand asetModeSearchSubmitted(submitted, submittedText?)wrapper so typing in the bottom composer without Enter no longer drivesuniversalAlsoMatchesQueryor replaces the tray while primary results still reflect the prior submission. Answer mode continues to uselatestAnswerQuery; a new source-reading test locks the contract.On phones, cross-mode search runs on submit (not on expand).
universal-search-also-matchesdrops the narrow-screen deferral and "Tap to open" header; empty trays are omitted at every width so the closed row can show a real count. That adds one/api/search/universalcall per mobile search. Related Playwright and audit tests are updated;ui-stressmocks universal search so the prescribing panel still appears at 320px.Accessibility and polish: the "Also in your library" disclosure gets an
sr-onlymatch count (visible count stays decorative/aria-hidden). Document page preview thumbnails lose the 3px clinical accent top bar. A mockup inlinemaxWidthbecomesmax-w-[30ch]for the design-drift ratchet.Process: an outstanding-issues inbox entry documents unexplained
pr-requiredCI failures on the predecessor branch.Reviewed by Cursor Bugbot for commit 2a327b1. Configure here.