[v2] Fix: Keep ArrayField in sync after array replacement - #2356
Conversation
Replacing an array with another array of the same length updated form state without rerendering ArrayField. Bump the shared array version for direct replacements while keeping nested field updates isolated. Co-Authored-By: OpenAI Codex <noreply@openai.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change centralizes ChangesArray version tracking
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Array replacements and nested updates retain the intended rendering behavior, so the change is ready to merge after normal checks. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the code change and its motivation, but it does not use the required Changes, Checklist, or Release Impact sections. It also does not confirm the required local tests or changeset status.
✨ 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 |
|
View your CI Pipeline Execution ↗ for commit 17d23c9
☁️ Nx Cloud last updated this comment at |
LeCarbonator
left a comment
There was a problem hiding this comment.
Noticed a small correctness bug, but apart from that, looks good! It might change a bit in the future to make the work of the adapters a bit easier, but that's not a concern atm. Thanks for the fix!
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #2356 +/- ##
========================================
Coverage ? 95.20%
========================================
Files ? 113
Lines ? 4383
Branches ? 990
========================================
Hits ? 4173
Misses ? 200
Partials ? 10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ArrayFieldonly reacts to array length and_arrayVersion, so replacing an array with a different array of the same length updated form state without rerendering the array container. UI rendered from the array could stay stale while submission used the new values.This bumps
_arrayVersionfor direct same-length replacements. Array helpers now rely on length changes or this shared behavior instead of manually updating the version, while nested field updates still avoid rerendering the parentArrayField.Summary by CodeRabbit
Bug Fixes
Tests