Redesign related documents panel for a compact, refined mobile view - #729
Conversation
The "Related documents" panel (shown under a high-trust answer) used a plain title + dot-separated metadata line + a text "Scope" button and a 6-tag cloud, which stacked into tall, dense cards inside the mobile bottom sheet. Rework each card to match the app's document-result design language and tighten it for phones: - Add a compact file-kind tile as a visual anchor and a small uppercase match-reason eyebrow above the title. - Replace the "pages · images · tables" text line with icon-led DocumentBadge evidence pills (e.g. "p.12 +2", "2 images", "1 table"), hiding zero counts. - Turn the "Scope" control into a 44px icon-only button on phones that expands to an icon+label control from sm: up, with an explicit aria-label so the touch target and screen-reader name are preserved. - Cap the tag cloud at 3 compact chips and tighten padding/grid gaps so cards read denser on mobile while keeping the two-column layout on md+. Behaviour is unchanged: the panel still renders only for a non-empty related-document set, links target the same page/chunk, and Scope/tag callbacks are untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wp1pXzFzxxX13rHvP93KV8
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe related-documents drawer now renders each result through a dedicated card component with page-aware links, metadata badges, optional summaries, and filtered tags. Panel rendering also wires scope and tag-search callbacks and updates grid spacing. ChangesRelated document UI
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
Note Unit test generation is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Generating unit tests... This may take up to 20 minutes. |
|
Agent execution returned an error. Exit code: 1 |
Each related-document card renders governance badges (site, document type, needs-review) via DocumentOrganizationBadges and a separate tag cloud built from the same labels, so the site and document-type chips appeared twice (e.g. "Protocol", "Emergency Dept"). Filter site and document_type labels out of the tag-cloud input while still passing the full label set to DocumentOrganizationBadges, so the governance badges are unchanged and the tag cloud only adds new context (medication, risk, workflow, etc.). Cards read cleaner and shorter on mobile without losing any governance signal. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wp1pXzFzxxX13rHvP93KV8
Summary
RelatedDocumentsPanel, shown under a high-trust answer) to be compact, sophisticated, and streamlined on phones, aligned with the app's document-result design language.p.12 +2,2 images,1 table) instead of a dot-separated text line, and turns Scope into a 44px icon-only button on phones that expands to an icon+label control fromsm:up (explicitaria-labelpreserved).md:up.src/components/clinical-dashboard/document-results.tsxonly. Behaviour is otherwise unchanged — the panel still renders only for a non-empty related-document set, links target the same page/chunk, and the scope / tag-search callbacks are untouched.Verification
npm run verify:pr-localgate. Instead raneslinton the changed file (clean,--max-warnings 0) andtsc --noEmit(zerosrc/errors — the only failures are the pre-existingtests/*.dom.test.tsxmissing-@testing-library/reactenv issue, unrelated to this change).npm run verify:uiis not present in this container. Instead drove a targeted Playwright pass against the running dev server at 390×844 (phone) and 1280×900 (desktop), confirming the redesigned and streamlined panel renders correctly in the mobile bottom sheet and the desktop two-column grid with no page overflow.Risk and rollout
document-results.tsx).Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)This is a layout / styling change to how related documents are presented. It does not alter ingestion, retrieval, ranking, answer generation, document access, or any Supabase / provider behaviour, and the
DocumentOrganizationBadgesgovernance signals (site, document type, needs-review / ambiguous-site) still render on every card.Notes
Summary by CodeRabbit