Repository navigation
feat(ui): rework UI into a nested-drawer navigation system - #31
Merged
Merged
Conversation
Tints the page/panel surface in both modes from the seed's hue + capped saturation at the Radix app-background shade, instead of the previous light-only raw-seed override — so a near-black seed no longer blackens the panel and dark mode now picks up the themed surface. Pre-existing local change, preserved on this branch ahead of the drawer rework.
Vaul supplies the non-modal + nested + directional + snap drawer primitives for the URL-driven nested-drawer navigation rework. Pinned exactly; vaul is feature-complete but unmaintained (revisit only if a real bug surfaces). Refs #30 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
AC-0 (issue #30) proved vaul 1.1.2's nested + non-modal + directional + snap + container-portal combination composes. One gap surfaced: vaul never forwards its `modal` prop to Radix `Dialog.Root`, so Radix always runs modal — `hideOthers()` aria-hides the background and a trapped `FocusScope` seizes focus even when vaul `modal={false}`. On desktop the root drawer is always open, so the map would be permanently unreachable by AT + keyboard. Forward `modal` so `modal={false}` is truly non-modal. Verified via the spike (Playwright): map no longer aria-hidden, no `data-aria-hidden` markers, focus stays on the map, mouse-through preserved through 5 stacked drawers, and a map-click does not dismiss drawers. Pinned patch via pnpm patchedDependencies — the issue's pre-authorized vendored-fork mitigation. Refs #30 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The Drawer atom wraps vaul with tailwind-variants slots, portaling into the themed widget root via overlayContainer() (mirrors the Modal atom). Renders a root or `nested` drawer, directional (left ≥md / bottom on mobile), non-modal so the map/content behind stays interactive, with optional snap points for the mobile RootView. Sub-components: DrawerContent (portal + positioned panel + sr-only Radix title for a11y), DrawerHeader/Body/Footer, DrawerClose. vaul's stylesheet is vendored to src/styles/vaul.css (its package `exports` map doesn't expose ./style.css, so it can't be @import-ed by specifier) and pulled into globals.css — it supplies the slide/snap transforms without which snap sheets render off-screen. Corrected one upstream CSS typo. Verified in Ladle (Playwright): full-height themed left panel at ≥md, mobile bottom-sheet, nested stacking, interactive background. Refs #30 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Replace the single floating Panel + Modal model with a drawer stack that is a pure function of the pathname (issue #30): - resolveStack(pathname) returns the full ancestor chain; DrawerStack renders RootView (non-dismissable base) + one nested vaul drawer per entry. No drawer-stack store, no PUSH/POP interception — dismissing a drawer is just navigate(parentPath), so the router's history is the stack. - src/views/ (RootView, SearchView, RegionView, EventView, RegistrationView, ShareView) replaces src/pages/. Left panels at >=md, bottom sheets on mobile. - MapController seam (real + no-op) centralizes camera framing; views call it unconditionally so none branch on whether a map exists. - Reserved-slug guard (search/register/share + legacy events/areas) so a CMS region can never shadow a routed view; register/share are deep-linkable. - Drop canonicalization redirects — the address bar follows navigation; canonical/og:url are standalone-only (WidgetMode context). - Rename organisms/EventView -> EventDetails and molecules/Navbar -> Toolbar (drawer footer). De-Modal RegistrationForm. Remove SearchBar, Panel, Modal, List/ListHeader, src/pages, src/layouts, and the dead useNavigationState store. Fathom pageviews are deduped per pathname. lint + typecheck + 118 tests green. Refs #30 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The map div's viewport-unit / inset Tailwind utilities weren't generating CSS, so the container measured 0x0 and Mapbox fell back to a 400x300 canvas. Use an inline fixed/inset style so the map reliably fills the viewport behind the drawers, independent of utility generation. Verified in the running app: full-viewport basemap, RootView drawer + a nested RegionView drawer over it, map interactive behind (non-modal). Refs #30 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Add the map=false axis (issue #30): - Rename the custom element <syatlas-map> -> <sahaj-atlas> (mode-agnostic); vite styleId + demo.html updated. Standalone #syatlas mount id unchanged. - <sahaj-atlas map="false"> and standalone ?map=0 both render content-only (no MapProvider/Mapbox, no token); MapController is the no-op impl so no view branches on the map flag. Default on both surfaces is the full map. - Map-less: RootView renders inline (filling the widget container); deeper views are `contained` drawers (absolute, portaled into the container). The WidgetMode context carries standalone + hasMap. - Viewport audit: drop the dead window scroll/resize padding effect and the #syatlas-main DOM-measuring updatePadding (padding is the MapController's job); the 100dvh height stays gated to the standalone build. Verified running (?map=0): no map canvas, inline base, a contained drawer portaled into the widget container. Refs #30 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
… draft - Add the missing UI strings (common: back / search / error.*; events: registration.register_for, details.share_event) to the en fallback locale. - useIsDesktop() debounces the md crossing so a viewport resting near 768px can't thrash-remount the drawer wrapper (vaul direction isn't hot-swappable). - Hoist in-progress RegistrationView form values into a draft store (read once and persisted via getState() to avoid a watch<->store loop) so the md-crossing remount can't drop a half-filled form; cleared on submit. Refs #30 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Bring CLAUDE.md, DESIGN_SYSTEM.md, and the affected .claude/rules + docs in line with the shipped architecture: the <sahaj-atlas> element name, src/views/ replacing src/pages+layouts, the Drawer atom replacing Modal, Toolbar replacing Navbar, the resolveStack-driven navigation model (no drawer-stack store), and the MapController seam (real + no-op) for map vs map-less. Rewrites .claude/docs/architecture.md's data-flow diagram and layer table to match. Refs #30 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Four parallel reviews (reuse/simplification/efficiency/altitude) over the full branch diff. Applied: - shared.tsx: useFrameOnTop(isTop, frame, deps) replaces the identical `if (isTop) frame...()` effect duplicated across all 6 Views. - shared.tsx: ViewFooter (<DrawerFooter><Toolbar/></DrawerFooter>) replaces the same two lines repeated in all 6 Views. - shared.tsx: useEventFromPath(eventPath) replaces the duplicated resolvePath+useSuspenseQuery boilerplate in RegistrationView/ShareView. - shared.tsx: DrawerLoading/DrawerErrorFallback now compose Spinner/Alert the same way the top-level Fallbacks.tsx does, instead of hand-rolled markup — the error fallback now renders as a proper danger Alert, not a bare <p>. - DrawerStack.tsx: memoize resolveStack(pathname) so it doesn't re-parse the URL into the full stack on every render. - App.tsx: memoize the allowedDomains->primaryDomain derivation. Declined (documented, not applied): - Threading EventView's already-fetched Event down to RegistrationView/ShareView as a prop instead of useEventFromPath's own query: TanStack Query dedupes by the shared ['event', id] key, so there's no real duplicate network fetch — just a second subscription. The prop-threading would need EventView's children contract to change from plain ReactNode to a render-prop, a broader structural change for a benefit that's mostly already free. - A generic ViewFrame/DrawerShell wrapping header+body+footer: each view's header differs too much (search field vs. back+title vs. none) for a shared shell to reduce duplication without a pile of optional slots. - Deriving renderEntry's parentPath via lib/shape's parentOf(path) instead of entries[index-1].path: RESERVED_SLUGS causes some URL segments (legacy events/areas prefixes) to have no stack entry, so entries[] indices don't align 1:1 with URL segments — parentOf(entry.path) would compute the wrong parent for those legacy URLs (e.g. '/events' instead of '/' for '/events/507'). The index-based derivation is the correct one. - Extracting DrawerStack's recursive renderEntry into a memoized component: no demonstrated re-render problem (MapController's context value is already memoized; recursion depth is small), so the added indirection isn't justified. - Debouncing the RegistrationView draft-store writes on every keystroke: the store has no reactive subscribers (read only via getState()), so the writes are cheap and don't trigger re-renders — not a hot path. - Altitude review found no issues: the hasMap seam is correctly scoped to use-map-controller.tsx + DrawerStack.tsx only, and the vaul patch fixes the one dropped prop at its source with no compensating workaround elsewhere. Verified: lean gate green (118 tests); re-checked in the running app — the region-not-found fallback now renders as a themed Alert instead of plain text. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Code review (single high-effort pass over the branch diff) found that resolveStack derives a register/share entry's eventPath from the raw preceding URL segment without checking it resolves to an event — a hand-typed `/india/register` would reach useEventFromPath with a region path, which fell through to useSuspenseQuery(['event', NaN]) and fired a live getEvent(NaN) request. Only reachable via a hand-typed/bookmarked URL (the app itself never constructs one), but real: throw a clear error before the query fires so DrawerErrorFallback renders immediately instead of round- tripping a doomed request. Also: document the dormant resolvePath/resolveStack RESERVED_SLUGS inconsistency (currently unreachable — every caller passes an already- derived entity path) so a future reuse doesn't reintroduce it silently, and fix a stale comment in organisms/index.ts referencing the deleted pages/event.tsx + old EventView path. Findings reviewed and not changed (documented in the review, not applied): - A transient container=null vs undefined portal-target gap on the very first paint of a map-less deep link below the root — self-heals on the ref-triggered re-render before paint; fixing would add render-order complexity for an unmeasured one-frame edge case. - Fathom recording the literal (non-canonicalized) pathname now that the canonicalization redirects are gone — an accepted tradeoff of the issue's explicit "no canonicalization redirects" acceptance criterion, not a bug. - The pre-existing (PR #29, not this branch) unused `region.parentPath` zod field — out of scope for this diff. Refs #30 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ints, handle) Follow-up tweaks on the #30 drawer-nav branch: - Tailwind `content` still globbed the removed pages/ + layouts/ dirs and never scanned src/views/, so any utility used only in a view went ungenerated — the RootView country flags fell back to the img{height:auto} reset and ballooned to 272px. Scan ./src/** instead; flags now honor h-9 (~2x the label text). - Drop the default DrawerBody padding so list rows sit flush (cards carry their own px-6); RegistrationView/ShareView opt back in with p-4. - Replace the custom BackButton with a vaul DrawerClose (CloseIcon) in the conventional top-right position; DrawerStack's onOpenChange still routes to the parent, so parentPath drops out of the views that only used it for the button. - Mobile snap points were strings ('8rem','0.5','0.97'); vaul parseInts a string as px and reads only numbers as fractions, so they resolved to ~8px/0.5px/0.97px and the sheet sat off-screen and jumped on any interaction. Use ['128px', 0.5, 0.97]. - Give the drag handle vertical margin (my-3) so it isn't flush to the sheet edge. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…polish Rework the drawer stack from real nested vaul drawers to a single drawer holding the active (top) view, with ancestors simulated as static peek cards behind it. Real nesting rendered every level at the same position (child fully covering the parent) and fought vaul on non-dismissable parents, synced peeks and a single snap ladder; simulating parents makes all of that fall out naturally. - DrawerStack: one vaul Drawer for the top view; parents are PeekStrips portaled behind it, offset by depth so a sliver peeks out (above the sheet on mobile, beside the panel on desktop) and tracks the active snap. Clicking a strip pops straight to that ancestor. - Snap ladder (mobile): ['96px', '300px', 0.97] — handle+title peek / lower third (title + a list row + a peek of the next) / near-full. Sheets are now full viewport height (h-[100dvh]); vaul derives its snap translate from the window height, so a content-sized sheet was pushed off-screen. 3dvh bottom padding keeps the footer above the fold at the 0.97 snap. - RootView is dismissable like every other view; dismissing the base collapses to a floating "Explore" reopen button (map mode only — map-less has nothing to reveal). - Drawer atom: drop the now-unused nested/NestedRoot path; add a `full` variant so the map-less panel fills its container as a real vaul root (close button still works); grab cursor on the handle; one drawer type keeps the handle consistent. - Search field is full width (flex-1 beside the close); remove the footer from Registration/Share; cap the registration form at max-w-md. Verified in-browser across map desktop, map mobile and map-less. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…cestors Follow-up on the simulated-parent drawer nav: - Rename RootView -> CountriesView for clarity (it's the country list). - One uniform code path for every view: dismissing navigates to the parent, and the one view with no parent (CountriesView) collapses to the peek snap instead of closing. Drop the dismissed state, the hasMap-gated close, and the "Explore" FAB entirely -- the panel never fully dismisses, so there's nothing to reopen. - CountriesView's header is now the search field + a stacked-list toggle (no close button): the toggle collapses the open list to the peek and expands it back, so the peek (smallest snap) is just the search bar + list icon. Search still opens SearchView. The toggle hides where there's no snap ladder (desktop / map-less). - Ancestors now render as semi-transparent panels (opacity fading with depth) stacked behind the active sheet, so the stack reads as fading cards over the map rather than two separate drawers. They mirror the sheet's live top via a --sy-sheet-top CSS variable updated each animation frame, so they track a drag with no lag (previously they only moved once the snap settled). - Add a ListIcon. Verified in-browser: desktop + mobile, drag tracking, collapse toggle, map-less. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…loating panel - Make the vaul sheet persistent: DrawerStack renders one DrawerContent and the views are just its inner content (header/body/footer fragments). Navigating no longer remounts/re-slides the drawer -- previously a view-type change remounted Vaul.Content and vaul replayed its open animation, so opening some views slid in and dismissing one slid the parent back in "as if newly opened". Now every transition is a quick content cross-fade (framer-motion AnimatePresence, popLayout), consistent across all views. CloseButton dismisses via the control seam (a navigation) instead of vaul's Close, so the sheet stays put. - Desktop: the drawer floats with a 1rem margin (map visible around it) and rounded corners matching the stacked ancestor panels; those panels round + inset to match. - Halve the stacked ancestor peek thickness (mobile 8px, desktop 6px). - Views drop the now-unused children prop; the persistent DrawerContent carries a single generic dialog title. Verified in-browser: mobile (no slide on open/back, cross-fade, collapse), desktop (floating + rounding + stacked peeks, event view), map-less. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…eek stack - Region events fell back to a flat `/<id>` path (an event's webPath is null), so opening one dropped the region ancestry and stacked it straight on the country list. Nest each region event under its region path (`<region>/<id>`) so the URL -- and thus the peek stack -- keeps the full country -> region -> city -> event chain. - EventDetails title drops its extra `pl-5` (only applied when the event has no image), which had indented it past the rest of the event content. - Peek strips are framer-motion elements now: they ease out to make room as the stack grows (a new panel enters from under the sheet, existing ones slide further out) and reverse on close, instead of a strip popping in/out. Mobile keeps the live rAF sheet tracking on `top`; only the depth offset (transform) animates. Verified in-browser (desktop + mobile): event opens with full ancestry + back, title aligned, strips slide on push/pop. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…escription polish - Share/Registration headers are now the static "Share Meditation" / "Register for Meditation" (drop the interpolated event title); the i18n keys are renamed to match. - RegistrationView shows a compact event summary (title, address, recurrence) above the form so the core details stay in view while filling it out. - Tighten the event description line-height (leading-snug). - Remove the "More info" label + chevron from the event cards (the whole card is already the link). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…flush drawer - Mobile stacked-peek 8px -> 5px (~37% thinner). - Give the drawer the same divider border as the ancestor peek panels. - Make the close control more subtle (muted gray, slightly smaller); the CountriesView header toggle shows the list icon at the peek and the close icon once opened past it. - Drop the floating margin on tablet: md-lg is flush + square, only >=lg floats + rounds -- for the drawer and the peek strips alike. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…opdown Replace the drawer footer (Sahaj Atlas wordmark + LanguageSelector + ThemeSwitch) with a floating cog that opens a Radix DropdownMenu: - Two rows -- language and colour mode -- each an icon + the current choice, opening a submenu (RadioGroup) to change it. Built on @radix-ui/react-dropdown-menu for a clean menu + submenu flow. - Theme gains an "Auto" option: the preference (light/dark/auto) is stored and, when auto, resolves to prefers-color-scheme and re-applies on system change. The resolved class on the root stays the single source of truth for NextUI/Tailwind/Mapbox. - use-theme exposes useThemePreference (preference + setPreference) alongside the existing resolved useTheme; getInitialTheme/initTheme resolve an 'auto' preference. - Remove ViewFooter + the Toolbar/LanguageSelector/ThemeSwitch molecules. Add a cog (SettingsIcon) + MonitorIcon and the settings/theme.* i18n labels. - The cog floats top-right below the geolocate control (map mode) / bottom-right of the container (map-less); the menu portals into the themed root. Verified in-browser (desktop): dropdown, both submenus, Auto persists + resolves to system + relabels, language en/fr, footer gone. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Drop the vestigial `isTop` param (always true) from the 6 drawer views and
`useFrameOnTop` — only the top view renders, so each frames the map on mount.
- Add a `childRoute` path helper (inverse of `parentOf`) and use it in the
region-events fetcher instead of composing the path inline.
- Extract the shared header icon-button className in views/shared.
- Move PeekStrip's left geometry to responsive Tailwind classes (mirroring the
Drawer atom) and drop the `margin` prop / `stripMargin` / `DESKTOP_MARGIN` /
`useBreakpoint('lg')`.
- Cache the vaul sheet lookup in the rAF loop instead of re-querying every frame.
- Remove the dead `inline` DrawerContent fallback (slot + context field + branch).
- `useTheme` returns only `{ theme }` (drop unused `isDark`/`isLight`).
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The 'auto' preference engages a module-level matchMedia('change') listener that
was never released, so a torn-down embed (a host SPA unmounting the widget on a
route change) kept firing the callback against a detached wrapper — or the host
page's <html>. Disengage it in BrandTheme's unmount cleanup, alongside releasing
the theme root, via a new stopSystemWatch() export.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
SearchView parsed ?bbox with a raw split().map(Number) cast while ?center was finiteness-checked, so a malformed/truncated hand-typed bbox fed NaNs into frameSearch → fitBounds (where Mapbox can throw). Add parseBounds to require four finite numbers, else fall back to the centre/reset like center already does. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Deploying atlas-legacy with
|
| Latest commit: |
098fe7a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f49c5c0d.syatlas.pages.dev |
| Branch Preview URL: | https://feat-nested-drawer-nav.syatlas.pages.dev |
This was referenced Jul 11, 2026
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
Reworks the widget's entire navigation into a URL-driven drawer stack, replacing the old pages/panels/modal/navbar UI. The map is now the persistent backdrop and all content lives in one vaul drawer whose contents are a pure function of the pathname.
<sahaj-atlas>+ map-less mode — the element renders content-only whenmap="false"(no Mapbox, no token), filling its container.Changes
src/views/— replacessrc/pages/+ the removed Navbar/Panel/Modal/SearchBar/ListHeader.DrawerStackrenders RootView-equivalentCountriesView+ one dispatched top view;resolveStack/parentOf/childRoute(src/lib/shape/path.ts) derive the open drawers from the URL. No drawer-stack store — dismissing isnavigate(parentPath).src/components/atoms/Drawer/— new vaul-based Drawer atom ([email protected], pinned + patched to forwardmodalto Radix for true non-modal a11y).src/hooks/use-theme.ts— new light/dark/auto preference layer over the existing resolved-theme signal (systemmatchMediaresolution + watcher), consumed by the settings menu.src/components/molecules/SettingsMenu/— new RadixDropdownMenu(language + theme submenus); the oldToolbar/LanguageSelector/ThemeSwitchare removed.MapControllerseam — views calluseFrameOnTop(...)unconditionally; the no-op provider handles map-less.Verification
pnpm lint)pnpm typecheck)pnpm test:run)pnpm build+ladle:build)Manual / visual verification
The node-only unit lane can't cover drawer animation, snap points, or map framing — verify in-browser:
/country/region/event/{register,share}restores the full stack.map="false") — one contained drawer fills the widget with the cog anchored bottom-right.Notes for reviewer
/simplify(commit80e9cd1) dropped a vestigialisTopparam across all views, added thechildRoutehelper, moved PeekStrip geometry to CSS, and removed deadinlineDrawerContent code./code-review(high) found no Critical/High/Medium; two Low items were fixed: the system-theme watcher leak on widget teardown (ed22468) and?bboxfiniteness validation (098fe7a).childRoute/safePath/resolveStack, the DOMPurify config, host color props, theme localStorage, and the two new deps (@radix-ui/react-dropdown-menu,vaul+ its benign one-line patch) all confirmed safe. Three pre-existing, out-of-scope items were deferred (none introduced by this branch, none an XSS path): links withtargetlackrel="noopener"in the description sanitizer; regionwebUrlisn'tSafeUrlSchema-validated (sink is a non-executable<link rel=canonical>); and a deadbasePathprop onWidgetProps. Worth a follow-up ticket.Closes #30
🤖 Generated with Claude Code