[feat] Sort speed-review session-complete list by outcome#2635
[feat] Sort speed-review session-complete list by outcome#2635dewierwan wants to merge 1 commit into
Conversation
Accept and Reject columns now order strongest-first (strong-yes → neutral on Accept, neutral → most-negative on Reject) via a RATING_RANK map, instead of appearing in the order they were rated. Sort keys off effectiveRating so re-rating a row in the summary re-orders it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@claude review |
|
Claude finished @dewierwan's task —— View job Code Review Complete ✅Todo List:
Review SummaryThis is a clean, well-implemented change that adds logical sorting to the session-complete results. The implementation is solid with good attention to detail. ✅ What's Done Well
🔍 Code AnalysisKey Changes (apps/speed-review/src/components/SessionComplete.tsx):
Logic Verification:
Minor Observations
🎯 VerdictLGTM - This is a focused, well-implemented improvement that enhances the UX without introducing complexity or risk. The code is clean, type-safe, and correctly handles all edge cases including re-rating scenarios. The implementation aligns well with the existing codebase patterns and provides immediate value to users by surfacing the most important results first. |
Greptile SummaryThis PR adds outcome-strength sorting to the session-complete screen's Accept and Reject columns in the speed-review app. The implementation is a single-file, ~13-line change that introduces a
Confidence Score: 5/5Safe to merge — the change is isolated to list ordering with no effect on data submission, API calls, or application state. The diff is minimal and self-contained: a compile-time-exhaustive rank map and a comparator wired into two existing .filter().sort() chains. The sort key uses effectiveRating (already in scope) so live re-rating continues to work correctly. No logic outside the display order is touched. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[rated array] --> B[filter out resetIds to get active]
B --> C{toDecision of effectiveRating}
C -->|Accept| D[accepted list]
C -->|Reject| E[rejected list]
D --> F[sort by RATING_RANK\nstrong-yes=0, yes=1, neutral-accept=2]
E --> G[sort by RATING_RANK\nneutral-reject=3, no=4, moved-to-agisc=5]
F --> H[Render Accept column strongest first]
G --> I[Render Reject column mildest first]
Reviews (1): Last reviewed commit: "[feat] sort speed-review session-complet..." | Re-trigger Greptile |
| const byStrength = (a: RatedApplication, b: RatedApplication) => RATING_RANK[effectiveRating(a)] - RATING_RANK[effectiveRating(b)]; | ||
| const accepted = active.filter((r) => toDecision(effectiveRating(r)) === 'Accept').sort(byStrength); | ||
| const rejected = active.filter((r) => toDecision(effectiveRating(r)) === 'Reject').sort(byStrength); |
There was a problem hiding this comment.
No unit tests for sorting logic
The sorting comparator and RATING_RANK map introduce new behaviour that is straightforward to unit-test (pass a mixed RatedApplication[], assert the resulting order), yet there are no tests for SessionComplete.tsx and none were added here. If RATING_RANK is ever extended or a rank value is accidentally changed, a regression would be invisible until manual testing.
Rule Used: Consider adding tests for any new functionality in... (source)
Learned From
bluedotimpact/bluedot#956
bluedotimpact/bluedot#969
bluedotimpact/bluedot#958
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
Thanks both — both passes are clean (Greptile 5/5, Claude bot LGTM), no P1/P2 findings. The one suggestion (memoizing No code changes, so no re-trigger needed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds deterministic ordering to session result rendering. A new 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a 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 |
What
On the speed-review session complete screen, the Accept and Reject columns now order applications by review outcome strength instead of the order they happened to be rated in:
So the strongest yeses sit at the top and the most-negative at the bottom, making it easy to scan the best/worst at a glance.
How
Added a
RATING_RANKmap inSessionComplete.tsxand sorted theaccepted/rejectedlists by it. The sort keys offeffectiveRating(not the raw rating), so if you re-rate a row in the summary, it re-sorts immediately.Scope note
Earlier iterations of this branch also explored a pre-round settings panel (configurable timer + expand-responses toggle); those were dropped at the author's request. This PR is only the sort change — a single-file, ~13-line diff with no layout/CSS changes.
Testing
npm run typecheck,npm run lint,npm testall pass.Screenshots
Not included. The session-complete screen sits behind Keycloak auth and is only reachable after submitting real review decisions to Airtable, so it can't be captured in a headless/throwaway run without writing to production data. The change is pure list-ordering with no visual restyling, so there's nothing new to show beyond the existing column layout.
🤖 Generated with Claude Code