feat(data): full-screen map view + shared MapScreenLayout component (#132) - #158
Draft
luandro wants to merge 2 commits into
Draft
feat(data): full-screen map view + shared MapScreenLayout component (#132)#158luandro wants to merge 2 commits into
luandro wants to merge 2 commits into
Conversation
Contributor
|
Preview deployment ready: https://agent-comapeo-cloud-app-issu-vugq.comapeo-cloud-app.pages.dev Commit: |
New component introduced in #132 ships 5 Storybook stories (default, non-interactive, with-bottom-buttons, with-sidebar, with-top-right) at both desktop and mobile viewports. These had no committed baseline, so the visual-regression-check reported 5 added and failed CI. Add the generated baselines so the check passes. Pre-existing baseline PNGs were intentionally left untouched (their drift was tooling noise, not code change).
Contributor
Author
|
We are missing on the data map view a layers button which should be placed right beneath the list button on the top right. The user should be able to easily change in between map layers to facilitate navigation. |
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
Closes #132. Two related changes to the Data screen map experience:
src/stores/view-mode-store.tsdefaultviewModechanged from'grid'to'map', so the Data screen opens in the full-screen map when a project has observations.MapScreenLayoutcomponent. The full-screen map shell (map canvas + overlay slots for top/bottom-left/right controls + a desktop sidebar) is nowsrc/components/shared/MapScreenLayout/so other screens can reuse it instead of re-implementing the same overlay pattern.DataScreen.tsxnow early-returns a full-screenObservationsMap(passed aschildrentoMapScreenLayout, which is a pure overlay shell — no nestedMapContainer) with overlay controls whenviewMode === 'map':topLeft— desktopObservationFilterBar(hidden md:block, mirroring the grid branch)topRight— grid-view togglebottomLeft— Filters button (mobile only, opens a FilterSheet)bottomRight— export observations buttonThe map branch renders regardless of observation count / pending state, so the map shows its own empty/loading overlay (no grid-chrome flash on cold load, no dead toggle when empty).
Changes
src/stores/view-mode-store.ts— defaultviewMode: 'map'.src/components/shared/MapScreenLayout/— new shared full-screen map layout shell (MapScreenLayout.tsx+index.ts+.stories.tsx+.test.tsx). Pure overlay: renderschildren+topLeft/topRight/bottomLeft/bottomRight/sidebarslots;sidebaris desktop-gated. No internalMapContainer.src/screens/DataScreen.tsx— early-return full-screen map branch (renders even when empty/pending); grid branch untouched.tests/unit/components/shared/MapScreenLayout/MapScreenLayout.test.tsx— 11 new tests for the shared component (slots, mobile/desktop sidebar).tests/unit/screens/DataScreen.test.tsx— updated for the newmapdefault + added map-view / grid-toggle tests (29 tests).tests/e2e/critical-flows.e2e.ts— seedsview-mode-preferencetogridin Flows 1 & 2 so the grid-asserting e2e specs keep passing now that the default is the map (fresh contexts rehydrate tomap).Verification
Local gates run independently (not trusting harness self-report):
npx tsc --noEmit— cleannpx vitest run(MapScreenLayout 11 + DataScreen 29) — 40/40 passnpx eslint <changed>— cleannpx prettier --check <changed>— cleannpm run extract-messages— noen.jsondrift (no new i18n keys needed)pre-pushnpm run validate(lint + coverage + build + i18n) — Full Validation PASSED on pushKimi K3 read-only review (loop-closed): VERDICT: PASS. All findings resolved across two review rounds:
view-mode-preference); Kimi re-ran the patched Playwrightcritical-flowssuite: 7/7 passed.topLeftObservationFilterBar); then the mobile-stacking regression from that fix was itself fixed (hidden md:blockwrap).observations.length > 0).Remaining notes
origin/main, not behind; noen.jsonclobber risk.mobile-data-observationslight/dark screenshot specs fail at HEAD onmaintoo (stalegetByRole('tab')locator from feat: #72 — Replace Data nav icon with map marker; extract Alerts into dedicated screen #108) — tracked separately.MapScreenLayoutnits (duplicate stories, tautological test assertion) noted by review as non-blocking; left as-is to keep the diff focused.🤖 Generated with Hermes Agent