Preserve group name on push + drop Iterator.from from OrderedSvelteMap#1160
Conversation
- import.go now reads group_name from the form so the CLI's workspace label flows through to the server. ensureBootstrapGroup only overwrites an existing group's name when one was explicitly provided, so a file→CMS push no longer clobbers e.g. "Clients" with the humanized group ID. - OrderedSvelteMap swaps Iterator.from (TC39 helpers, not in all runtimes) for plain generators. Also uses super.get inside the iterator to bypass reactive tracking during iteration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR preserves site group display names during bootstrap operations and refactors internal iteration logic. The bootstrap function now distinguishes between explicit name provision and ID-only calls, updating only the fields explicitly set. The import handler threads group display names into bootstrap calls for both site creation and sync. OrderedSvelteMap replaces its Iterator-based strategy with generator functions for consistent ordered traversal. ChangesImplementation Updates
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ 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)
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 |
Summary
site.yamlonly stores the group ID, so on a file→CMS push the server previously synthesized a name from the ID (humanizeGroupID) and overwrote whatever the user had set in the dashboard (e.g. clobbering "Clients" with "8Y17hao5jt2xmd8"). The CLI already sends the group's display name out-of-band asgroup_name;import.gonow reads it and threads it intoensureBootstrapGroup.bootstrap.goonly overwrites the existing group'sname/indexwhen those were explicitly provided.Iterator.from(...)with plain generators (*keys,*values, etc.) for runtime compatibility; usesuper.getinside the iterator to bypass reactive tracking during iteration.Test plan
OrderedSvelteMapiteration (for…of,forEach,.keys()etc.) still works on a runtime without Iterator Helpers.Summary by CodeRabbit
Bug Fixes
Improvements