feat(ui): implement audit v4 phase 4 layer control and legend parity - #41
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
q2web-studio | b3fb84c | Commit Preview URL Branch Preview URL |
May 02 2026, 06:47 PM |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1b545346e8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function migrateLayerControlMode(value: unknown): "collapsed" | "expanded" | "tree" { | ||
| if (value === "collapsed" || value === "expanded" || value === "tree") return value; | ||
| if (value === "compact") return "collapsed"; | ||
| return "expanded"; |
There was a problem hiding this comment.
Default unknown layer control mode to collapsed in hydration
hydrateProject now forces mapSettings.layerControlMode from layerControlSettings.mode, but migrateLayerControlMode falls back to "expanded" for missing/invalid legacy values. This means older project JSONs that lack both fields are silently upgraded to expanded mode, which contradicts the new Phase 4 default (collapsed) and causes editor/runtime behavior to diverge from expected parity for migrated data.
Useful? React with 👍 / 👎.
|
@codex fixed the hydration default mismatch you flagged. Change made:
Verification rerun after the fix:
Fix commit:
Please take another look. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b1224fcf8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| function normalizeLayerControlMode(mode: LayerControlMode | "compact" | undefined): LayerControlMode { | ||
| if (mode === "compact") return "collapsed"; | ||
| if (mode && phaseCLayerControlModes.includes(mode)) return mode; | ||
| return "expanded"; |
There was a problem hiding this comment.
Default migrated layer control mode to collapsed
normalizeLayerControlMode still falls back to "expanded" when the incoming project has no mapSettings.layerControlMode, which means legacy projects that lack both layer-control fields are migrated to expanded mode. In this change set, Phase 4 defaults were switched to collapsed, and hydrateProject consumes the migrated value, so these legacy projects will still render/export with the wrong default unless this fallback is updated to collapsed.
Useful? React with 👍 / 👎.
|
@codex fixed the follow-up migration fallback you flagged in Change made:
Verification rerun after the fix:
Fix commit:
Please take another look. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 619eebc554
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var settings = config.layerControlSettings || {}; | ||
| var mode = settings.mode || legacySettings.layerControlMode || "collapsed"; |
There was a problem hiding this comment.
Persist layer control styling settings to runtime config
applyLayerToggle now depends on config.layerControlSettings, but buildRuntimeConfig (in src/lib/exportProject.ts) still serializes only mapSettings and does not include layerControlSettings. As a result, changes from the new controls (position/background opacity/text size/radius) are stored in project state but dropped from q2ws-config.json, so runtime preview/export silently falls back to defaults (for example top-right with default colors). Please serialize layerControlSettings (or otherwise carry these fields into runtime config) so editor and runtime stay in parity.
Useful? React with 👍 / 👎.
|
@codex fixed the runtime config persistence issue you flagged. Change made:
Verification rerun after the fix:
Fix commit:
Please take another look. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f0a29eec00
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <label key={layer.id} style={{ color: styleSettings.textColor, fontSize: styleSettings.textSize }}> | ||
| <input |
There was a problem hiding this comment.
Apply configured text size to layer label spans
The new "Control text size" setting does not actually change layer-name text in the editor preview because this code applies fontSize to the <label>, while preview CSS still forces .layer-toggle-preview span to font-size: 13px. In practice, any non-default text size will render incorrectly in the editor (while runtime uses the configured size), so users get a misleading preview. Apply the configured size directly to the row text <span> (and tree label spans) or remove the fixed span font-size rule.
Useful? React with 👍 / 👎.
|
@codex fixed the editor preview text-size mismatch you flagged. Change made:
Verification rerun after the fix:
Fix commit:
Please take another look. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18957bfb0b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .legend-preview.legend-top-right { | ||
| top: 82px; | ||
| right: 14px; | ||
| } |
There was a problem hiding this comment.
Offset editor top-right legend to match runtime layout
When legend placement is top-right and the layer control is also top-right, the editor preview keeps the legend at right: 14px, so it overlaps the control; runtime behavior in this same change offsets that case (#q2ws-layer-control... ~ #q2ws-legend... { right: 248px; }), so editor and runtime no longer match. This breaks the parity this feature is targeting for users configuring floating legend/control positions.
Useful? React with 👍 / 👎.
|
@codex fixed the editor top-right legend overlap you flagged. Change made:
Verification rerun after the fix:
Fix commit:
Please take another look. |
|
Codex Review: Didn't find any major issues. 🎉 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
@codex please review this Phase 4 layer control and legend styling work.
Summary
project.layerControlSettingswith mode, position, background color, opacity, text color, text size, and radius.collapsed,expanded,tree, with legacycompactmigrated tocollapsed.collapsedmode.Verification
npm run build: PASSnpm run smoke:fixture: PASSnpm run smoke:export: PASSnpm run smoke:map: PASS, 38 passednpx playwright test tests/map-render.spec.ts -g "phase 4": PASS, 4 passedEvidence
docs/screenshots/phase-4/npm-run-build-20260502-230526.txtdocs/screenshots/phase-4/npm-run-smoke-fixture-20260502-230526.txtdocs/screenshots/phase-4/npm-run-smoke-export-20260502-230526.txtdocs/screenshots/phase-4/npm-run-smoke-map-20260502-230526.txtdocs/screenshots/phase-4/npx-playwright-test-tests-map-render-spec-ts-g-phase-4-20260502-230526.txtdocs/screenshots/phase-4/editor-20260502-230526.pngdocs/screenshots/phase-4/editor-legend-bottom-right-20260502-230526.pngdocs/screenshots/phase-4/editor-legend-top-left-20260502-230526.pngdocs/screenshots/phase-4/runtime-preview-20260502-230526.pngdocs/screenshots/phase-4/runtime-20260502-230526.pngdocs/screenshots/phase-4/console-20260502-230526.txtdocs/screenshots/phase-4/network-tile-20260502-230526.jsondocs/screenshots/phase-4/phase4-export-20260502-230526.zipNotes