feat(preview): implement audit v4 phase 6 preview architecture - #43
Merged
Merged
Conversation
Contributor
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
q2web-studio | ec28d39 | Commit Preview URL Branch Preview URL |
May 03 2026, 03:18 AM |
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.
Phase 6, Preview architecture
Summary
This PR closes Audit V4 Phase 6 by replacing blob iframe Preview with a Service Worker backed
/preview/{token}route, restoring strict main app CSP, and aligning editor plus runtime initial view behavior with the original qgis2web export.@codex please review this Phase 6 preview architecture work.
Changes
public/q2ws-preview-sw.js, add virtual preview asset server with scoped preview CSP, TTL pruning, publish and evict lifecycle, and same origin routed preview assets.public/_headers, remove temporary blob iframe CSP relaxation from the main app after preview no longer depends on blob URLs.src/lib/previewBridge.ts, add publish and evict bridge withMessageChannelreadiness handshake.src/lib/runtimePreview.ts, publish exported ZIP entries directly to the preview route instead of rewriting assets into blob documents.src/components/PreviewOverlay.tsx, handle routed preview lifecycle, cleanup, rebuild failure stale state eviction, and runtime tab open flow.src/types/project.ts,src/lib/defaults.ts,src/lib/qgis2webParser.ts,src/components/mapCanvasHooks.ts,src/runtime/runtime.ts, addexport-originalinitial view parity and preserve original center when available.src/components/Inspector/ProjectMapTab.tsx, addMatch qgis2web export viewreset action.tests/map-render.spec.ts, add Phase 6 coverage for preview route, strict main CSP, export-original bounds parity, and preview reopen stability.Evidence
docs/screenshots/phase-6/npm-run-build-20260503-100734.txt, PASSdocs/screenshots/phase-6/npm-run-smoke-fixture-20260503-100734.txt, PASSdocs/screenshots/phase-6/npm-run-smoke-export-20260503-100734.txt, PASSdocs/screenshots/phase-6/npx-playwright-phase-6-20260503-100734.txt, PASS, 4 passeddocs/screenshots/phase-6/editor-20260503-100734.pngdocs/screenshots/phase-6/runtime-preview-20260503-100734.pngdocs/screenshots/phase-6/runtime-20260503-100734.pngdocs/screenshots/phase-6/console-20260503-100734.txt, 0 errors, 1 imported plugin deprecation warningdocs/screenshots/phase-6/network-tile-20260503-100734.json, 36 ArcGIS tile resource entries observedParity sweep
export-originalinitial view for qgis2web parity.Notes
allow-same-originintentionally because the qgis2web runtime and relative asset fetches need same origin behavior under/preview/{token}.unsafe-evalfor compatibility with preserved qgis2web measure plugin code. This allowance is limited to Service Worker preview responses, not the main app CSP.../AGENTS.MDand../docs/agents/changelog/2026-05.md.