Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds KeyFactor.created_at serialization and new i18n keys; introduces deterministic sorting and many front-end changes: optimistic voting hooks/panels, PanelContainer/VotePanel/MorePanel, VerticalImpactBar, KeyFactorStrengthItem composition, API-backed optimistic voting flow, prop/type adjustments, and removal of several legacy components. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant UI as KeyFactor UI
participant Panels as KeyFactorVotePanels
participant Optim as useOptimisticVote
participant API as Backend API
participant Feed as Comments Feed
User->>UI: click vote / open panel
UI->>Panels: open specific panel (impact/downvote/more)
User->>UI: select option & confirm
UI->>Optim: setOptimistic(vote)
Optim-->>UI: update local counts (optimistic)
UI->>API: POST voteKeyFactor
API-->>Feed: persist vote
alt success
Feed->>UI: aggregated update
Optim->>UI: clearOptimistic -> render server counts
else failure
API-->>Optim: error
Optim->>UI: clearOptimistic -> revert UI
end
sequenceDiagram
participant User
participant Anchor as Card Anchor
participant Panel as PanelContainer
participant Parent as Card Parent
User->>Anchor: click ellipsis / vote button
Anchor->>Panel: provide anchorRef for positioning
Panel->>Parent: onVotePanelToggle(true)
Parent->>Parent: ensure exclusivity (close others)
User->>Panel: click outside / close
Panel->>Parent: onVotePanelToggle(false)
Parent->>Panel: closePanel()
Estimated code review effort🎯 4 (Complex) | ⏱️ ~65 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
🚀 Preview EnvironmentYour preview environment is ready!
Details
ℹ️ Preview Environment InfoIsolation:
Limitations:
Cleanup:
|
597275c to
14580b4
Compare
14580b4 to
9858b7a
Compare
d6d2a0c to
629c70a
Compare
629c70a to
4aa477e
Compare
cemreinanc
left a comment
There was a problem hiding this comment.
Left couple of comments. LGTM otherwise.
There was a problem hiding this comment.
Why we didn't use a popover component instead of the custom portal/positioning, is it intentional? It would handle SSR, accessibility, click-outside, and positioning out of the box.
There was a problem hiding this comment.
Good catch, thanks! I'll try to refactor this, likely in the 2nd iteration PR.
| }, []); | ||
|
|
||
| const toggleOption = useCallback((option: T) => { | ||
| setSelectedOption((prev) => (prev === option ? null : option)); |
There was a problem hiding this comment.
these selections looks like they don't have any impect besides ui state. Are we expecting it in upcoming iterations?
There was a problem hiding this comment.
Yes, for now it's only handled on the UI side. We’re planning to add backend support for it in upcoming iterations.
890b7c6 to
c20a690
Compare
c20a690 to
b46d152
Compare
b46d152 to
0b0e30b
Compare

This PR implements the 1st iteration of the Key Factors Redesign
Iteration 1: Unified Cards + Voting + Grid Layout
Summary by CodeRabbit
New Features
Internationalization
UI/UX