refactor(map): unify layer toggle definitions into shared catalog#943
Merged
refactor(map): unify layer toggle definitions into shared catalog#943
Conversation
DeckGLMap and GlobeMap maintained independent hardcoded layer arrays (~80 inline entries + 28-entry array) that drifted on labels, order, and variant support. Adding a layer required editing 3+ places. - Create map-layer-definitions.ts with LAYER_REGISTRY (37 keys), VARIANT_LAYER_ORDER (4 variants), renderer gating, and i18n helpers - Replace DeckGLMap 4-branch if/else (~72 lines) with catalog call - Replace GlobeMap hardcoded array with catalog call, add i18n header and variant awareness (globe now respects SITE_VARIANT) - Add 5 missing happy-variant i18n keys to en.json - Remove 3 redundant dayNight guards in GlobeMap (catalog gates via renderers: ['flat'])
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/config/map-layer-definitions.ts— single source of truth for all 37 map layer toggle definitions, with renderer gating (flat/globe), variant ordering, and i18n resolutionen.jsonSITE_VARIANT(tech/finance/happy show variant-relevant layers only)dayNightguards in GlobeMap (catalog handles exclusion viarenderers: ['flat'])Net: -85 lines removed from components, one file to edit when adding layers.
Test plan
npx tsc --noEmitpasses (0 new errors; 3 pre-existing globe.gl/three type errors unchanged)dayNight)dayNightabsent from globe toggles, present on flat