Skip to content

fix(ui): follow-up fixes for the nested-drawer navigation UI #35

Closed

Description

@Ardnived

Summary

Follow-up fixes and polish for the nested-drawer navigation shell shipped in #31 (feat #30). Seven issues spanning drawer drag behavior, drawer/chrome spacing, the settings cog position, a stale-locale i18n bug, missing default theme colors on localhost, and inconsistent icon-box structure in DetailRow. Grouped into one ticket; each is tracked as its own acceptance-criteria block below.

Issues

1. Disable drawer dragging on tablet and larger (bug)

On ≥md, the drawer renders as a left-anchored panel (direction: 'left', src/views/DrawerStack/DrawerStack.tsx:132) but is still draggable with dismissible on and no snap points (snap props are only passed for bottom, src/views/DrawerStack/DrawerStack.tsx:279-282). Result: the panel can be dragged, the drop shadow doesn't track the drag, and a drag reads as a dismiss of the top-level drawer.

  • Expected: On ≥md (left direction) the drawer cannot be dragged at all — it can only be dismissed via the close button. No snap/drag affordance; the drag handle is hidden (handle already defaults to bottom-only, src/components/atoms/Drawer/Drawer.tsx:158).
  • Notes: Likely disable vaul drag for the left direction (e.g. gate dismissible/drag handling on direction === 'bottom') while keeping close-button dismissal working.

2. Reduce handle → header spacing on mobile (polish)

The gap between the drag handle and the header reads as too large on the mobile bottom sheet. Handle margin is my-3 (src/components/atoms/Drawer/Drawer.tsx:31); header padding is pb-2 pt-4 (src/components/atoms/Drawer/Drawer.tsx:25).

  • Expected: Tighter, visually balanced spacing between the handle and the first header row on mobile.

3. Reduce country-flag icon size on mobile and tablet (polish)

Country flags in the countries list are h-9 w-9 (src/views/CountriesView/CountriesView.tsx:64) — too large on mobile/tablet.

  • Expected: Smaller flags on mobile and tablet (responsive size), restoring balance with the row text.

4. Move the settings cog to the top-left (polish)

The settings cog is currently top-right on the map (fixed right-3 top-16, src/views/DrawerStack/DrawerStack.tsx:271) and bottom-right map-less (absolute bottom-3 right-3, src/views/DrawerStack/DrawerStack.tsx:233).

  • Expected: Cog moves to the top-left corner. On ≥md, it's offset so it does not overlap the left drawer panel (which sits at left-0, floating to left-4 at ≥lg). The dropdown alignment (align="end", src/components/molecules/SettingsMenu/SettingsMenu.tsx) should be revisited so the menu opens sensibly from a left-anchored trigger.

5. Language switch doesn't relocalize the current view (bug)

Toggling the language while viewing the countries list does not update country names to their localized form until you navigate to another view.

  • Root cause: useLocale (src/hooks/use-locale.ts:8-9) seeds a local useState from i18n.resolvedLanguage at mount and only updates through its own setLocale. So when SettingsMenu calls its instance's setLocale, other useLocale consumers (e.g. CountriesView's regionNames, src/views/CountriesView/CountriesView.tsx:21) keep a stale locale, so their Intl.DisplayNames never rebuilds.
  • Expected: Every useLocale consumer reacts to a language change. Fix by deriving locale from i18n.resolvedLanguage / subscribing to i18next's languageChanged event rather than holding independent local state.
  • Regression guard: Country names in CountriesView relocalize immediately on language toggle, with no view navigation.

6. Default "We Meditate" theme missing on localhost (bug)

Loading localhost shows a grey, un-themed UI instead of the default We Meditate teal/orange brand.

  • Context: When no client palette resolves (e.g. localhost, where the client color fetch is unavailable/empty), BrandTheme builds resolved with all roles undefined (src/config/theme/BrandTheme.tsx:34-40) and applyPalette clears the managed vars, expecting the static globals.css defaults to stand (src/config/theme/palette.ts:171-185). The observed grey suggests that fallback isn't landing.
  • Expected: When no per-embed or client palette is available, the widget renders the built-in default We Meditate theme (DEFAULT_SEEDS teal #82b1ae / orange #e08e79, src/config/theme/palette.ts:49) — not grey.
  • Notes: Implementer to confirm the actual cause (client record returning empty/neutral colors vs. the globals.css default not applying vs. fetch failure) and make the default palette the guaranteed fallback.

7. Give DetailRow a structured, always-square icon box (refactor)

The leading icon box in src/components/molecules/DetailRow/DetailRow.tsx:12-24 is a single w-11 h-11 slot whose contents are passed as free-form children, so it isn't reliably square and the two real box shapes aren't modeled.

  • Observation: There are only two kinds of box: (a) a framed single icon, and (b) a frame split in half with a small text line top and bottom (e.g. JUL / 14).
  • Expected: Model these two variants explicitly (e.g. an icon box and a stacked/split box) so the box is always square and consistent, and callers can't hand-assemble an off-spec box. Keep the existing tone variants (icon / highlight / plain).
  • Notes: Update the current callers (event detail cards, timing date badge) to the new API; keep DetailRow presentational.

Acceptance criteria

  • Drag: On ≥md the drawer cannot be dragged; it dismisses only via the close button. Dragging never dismisses the top-level drawer; the shadow no longer desyncs.
  • Spacing: Handle→header gap on the mobile sheet is visibly tighter/balanced.
  • Flags: Country flags are smaller on mobile and tablet.
  • Cog: Settings cog sits in the top-left; on ≥md it's offset clear of the drawer; the menu still opens and is usable.
  • i18n: Toggling the language relocalizes the current view immediately (verified on CountriesView), with no navigation required.
  • Theme: Localhost with no client palette renders the default We Meditate teal/orange theme, not grey.
  • DetailRow: Icon box is always square; the two box kinds (framed icon / split top-bottom text) are explicit variants; callers migrated.
  • Lint + typecheck + test:run + build pass.

Files affected

  • src/views/DrawerStack/DrawerStack.tsx — drag gating (1), cog position (4)
  • src/components/atoms/Drawer/Drawer.tsx — handle/header spacing (2), drag behavior (1)
  • src/views/CountriesView/CountriesView.tsx — flag size (3)
  • src/hooks/use-locale.ts — stale-locale fix (5)
  • src/components/molecules/SettingsMenu/SettingsMenu.tsx — cog menu alignment (4)
  • src/config/theme/BrandTheme.tsx, src/config/theme/palette.ts — default-theme fallback (6)
  • src/components/molecules/DetailRow/DetailRow.tsx — icon-box variants (7)

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Hold Until

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions