Repository navigation
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/web/client/ConflictResolver.tsx`:
- Around line 272-298: handleAcceptAll currently overwrites any existing
per-conflict resolutions; change it to skip already-resolved rows by checking
the incoming prev Map inside setChoices and not touching entries where
prev.has(conflictIdx) is true (use the existing conflictIdx derived from each
conflictRow and the choices Map passed into the updater). Specifically, in the
setChoices updater for handleAcceptAll, before computing effectiveChoice/content
for a row, if prev.has(conflictIdx) continue so you only fill unresolved
conflicts; alternatively, if you prefer confirmation UX, perform a pre-check
using choices.size > 0 (or the current choices Map) and show a confirmation
dialog before calling setChoices — reference handleAcceptAll, choices (prev),
conflictRows and conflictIndex when making the change.
🧹 Nitpick comments (1)
src/web/client/ConflictResolver.tsx (1)
461-504: Extract shared inline styles to reduce duplication.The three buttons share identical
fontSize,padding, andcolordeclarations. Consider extracting the common style to a constant:♻️ Suggested refactor
+const acceptAllBtnStyle: React.CSSProperties = { + color: 'var(--text-primary)', + fontSize: 11, + padding: '4px 8px', +}; + // Then in JSX: - style={{ - background: 'var(--base-bg)', - border: '1px solid var(--base-border)', - color: 'var(--text-primary)', - fontSize: 11, - padding: '4px 8px' - }} + style={{ + ...acceptAllBtnStyle, + background: 'var(--base-bg)', + border: '1px solid var(--base-border)', + }}Same pattern for the "Current" and "Incoming" buttons. Alternatively, a CSS class (e.g.,
.btn-accept-all) would be cleaner and consistent with the existingbtn/btn-primary/btn-secondaryclass-based approach.
|
@coderabbitai Yep, can you commit option 2 -
That was an oversight! |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain
🏁 Script executed: Length of output: 649
Task: Add check to skip already-resolved rows in bulk conflict resolution
🧠 Learnings used💡 Use |
Looks good at first glance, this'll be properly tested in the coming PR
Summary by CodeRabbit