diff --git a/README.md b/README.md index 93004d4..5760948 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,14 @@ Built with React 19, Vite, MapLibre GL (through `react-map-gl`), deck.gl (`@deck - **Sea ports layer:** the bundled ports GeoJSON, drawn as green points. Click a point to see its properties. - **Heatmap layer (WebGPU only):** a two-pass compute shader bins airport positions into a 1024 x 512 grid and colorizes it into a bitmap overlay. It runs once, after the airports load. The layer toggle appears only after that compute succeeds, so it is hidden while airports load, when WebGPU is unavailable, and when the airports fetch or the compute fails. - **Stress test:** a slider from 0 to 5,000,000 points in steps of 100,000. Points are generated on the main thread 150 ms after the slider stops moving, then drawn as a deck.gl binary attribute layer. -- **GPU info panel:** adapter name, render tier (`WebGPU`, `WebGL Fallback`, or `Detecting...`), active point count, frame time with a 60-frame sparkline, compute throughput (a 64 MB storage buffer read and written once per second, reported in GB/s), and heatmap compute time. +- **GPU info panel:** adapter name, render tier (`WebGPU`, `WebGL Fallback`, or `Detecting...`), active point count, frame time with a 60-frame sparkline, compute throughput (a 64 MB storage buffer read and written once per second, reported in GB/s), and heatmap compute time. At 1024px wide or less it shows only the render tier, active point count, and frame time. On small screens (see below) it is hidden while a feature popup is open. +- **Small screens** (640px wide or less, or up to 1024px wide and 500px tall or less): the layer panel starts collapsed behind a "Sensor layers" button, the header drops the coordinates and status, and the feature popup opens as a bottom sheet. ## Requirements - **Node.js:** current LTS (CI uses `lts/*`). Vite 8 needs Node 20.19+ or 22.12+. - **Browser:** any browser with WebGL 2 for the map and point layers. deck.gl draws through WebGL; WebGPU is used only for compute. -- **WebGPU (optional):** needed for the heatmap and the COMPUTE readout. Use a browser and GPU where `navigator.gpu.requestAdapter()` returns an adapter, for example current Chrome or Edge on desktop. Without it the app still runs: the panel shows `WebGL Fallback`, the heatmap toggle never appears, and COMPUTE shows `--`. +- **WebGPU (optional):** needed for the heatmap and the COMPUTE readout. Use a browser and GPU where `navigator.gpu.requestAdapter()` returns an adapter, for example current Chrome or Edge on desktop. Without it the app still runs: the panel shows `WebGL Fallback`, the heatmap toggle never appears, and on screens wider than 1024px COMPUTE shows `--`. - **Network access:** the basemap style and tiles come from CARTO and the airports CSV comes from GitHub at runtime. The ports data is bundled. ## Setup from a clean clone @@ -62,7 +63,7 @@ src/ components/ MapView (MapLibre + deck.gl), LayerPanel, GPUInfoPanel, FeaturePopup config/ data URLs, layer ids, basemap style, MapLibre worker setup hooks/ data loading (useAirports, usePorts), WebGPU (useGPUCapabilities, - useGPUCompute, useGPUHeatmap), useStressPoints + useGPUCompute, useGPUHeatmap), useStressPoints, useMediaQuery layers/index.js buildLayers(): visibility and data to deck.gl layers store/mapStore.js zustand store: viewport, layer visibility, stress count, selection public/data/ports.geojson bundled ports data diff --git a/docs/plans/2026-11-07-issue-5-layout-breaks-on-mobile.md b/docs/plans/2026-11-07-issue-5-layout-breaks-on-mobile.md new file mode 100644 index 0000000..470434d --- /dev/null +++ b/docs/plans/2026-11-07-issue-5-layout-breaks-on-mobile.md @@ -0,0 +1,83 @@ +# Plan: Layout breaks on mobile: header text overlaps and panels overflow at 375px (issue #5) + +Risk tier: Medium. Responsive layout and a new collapse toggle are stateful UI that jsdom cannot lay out, so the layout is proven only by a live browser drive. It alters existing behavior (header, layer panel, popup, GPU panel) across several files, but touches no API, store contract, data, or security code. + +Domain skills: +- superpowers:test-driven-development: invoke. +- chrome-devtools-mcp:a11y-debugging: invoke for the live drive (toggle name, aria-expanded, focus ring, Tab order). +- frontend-design: not applicable because the user fixed the visual direction: keep the existing dark HUD look, only adapt it to narrow screens. +- vercel-react-best-practices: not applicable because there is no data fetching or render performance work; one small `useSyncExternalStore` media query hook. +- dataviz, django, fastapi, expo, payments, email: not applicable because none of that is touched. + +## Acceptance criteria + +1. At 375x812, 768x1024, and 1440x900, no text overlaps: the bounding boxes of the visible header elements (`.classification-badge`, `.header-status`, `.app-title`, `.coord-display`, `.time-display`, and visible `.header-sep`) do not intersect pairwise, and no visible text element in the header, layer panel, GPU panel, or popup is clipped (`scrollWidth <= clientWidth` for `.app-title`, `.stress-count`, `.layer-label`, `.gpu-info-panel`). +2. At those three sizes, no panel (`.app-header`, `.layer-panel`, `.gpu-info-panel`, `.feature-popup` when open) extends past the viewport: every rect has `left >= 0`, `top >= 0`, `right <= innerWidth`, `bottom <= innerHeight`. +3. At 375x812 with panels collapsed (layer panel collapsed, no popup), at least 60% of the viewport area is map not covered by the header, layer panel, or GPU panel: `(innerWidth*innerHeight - area(header) - area(layer panel) - area(gpu panel)) / (innerWidth*innerHeight) >= 0.6`. +4. At 375x812, every control is reachable by touch: the layer toggle button, each layer row, the stress slider, and the popup close button are visible, inside the viewport, and the topmost element at their center (`document.elementFromPoint`) is the control or its descendant. +5. The stress count readout fits "5.0M PTS" at every width (issue comment): with the slider at 5,000,000, `.stress-count` has `scrollWidth <= clientWidth` and its right edge is inside `.layer-panel`. +6. Narrow screens are those matching `NARROW_QUERY` = `(max-width: 640px), (max-width: 1024px) and (max-height: 500px)`: phones in portrait, and landscape phones and small tablets up to 1024px wide whose height is 500px or less (such as 740x360 and 568x320). Wide but short desktop windows such as 1440x480 or 1100x450 are wide. On narrow screens the layer panel is collapsed by default behind a toggle button in its header. The button is a native ` + ) : ( +
+ SENSOR LAYERS + +
+ )} - {layerList.map(({ id, label }) => { - const active = visibility[id] ?? true - return ( - - ) - })} +