feat: polish result surfaces and add URL-backed sorting#560
Conversation
|
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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR adds shared URL-backed sorting to multiple search views, replaces the clinical table’s custom fullscreen dialog with ChangesSearch sorting and accessibility UI
Estimated code review effort: 4 (Complex) | ~45 minutes 🚥 Pre-merge checks | ✅ 9 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (9 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
|
@codex fix all issues and failing CI and address any comments |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00808ad9ee
ℹ️ 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".
Summary
Testing
|
|
@copilot fix the failing CI tests |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2ad5ec7bc6
ℹ️ 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: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/clinical-dashboard/differentials-home.tsx (1)
1065-1078: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winMobile row numbers can skip a number when
isBestisn't first (now possible under A–Z sort).
displayIndexis shared betweenDesktopResultRow(which always rendersisBestinline) andMobileResultCard(which skips renderingisBest, since it's shown separately viaBestAnswerCard). Because the skip doesn't renumber remaining mobile rows, a mid-list gap (e.g., "1, 2, 4, 5") appears wheneverbestisn't at position 0 invisibleResults— which is now common undersortValue === "alpha"(previouslybestwas always index 0 under relevance-only sorting, so mobile numbering only had a fixed leading offset, not a mid-list gap).🔢 Proposed fix: separate contiguous counter for mobile rows
+ {(() => { + let mobileRank = 0; + return visibleResults.map((result, displayIndex) => { + const isBest = result.kind === best.kind && result.id === best.id; + const mobileIndex = isBest ? mobileRank : mobileRank++; + return ( - {visibleResults.map((result, displayIndex) => { - const isBest = result.kind === best.kind && result.id === best.id; return ( <div key={`${result.kind}-${result.id}`} className={cn(isBest && "max-lg:hidden")}> <div className="hidden lg:block"> <DesktopResultRow result={result} index={displayIndex} isBest={isBest} selected={selectedIds.has(result.id)} onToggle={result.kind === "diagnosis" ? () => toggleSelected(result.id) : undefined} /> </div> {!isBest ? ( <div className="lg:hidden"> <MobileResultCard result={result} - index={displayIndex} + index={mobileIndex} selected={selectedIds.has(result.id)} onToggle={result.kind === "diagnosis" ? () => toggleSelected(result.id) : undefined} /> </div> ) : null} </div> ); - })} + }); + })()}Also applies to: 1084-1088
🤖 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/differentials-home.tsx` around lines 1065 - 1078, Update the visibleResults mapping in the component so MobileResultCard receives a separate contiguous row number that excludes the skipped isBest result, while DesktopResultRow continues using displayIndex. Ensure mobile numbering remains sequential regardless of where best appears in visibleResults, including alpha sorting.
🤖 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/components/AccessibleTable.tsx`:
- Around line 463-476: Update the fullscreen Sheet rendering in AccessibleTable
so the low-confidence warning is displayed alongside both the expanded
AccessibleTableMarkup and the source-image fallback. Preserve the existing
showFallback branches and ensure expansion never omits lowConfidenceFallback,
using the same warning content already shown in the preview.
In `@src/components/services/services-navigator-page.tsx`:
- Around line 463-466: Update the service result flow around displayedMatches
and the ServiceCard rendering paths at the referenced sections so “Best fit,”
relevance styling, and the mobile relevance description are based only on
genuine relevance ranking, never alphabetical display position. When sortValue
is "alpha", suppress these relevance cues or pass a separate relevance rank
while preserving alphabetical ordering and conservative behavior for clinical
output.
---
Outside diff comments:
In `@src/components/clinical-dashboard/differentials-home.tsx`:
- Around line 1065-1078: Update the visibleResults mapping in the component so
MobileResultCard receives a separate contiguous row number that excludes the
skipped isBest result, while DesktopResultRow continues using displayIndex.
Ensure mobile numbering remains sequential regardless of where best appears in
visibleResults, including alpha sorting.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 756705da-0f23-4625-bc62-2a97c122c054
📒 Files selected for processing (36)
docs/branch-review-ledger.mdsrc/components/AccessibleTable.tsxsrc/components/DocumentOrganizationBadges.tsxsrc/components/DocumentTagCloud.tsxsrc/components/DocumentViewer.tsxsrc/components/applications-launcher-page.tsxsrc/components/clinical-dashboard/DocumentManagerPanel.tsxsrc/components/clinical-dashboard/clinical-badge.tsxsrc/components/clinical-dashboard/dashboard-nav.tsxsrc/components/clinical-dashboard/differentials-home.tsxsrc/components/clinical-dashboard/document-admin.tsxsrc/components/clinical-dashboard/document-search-results.tsxsrc/components/clinical-dashboard/document-ui.tsxsrc/components/clinical-dashboard/evidence-panels.tsxsrc/components/clinical-dashboard/favourites-hub.tsxsrc/components/clinical-dashboard/favourites-library-nav.tsxsrc/components/clinical-dashboard/master-search-header.tsxsrc/components/clinical-dashboard/medication-prescribing-workspace.tsxsrc/components/clinical-dashboard/medication-record-page.tsxsrc/components/clinical-dashboard/output-panel.tsxsrc/components/clinical-dashboard/search-results-header-band.tsxsrc/components/clinical-dashboard/settings-dialog.tsxsrc/components/clinical-dashboard/visual-evidence.tsxsrc/components/differentials/diagnosis-map-panel.tsxsrc/components/differentials/differential-detail-page.tsxsrc/components/differentials/differential-presentation-workflow-page.tsxsrc/components/forms/form-detail-page.tsxsrc/components/forms/forms-search-results-page.tsxsrc/components/services/service-detail-page.tsxsrc/components/services/services-navigator-page.tsxsrc/components/ui/sheet.tsxsrc/components/use-result-sort.tssrc/lib/result-sort.tstests/result-sort.test.tstests/ui-smoke.spec.tstests/ui-tools.spec.ts
Head branch was pushed to by a user without write access
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 2 file(s) based on 2 unresolved review comments. Files modified:
Commit: The changes have been pushed to the Time taken: |
|
@codex review all comments and implement the best and smallest fix for each and ensure all issues addressed without regression and merge safe. |
Summary
Committed changes on the current branch:
Created the PR via the
Testing
|
Fixed 2 file(s) based on 2 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Head branch was pushed to by a user without write access
Summary
sort=alphaand restore it through browser historyWhy
Long result lists needed a compact known-item ordering option, and the previous table fullscreen implementation duplicated modal behavior and allowed its test surface to diverge from the actual dialog root.
Validation
npm run test -- tests/result-sort.test.ts(3 passed)npm run typechecknpm run check:type-scalegit diff --checknpm cireported 0 vulnerabilitiesNo provider-backed API checks were run.