feat(ui): single compact site-wide privacy notice below the composer#576
Conversation
The answer composer stacked two privacy elements (full notice above the pill plus a duplicate warning below it), and the answer home hero added a third "Privacy & data handling" link — on phones this burned three-plus lines of dock space. - Redesign PrivacyInputNotice as one quiet 11px line (text-2xs, smaller icon, muted link) and render it once below the pill for every search mode and composer placement; input aria-describedby now always points at it. z-[5] keeps it above the dock backdrop but under the command surface so the suggestions dropdown covers it. - Remove the duplicated hero-footer privacy link from the answer empty state and the orphaned composerWarning/composerLinkLabel copy. - Tests: assert exactly one /privacy link on the home page; repair the pre-existing #553 drift in ui-smoke (/privacy h1 is "Privacy & data handling", not "Privacy and data processing"). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughWalkthroughThe privacy notice component now owns composer warning content and supports identifiers for accessibility and testing. Composer rendering is conditional by mode, the answer empty state removes its duplicate privacy link, privacy copy is reduced to page labels, and UI tests reflect the updated content. ChangesPrivacy notice flow
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant SearchComposer
participant GlobalSearchInput
participant PrivacyInputNotice
SearchComposer->>PrivacyInputNotice: Render notice for eligible composer modes
GlobalSearchInput->>PrivacyInputNotice: Reference notice through aria-describedby
PrivacyInputNotice-->>GlobalSearchInput: Expose warning text and privacy link
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (10 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0036ee46ba
ℹ️ 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. 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. After fixing or dispositioning a thread, reply in that thread with as the first line, followed by a concise summary; that marker authorizes the workflow to close that exact thread. If human input or new authorization is required, do not use the marker and leave the thread open with the blocker. 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. |
|
To use Codex here, create a Codex account and connect to github. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/components/clinical-dashboard/master-search-header.tsx (1)
1275-1275: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winHardcoded id string duplicated between
aria-describedbyand the notice'sid/testId.
"answer-composer-privacy-warning"is repeated three times (input'saria-describedbyat Line 1275, andid/testIdat Lines 1329-1330) with no single source of truth. A future rename of one occurrence silently breaks the accessibility wiring without a compile error.♻️ Suggested fix: extract a shared constant
+const composerPrivacyWarningId = "answer-composer-privacy-warning"; + ... - aria-describedby="answer-composer-privacy-warning" + aria-describedby={composerPrivacyWarningId} ... <PrivacyInputNotice - id="answer-composer-privacy-warning" - testId="answer-composer-privacy-warning" + id={composerPrivacyWarningId} + testId={composerPrivacyWarningId} className="mt-1.5 justify-center px-3 text-center" />Also applies to: 1325-1332
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/clinical-dashboard/master-search-header.tsx` at line 1275, Extract the repeated "answer-composer-privacy-warning" value into a shared constant near the relevant component, then use that constant for the input's aria-describedby and the privacy notice's id and testId. Update all three references consistently so the accessibility wiring remains synchronized.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/lib/ui-copy.ts`:
- Around line 108-116: Update the documentation comment above privacyCopy to
remove the obsolete reference to the answer empty-state link, describing only
its current /privacy transparency-page usage while preserving the existing
privacy-impact-assessment and composer/upload warning references.
---
Nitpick comments:
In `@src/components/clinical-dashboard/master-search-header.tsx`:
- Line 1275: Extract the repeated "answer-composer-privacy-warning" value into a
shared constant near the relevant component, then use that constant for the
input's aria-describedby and the privacy notice's id and testId. Update all
three references consistently so the accessibility wiring remains synchronized.
🪄 Autofix (Beta)
❌ Autofix failed (check again to retry)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 647f19e3-1de3-4be1-8459-1e4c7b0b3bb7
📒 Files selected for processing (6)
src/components/clinical-dashboard/answer-status.tsxsrc/components/clinical-dashboard/master-search-header.tsxsrc/components/privacy-input-notice.tsxsrc/lib/ui-copy.tstests/ui-smoke.spec.tstests/ui-tools.spec.ts
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. The branch was updated while autofix was in progress. Please try again. |
- Skip the composer privacy notice on phone non-answer result docks: those paths reserve pill-only scroll clearance (5rem dashboard compact branch, 5.5rem standalone shell), so the extra line pushed the fixed dock over the last result. Entry composers for those flows still show the notice; answer docks keep it (reserves were sized for the old taller stack). aria-describedby now matches the render gate. - Extract the shared composer privacy-warning id into a constant so the aria wiring and notice id cannot drift. - Drop the stale "answer empty-state link" reference from the privacyCopy doc comment. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@coderabbitai resolve |
✅ Action performedComments resolved and changes approved. |
The Answer and Documents mode homes asserted "Source backed" before any question was asked, which overstates a corpus whose per-document validation status varies (unverified / review-due documents exist and are labelled on results). Describe the mechanism instead: "Searches indexed clinical sources". Per-answer "Source-backed" labels that reflect an actual grounding verdict are unchanged. The PT-04 composer-warning size tweak was superseded by #576's single compact site-wide privacy notice and is intentionally not re-applied. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Summary
The composer stacked two privacy elements (full notice above the pill + a duplicate "Don't enter identifiable patient details." below it), and the answer home hero added a third "Privacy & data handling" link — on phones this burned 3+ lines of dock space. This PR consolidates everything into one compact 11px privacy line rendered once below the composer pill, site wide.
PrivacyInputNoticeredesign:text-2xs/leading-4, smaller icon, muted link with hover accent; newid/testIdprops.z-[5]keeps it above the dock backdrop (z-0) but under the command surface (z-10) so the suggestions dropdown covers it instead of bleeding through (latent stacking bug — the dropdown's z-30 is trapped inside the surface's own stacking context).aria-describedbyis unconditional. Removed the duplicated hero-footer privacy link from the answer empty state and the orphanedcomposerWarning/composerLinkLabel/noticeAriaLabelcopy./privacy. Upload-sheet notice unchanged.Test changes
ui-tools@critical: asserts the consolidated notice + link and exactly one/privacylink on the home page (guards future double-ups).ui-smoke: repaired pre-existing drift from feat(rag): remediate clinical retrieval and safety #553 — the test expected an/privacyh1 of "Privacy and data processing" and a "Draft for privacy and clinical-governance approval" badge that never shipped; the page renders "Privacy & data handling" / "This is draft product information…". These 4 viewport tests failed on main before this PR.Clinical governance preflight
Verification
npm run verify:cheapon the rebased base: 1937 tests passed.@criticalPHI-warning test (390px + 1280px) and privacy ui-smoke at mobile / 200% zoom / tablet / desktop — all pass.🤖 Generated with Claude Code