Conversation
- Introduced errorOnUnresolvedConflict property to the Push component's content configuration to manage conflict scenarios more effectively.
- Added state management for unresolved conflicts during translation updates. - Displayed a warning banner to inform users of any unresolved conflicts that prevent updates. - Updated success message to reflect the number of successfully updated keys, excluding unresolved conflicts.
WalkthroughThe Push view now tracks and displays unresolved translation conflicts. When the update mutation completes, unresolved conflicts from the API response are stored and displayed in a warning banner, with the success count adjusted to exclude conflicting keys. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/ui/views/Push/Push.tsx (1)
365-437:⚠️ Potential issue | 🟠 MajorConflicted keys are still marked as locally connected with their new value.
After the mutation returns unresolved conflicts,
connectNodes()(line 434) is called unconditionally, which writesnewValueonto every matching node and setsconnected: true. For keys that appear inunresolvedConflictsthe server did not apply the new translation (it kept the protected/reviewed/disabled value), yet the plugin now records the new value as the node's translation. On the next push/diff,getPushChangeswill compare the stored new value against the server's unchanged value and either flag it as a fresh change again or, worse, treat it as already-pushed — effectively hiding the unresolved conflict from the user and causing persistent drift between Figma and Tolgee.Filter out conflicted (key, ns, language) tuples from the set passed to
connectNodes/setNodesDataMutation, e.g. keep those nodes' previous translation andconnectedstate so the diff continues to surface them.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/ui/views/Push/Push.tsx` around lines 365 - 437, The code calls connectNodes() unconditionally after a push, causing nodes for keys listed in updateResult.unresolvedConflicts to be marked connected and updated with the newValue even though the server rejected those changes; fix by filtering out conflicted (key, ns, language) tuples before updating node state: build a Set from updateResult?.unresolvedConflicts (use the same key/ns/lang shape the server returns), then when calling connectNodes or setNodesDataMutation (the functions that apply newValue/connected flags to nodes), exclude any node whose (key, ns, language) is in that Set so those nodes retain their previous translation and connected state and will still appear in subsequent diffs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/ui/views/Push/Push.tsx`:
- Around line 365-437: The code calls connectNodes() unconditionally after a
push, causing nodes for keys listed in updateResult.unresolvedConflicts to be
marked connected and updated with the newValue even though the server rejected
those changes; fix by filtering out conflicted (key, ns, language) tuples before
updating node state: build a Set from updateResult?.unresolvedConflicts (use the
same key/ns/lang shape the server returns), then when calling connectNodes or
setNodesDataMutation (the functions that apply newValue/connected flags to
nodes), exclude any node whose (key, ns, language) is in that Set so those nodes
retain their previous translation and connected state and will still appear in
subsequent diffs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 89a9239b-fd0a-45b2-a037-cddf0c2bc4f0
📒 Files selected for processing (1)
src/ui/views/Push/Push.tsx
Summary by CodeRabbit
New Features
Bug Fixes