fix(maplibre): keep credits from every replaced attribution control - #913
Conversation
Only the first replaced control's `customAttribution` carried over, so a second attribution control lost its credits while the component was mounted. The credits of all replaced controls are now merged.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
🤖 MERGED
GitHub merged this pull request. No material findings were recorded. 10a04fb8-081c-458d-8ba1-60b2be148ce7 |
📦 Package Size✅ No notable size changes 📚 22 runtime dependencies (no change) All tracked output (25)
Runtime dependencies (22)
Baseline: main_@_c9d0bcc5___2026-09-16 · gzip is the comparison metric · changes below 16 B gzip are ignored |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughThe MapLibre attribution control now merges Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The attribution changes preserve inherited credits, deduplicate them, honor component overrides, and restore replaced controls; no merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
🔗 Linked issue
Follow-up to #910. This addresses the CodeRabbit finding posted on #910 two seconds after it merged.
2.0.0-beta.8shipped without this fix.❓ Type of change
📚 Description
<ScriptMapLibreAttributionControl>replaces everyAttributionControlon the map. It copiedcustomAttributiononly from the first replaced control.If a map had a second attribution control with its own credits, those credits disappeared while the component was mounted. Unmounting restored them.
The component now merges the
customAttributionvalues of all replaced controls, without duplicates. AcustomAttributionset on the component still replaces them.A single inherited string now reaches MapLibre as a one-item array. MapLibre renders both forms the same way.
✅ Verification
test/nuxt-runtime/maplibre-controls.nuxt.test.tsfailed before the fix (1 failed | 14 passed) and passes after it (15 passed).pnpm lint: 0 errors.pnpm typecheck: exit 0.Test Files 118 passed,Tests 1217 passed | 6 skipped | 3 todo,Type Errors no errors.test/e2e/maplibre.test.tsandtest/e2e/maplibre-hydration.test.ts:Tests 10 passed (10).Non-breaking.