Redesign map with full-screen layout, floating controls, and configurable CSP#108
Merged
antosubash merged 10 commits intomainfrom Apr 15, 2026
Merged
Redesign map with full-screen layout, floating controls, and configurable CSP#108antosubash merged 10 commits intomainfrom
antosubash merged 10 commits intomainfrom
Conversation
Deploying simplemodule-website with
|
| Latest commit: |
f5918fe
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8d0c3eb6.simplemodule-website.pages.dev |
| Branch Preview URL: | https://feature-heuristic-lumiere.simplemodule-website.pages.dev |
…figurable CSP - Rewrite Browse.tsx: map fills entire viewport, layers/basemaps are floating panels that expand over the map instead of a fixed sidebar - Add CspOptions to SimpleModuleOptions so modules can append extra origins to connect-src, img-src, worker-src, font-src, style-src - Remove committed screenshot files
The map page was previously constrained to the public layout's max-w-7xl container. Using fixed positioning below the nav (top: 57px) lets the map fill the full viewport width as intended. Also adds screenshots documenting the redesigned map UI.
Owner
Author
Screenshots — redesigned full-screen mapAll screenshots verified to show visible map tiles rendering correctly after the layout fix. 1. Default map — full-screen with all controls visible2. Layers floating panel (expanded from top-left button)3. Basemaps floating panel with reorder, delete, add, and fallback URL4. Basemap switched to OpenFreeMap Liberty (detailed vector tiles)5. Layer visibility toggled off (OSM raster hidden, only earthquake points visible)6. Layer removed (terrestris WMS deleted, 2 layers remain)7. Catalog management page |
- Pre-compute CSP strings at startup instead of rebuilding per request (removes 5 string.Join + 10 string concats per HTTP response) - Extract seed GUIDs into BasemapConfiguration.SeedIds and LayerSourceConfiguration.SeedIds; MapService now references them instead of re-declaring literal Guids - Collapse the 5 repeated MapBasemap constructors in the default-map seed into a single Select() over SeedIds.All - Replace two boolean panel states (layersPanelOpen, basemapsPanelOpen) with a single openPanel union so mutual exclusion is enforced by the type, not by manual else-branches - Literal … instead of \u2026 escape, drop obvious comments
The redesign removed the `Default map` h1 and the `[data-testid=map-side-panel]` wrapper; layers/basemaps are now floating toggle-able panels. Update the smoke tests and page object to match.
The fixed-positioned map previously used hardcoded top: 57px and left: 0, which worked for the public layout but was covered by the authenticated layout's left sidebar and had the wrong top offset for the mobile header. Measure nav/sidebar bounds at mount and on resize/sidebar-transition and apply them as top/left inset on the map container so the map fills the correct space in every layout.
The map controls relied on Tailwind utilities (top-3, bottom-3, left-3, right-3, top-14) that the host's incremental Tailwind build doesn't regenerate when only module .tsx sources change — when the CSS bundle is stale, all four controls fall back to position: absolute with no offsets and stack at the top-left, breaking CI smoke tests and the actual layout. Inline styles via CSSProperties don't depend on the Tailwind pipeline and keep the positioning correct regardless of how the host's CSS happens to be built.
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
CspOptionsso modules can add external origins without code changesChanges
Map page redesign (
Browse.tsx)Configurable CSP (
CspOptions)CspOptionsclass with lists forConnectSources,ImgSources,WorkerSources,FontSources,StyleSourcesCspproperty onSimpleModuleOptionsLayer builder fix (
layer-builders.ts)defined()helper to omit null/undefined keys from MapLibre source specsminzoom: undefinedvalidation errorsDefault map seed (
MapService.cs)Files changed
modules/Map/src/SimpleModule.Map/Pages/Browse.tsxframework/SimpleModule.Hosting/CspOptions.csframework/SimpleModule.Hosting/SimpleModuleOptions.csCsppropertyframework/SimpleModule.Hosting/SimpleModuleHostExtensions.csCspOptionsmodules/Map/src/SimpleModule.Map/Pages/lib/layer-builders.tsmodules/Map/src/SimpleModule.Map/MapService.csdocs/screenshots/Test plan
dotnet buildsucceedsnpm run buildsucceeds/map/layers) unaffected