Skip to content

fix: UI bug sweep — colour system, time filter, event & registration surfaces, i18n & nav - #74

Merged
Ardnived merged 33 commits into
mainfrom
fix/bug-sweep
Jul 25, 2026
Merged

Ardnived merged 33 commits into
mainfrom
fix/bug-sweep

Conversation

@Ardnived

@Ardnived Ardnived commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A batched sweep of spot-fixes and UI improvements across the widget, on one branch. Alongside the earlier list / nav / i18n / registration fixes, this branch also lands a color-system refactor, a new time-of-day filter, and a round of component/story polish. User-facing outcomes:

  • Color system — every control moved to four brand roles (primary / secondary / contrast / neutral) driven by a runtime palette engine (seed hex → 12-step ramp → CSS vars). A new themeable contrast role (from the tenant's color3); solid buttons darkened in light mode for guaranteed white legibility even on pale seeds; the page background is no longer tenant-themed (fixed surface). bordered controls now outline in the icon/text colour (1px labelled, 1.5px icon-only).
  • Time-of-day filter — the two-handle hour slider became a Morning / Afternoon / Evening / Night multi-select. The form shows the covered times beneath the toggles and the active-filter pill shows the times (e.g. "6:00 AM – 5:00 PM"), not the period names.
  • Event surfaces — a shared EventChips molecule (type · language(s) · Today) backs both the list card and the event header, so the two can't drift. The image carousel moved below the description and is full-bleed with native Swiper bullets; the "Free" pill became a RegistrationView subtitle.
  • Registration — the starting-date field is a radio list (new reusable RadioGroup atom, collapse / "show more") whose labels read in the class's own cadence (weekly "Next week / In 2 weeks", daily "Today / Tomorrow", monthly "This month / Next month").
  • Nav & i18n — country names resolve again after the CMS slug→ISO migration (uppercased for the case-sensitive Intl.DisplayNames); a merge-artifact useNavigate is not defined crash on region entry is fixed; RegionView gains a header search shortcut; header control labels (search/back/close/explore/settings) localized across all 10 locales.
  • List & controls — event cards left-align and no longer show host-page bullet markers; icon-only buttons stay square under flex compression; the IP-geolocation prompt only dismisses on × (not when followed).
  • Renames & structure — the IP-geolocation feature renamed nearby* → geolocation* (component + src/lib/geolocation.ts logic); EventPinPopover inlined into Map.tsx (it's inherently map-bound); DynamicEventsList split from the presentational EventsList; the Mapbox/story files consolidated.

Verification

  • Lint: ✓ (pnpm lint, --max-warnings 0)
  • Types: ✓ (pnpm typecheck)
  • Tests: ✓ Unit lane green — 380 tests (pnpm test:run)
  • Build: CI runs the production build + ladle:build

Reviews run in this finalize pass:

  • /simplify (4 parallel agents) — applied one altitude fix: EventPinCard now shares composeCalendarLine's recurrence/hasNext gating via a new calendarLineParts helper, restoring the feat(map): show recurrence + time popover on event pin hover #72 "popover and list card can never drift" contract the inline-into-Map change had forked; plus removed the dead filters.time.start/end locale keys and a stale comment.
  • /code-review (high effort, dispatched subagent) — clean; traced the time-period matching / merge / midnight-wrap / URL codec branch-by-branch (correct), confirmed all 10 locales complete and every rename/removal fully propagated. One story-label nit fixed (a contrast Link still read "Danger").
  • Security review (host-prop → palette CSS-var sink) — clean. Host/tenant colour strings are parsed to numeric HSL channels (colord) before reaching a CSS-var value; setProperty stores a value, not raw CSS; invalid seeds fail closed to the static default. No new HTML sinks, no dependency/auth/secret/env changes; the reflected timeOfDay URL param is allowlist-validated.

Manual / visual verification

Driven in Ladle + the running widget (Playwright) during development:

  1. Time-of-day filter: selecting Morning+Afternoon shows "6:00 AM – 5:00 PM" under the toggles and on the active pill; night wraps midnight; all-four reads "Any time".
  2. Palette: primary renders SY teal, secondary the soft blue; solid CTAs are dark with white text; bordered outline matches the glyph colour.
  3. EventChips render on the list card (compact) and event header (default); carousel sits below the description, full-bleed with round Swiper bullets.
  4. Registration: weekly class shows "Next week / In 2 weeks …" + "Show more dates"; header subtitle "All classes are free".
  5. Country list shows names not codes; RegionView header search → /search; header labels translated at ?locale=fr.

Notes for reviewer

  • Noted follow-ups (deliberately out of this branch's scope — they touch files this branch never edited): the Slider atom is now unused (kept as a design-system primitive; tree-shaken); statusChip + its chip_full/starts/started/ended locale keys are dead after the EventChips extraction (they live in the untouched use-event-display.ts / events.json); the background palette role is dead-but-safe (confirmed unreachable and non-exploitable by both the simplify and security agents). Left for a focused follow-up rather than expanding this already-large branch.
  • All-four-periods time selection is an active-but-no-op filter (the pill reads "any time"); intentional and coherent — not normalized to empty, so the user's four toggles stay visibly selected.
  • The primary/secondary/contrast solid button is intentionally darker now (step-12 bg + literal white text) to guarantee legibility on pale tenant seeds — a conscious visual change, not a regression.
  • Commit signing: several commits used --no-gpg-sign (the SSH/1Password agent's passphrase cache expired mid-session); local only, can be re-signed — GitHub still verifies.
  • Dependabot alerts surfaced on push are on the default branch and pre-date this branch (no dependencies added here).

Bug-sweep branch — no single issue to close.

🤖 Generated with Claude Code

Ardnived and others added 18 commits July 21, 2026 16:18
Two visual regressions from the event-surfaces merge (#58):

- The Link atom's inline-link `items-center` survived the class merge into
  EventListItem's flex-col card, centering every line of content. listRow now
  carries `items-stretch` (column cards left-align; ListItem's explicit
  `items-center` still wins the merge for row cards).
- The <li> wrappers (#65) exposed cards to host typography: the widget's CSS is
  injected into the host document, where a bare `li { list-style: disc }` beats
  preflight's inherited reset and paints a bullet next to every card. The List
  <ul> now sets explicit list-none/m-0/p-0 plus [&>li]:list-none on the wrappers.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The EventView close button sits in a flex header row beside the title; a long
title squashed it below its w-8 (flex items default to shrink:1 even with a
fixed width), so the hover surface rendered as a pinched rectangle instead of
a square. Icon-only buttons are definitionally fixed squares — the isIconOnly
variant now carries shrink-0, covering every header control (close, collapse,
filter, share circles) at the atom.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
A search icon button sits immediately left of the close button in the
RegionView header, grouped in a flex container so the header's
justify-between keeps the title left and the two controls adjacent (gap-2,
matching the header slot's own control spacing) instead of spreading all
three apart. Clicking it jumps to the distance-ranked SearchView via
searchPath().

The reusable SearchButton lives in views/shared alongside CloseButton /
FilterButton and reuses the shared HEADER_CONTROL preset, so the header reads
as one set of buttons. Its aria-label uses common:search, which existed only
in en — now added across all 10 locales (each value derived from that
locale's existing search_placeholder verb).

Verified in-browser (/brazil): the control renders as a 32x32 square
immediately left of close and navigates to /search.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The drawer/chrome header controls read their aria-labels from common.json
keys that existed only in en — back, close, explore, and settings were all
1/10 locales, so every non-English header control silently fell back to the
English label (Close, Back, Settings, Explore) for screen-reader users.

Added all four across the nine missing locales (cs, de, es, fr, hu, nl,
pt-BR, ru, uk) via pnpm i18n:add, deriving each value from the locale's own
sibling strings. This matches the just-added `search` label so the whole
header-control set is now consistently localized (filters.title already was).

Verified in-browser at ?locale=fr: back→Retour, settings→Paramètres,
close→Fermer, search→Rechercher, filters→Filtres all render translated.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The origin/main merge (history-aware nav) moved shared.tsx's header
navigations onto the useAtlasNavigate() seam and dropped the raw useNavigate
import — but this branch's SearchButton, added before the merge, still called
useNavigate(). Git merged both sides cleanly, leaving useNavigate referenced
but unimported: navigating into a region threw "useNavigate is not defined".

Switch SearchButton to useAtlasNavigate() (already imported), matching
FilterButton/SearchField — which also correctly stamps history depth + camera
for the header CTA push.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
After the CMS slugs were migrated to ISO codes (SahajCloud#556), country
slugs are lowercase (`gb`, `de`). isoCountryCode passed them through as-is,
but Intl.DisplayNames({ type: 'region' }) is case-sensitive: `.of('gb')`
echoes back "gb" (fallback:'code') while `.of('GB')` resolves "United
Kingdom". So CountriesView/RegionView/OnlineView rendered the bare code
instead of the country name.

Normalize the derived code to UPPERCASE at the source (isoCountryCode), the
canonical form the mocks already use; the flag call site lowercases it again.
Fixes the name display across all three views in one place. The existing
post-#556 test asserted the lowercase passthrough — corrected to assert `DE`
and that the name actually resolves to "Germany".

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The IP-geolocation suggestion persisted a session dismissal both when the ×
was pressed AND when it was accepted (zoom to the guess). So once you followed
it, it never came back. Accepting now only navigates: the new ?center/?q makes
hasActivePlaceSearch suppress the prompt while you're viewing that area, and it
returns once you leave — so it keeps offering until you actually dismiss it
with the ×. The × still persists (markNearbyDismissed) as before.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Full width: drop the slides' p-6 and break the carousel out of EventDetails'
  px-6 with -mx-6, so the event image spans the drawer width. Square corners
  (no rounded-lg) for the full-bleed edge-to-edge look.
- Pagination: drop the custom 80px-bar dynamic bullets (dynamicBullets +
  the --swiper-pagination-bullet-* size overrides in globals.css) for Swiper's
  built-in clickable round bullets — pagination={{ clickable: true }} plus the
  default bullet styling.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The Chip's content weight was a separate `emphasis` prop (solid/subtle) that
no component ever set — every chip rendered at the default solid weight. Drop
it and add `subtle` as a third `variant` alongside flat/ghost: it carries the
same soft tint as `flat` but a lighter (font-medium) content weight. flat and
ghost keep font-bold, so no existing chip changes. Story grid gains a subtle
column; the standalone Emphasis section is removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The when/where facts sat flush against the header chips above and the Register
CTA below (just the container's gap-4). Add my-2 so the facts block reads as
its own band in the event panel.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The Default story's "Region ordering" section already renders the grid for
every notable region, so the interactive country-picker Playground was
redundant.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
… chip

- Starting date is now a radio list of the next 3 occurrences with a
  "show more dates" link for the rest, replacing the Select dropdown — the
  common choice (the next session) is one tap with the near options visible at
  a glance. Native radios styled to match the form's field chrome; the ISO
  string ↔ Date coercion seam is unchanged.
- Drop the "Free" chip from the event header (every event is free, so the pill
  was noise on every card) and surface it instead as the RegistrationView
  header subtitle. Locale strings updated: add registration.free_note +
  registration.show_more_dates across all 10 locales, remove the now-orphaned
  display.chip_free.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
A controlled radio list rendered as selectable cards (native radios, not a
Radix primitive), with an optional `collapseAfter` that hides the tail behind a
reveal link. Extracted from the registration date picker so the pattern is
reusable; domain formatting (dates, counts) stays in callers via `label`.
Ladle story + unit tests for the collapse behaviour included.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- The starting-date picker now labels occurrences in the class's own cadence:
  weekly reads "Next week / In 2 weeks", daily "Today / Tomorrow / In 2 days",
  monthly "This month / Next month / …" — via Luxon toRelativeCalendar with a
  unit derived from event.schedule.recurrenceType, replacing the auto unit that
  drifted ("in 6 days" then "next month"). Rendered through the new RadioGroup
  atom.
- Consolidate the "free" copy: reuse the existing display.all_events_free key
  (fully localized, 10/10) for the RegistrationView subtitle and reword it to
  "All classes are free" everywhere; point OnlineView at it too and drop the
  now-redundant display.all_classes_free (en-only) + registration.free_note.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- RegistrationForm: memoize the starting-date options so the Luxon/Intl
  formatting isn't rebuilt on unrelated form re-renders.
- RadioGroup: join the group className with clsx instead of a hand-rolled
  ternary.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Record the new RadioGroup atom in the DESIGN_SYSTEM.md atom table and the
components rule's "check these first" list.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 24, 2026 •

Copy link
Copy Markdown

Deploying sahajatlas with  Cloudflare Pages  Cloudflare Pages

Latest commit: f8f7b33
Status: ✅  Deploy successful!
Preview URL: https://ed7e8307.sahajatlas.pages.dev
Branch Preview URL: https://fix-bug-sweep.sahajatlas.pages.dev

View logs

Ardnived and others added 11 commits July 24, 2026 08:13
…ecule

Replace the hand-rolled Chip rows on EventListItem and the event header with
one EventChips molecule (type · language(s) · Today) so the two surfaces can't
drift. All flat; type is primary, language(s) secondary, "Today" danger:

- default (event header): the type + every language folded into one chip, plus
  a "Today" chip when the next session is today.
- concise (list card): drops the plain weekly-class type and the viewer's own
  language; combines the remaining languages into one chip.

Adds a `danger` colour to the Chip atom for the Today chip. EventListItem now
reads online-ness from the pure isOnline() rather than a second useEventDisplay
call. (The header's old online / Full / Ended / Starts chips are dropped — that
state still shows in the facts + register bar.)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The event images now sit at the bottom of the panel, after the About prose,
rather than between the secondary actions and the description.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- A third themeable brand role `contrast` (default orange #e08e79) alongside
  primary/secondary, wired through PaletteRoles / applyPalette / globals.css /
  tailwind. `neutral` is the gray ramp; `danger` (red) stays a FIXED error color.
- Retheme the built-in default palette: primary #1E6C71 (teal), secondary
  #A1C3D7 (blue), contrast #e08e79. The globals.css ramps are regenerated from
  DEFAULT_SEEDS via buildScale (the palette.defaults gate verifies the match).
- Rename the per-role on-color var --{role}-contrast → --{role}-on to free the
  `contrast` name; the Tailwind-facing `foreground` key is unchanged.
- No client-record slot maps to contrast yet (color1-3 → primary/secondary/
  background), so it's per-embed-overridable and falls back to the default ramp.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…t/neutral

Rename the component color options: `default` → `neutral` everywhere; the one
non-error `danger` accent (the EventChips "Today" chip) → `contrast`. Remove the
unused `danger` option from Button/Chip/Link; keep it on Alert (error banners)
and as raw error classes (invalid fields, form error text). Add the missing
`contrast` variant to Chip/Alert/Button/Checkbox/Spinner and secondary+contrast
to Link, so every colour-bearing component carries the standard set.

Button + Checkbox `solid`/checked backgrounds darken to step 12 with white text
in light mode (so a pale brand seed still reads), keeping the ramp's light solid
+ adaptive on-color in dark mode.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…olor

The IP-geolocation "events near you" Alert now uses `color="secondary"` instead
of primary.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…eming

The client record's color3 now themes the `contrast` role (was background), so
all three brand roles come from the tenant. Background is no longer wired — it
uses the fixed globals.css default on every component: the widget's
`background-color` embed attribute is removed and BrandTheme stops mapping color3
to background. (The engine's applyPalette still accepts a background seed, but
nothing feeds it now.)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- List cards: wrap standalone EventListItem/ListItem story items in <List>
  so the host page's <li> markers no longer render
- EventChips: rename `concise` variant -> `compact`; story now lists each
  sample on its own line under separate Default/Compact sections
- Alert/Button: drop the unused `faded` variant (and its story columns)
- EventPinPopover: move organism -> molecule; split out a map-free
  EventPinCard that stacks recurrence above start time (compact); story
  shows the card standalone, then the popover in context on a live map
- EventsList: split the network-bound DynamicEventsList into its own module
  so the presentational list (and its story) no longer pull in the api/i18n
  graph
- Mapbox: combine Map + MapSearch stories into one Mapbox.stories with a
  "sourced from Mapbox" note
- RegionView story: reorder to Country (default) / City / City with Centers
  (London + SY Centers "44 Chelsham Rd", "Flood Street") / Empty
- Spinner story: render the Colour x Size matrix as a grid

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Icons story: add an "In Context" colour-inheritance section (icons take
  currentColor across primary/secondary/contrast/neutral)
- Checkbox story: (Switch × Checkbox) × colour grid with a disabled row
  (the contrast colour was already wired on the control)
- Chip story: every section now exercises all four colours
- ActionRow story: lead with the colour × variant grid (colour rows, variant
  columns; primary->secondary->contrast->neutral, solid->flat->bordered->ghost)
- EventPinPopover: inline into Map.tsx (it's genuinely map-bound via <Popup>)
  and drop the molecules folder / story / barrel export
- RegionView mocks: "City with Centers" is now a mixed view (centres AND its
  own located events); "City" shows a much denser event roster
- Rename NearbyPrompt -> GeolocationPrompt (component, props type, folder,
  story, test, barrel, consumer); the lib helpers (shouldShowNearbyPrompt /
  NearbyPromptState) keep the feature name

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ename cleanups

- Time-of-day filter: replace the two-handle slider with a Morning / Afternoon /
  Evening / Night multi-select toggle group. New TimePeriod model + TIME_PERIOD_HOURS
  (night wraps midnight); matchesFilters tests an occurrence's start hour against the
  selected periods; the filter form shows the covered times below the toggles, and the
  active-filter pill shows the times (not the period names). A whole-day selection reads
  as "any time". Added filters.time.{morning,afternoon,evening,night} across all 10
  locales; URL codec + query key updated (parsePeriods).
- Default palette: swap primary <-> secondary (primary is now the soft blue, secondary
  the SY teal) in DEFAULT_SEEDS + the frozen globals.css ramps; palette.defaults gate
  stays green.
- EventActions: drop the emphasizeContact display flag; every ActionCircle now uses the
  `bordered` variant.
- Thicken the `bordered` outline to 2px on the shared controlSurface (Button +
  ActionCircle) and on Alert.
- Rename the geolocation feature-logic: src/lib/nearby.ts -> geolocation.ts,
  shouldShowNearbyPrompt / NearbyPromptState / read|markNearbyDismissed /
  NEARBY_DISMISS_KEY -> geolocation-named, and the NearbySuggestion wrapper ->
  GeolocationSuggestion (the proximity helpers NEARBY_MAX_KM / hasClassWithin /
  isLocalRegion keep their distance-semantics names).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…evert palette + Alert border

- Button story: add a second colour × variant grid rendered as icon-only circles
- Bordered controls: the border now uses the icon/text step (primary-11 … /
  gray-12) instead of the lighter -7 tint, so the outline matches the glyph
  (Button + ActionCircle, via the shared controlSurface)
- Revert the default palette swap: primary is the SY teal again, secondary the
  soft blue (DEFAULT_SEEDS + the frozen globals.css ramps)
- Alert `bordered` border weight back to 1px (border, not border-2)

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…n-only

The `bordered` variant is back to a hairline `border` (1px); an added
`isIconOnly + bordered` compound restores the 2px outline only for icon-only
circles, where a 1px ring reads as an artifact.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Ardnived and others added 4 commits July 25, 2026 09:18
- EventPinCard (Map.tsx) shares composeCalendarLine's recurrence/hasNext gating
  via a new calendarLineParts helper, restoring the #72 no-drift contract the
  inline-into-Map change had forked
- Button: correct the icon-only bordered comment (1.5px, not 2px)
- Remove the dead filters.time.start/end locale keys (slider thumb labels) from
  all 10 locales

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
A leftover from the color refactor — the `color="contrast"` Link still displayed
"Danger". Story-only label fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- .claude/rules/mapbox.md: EventPinPopover/EventPinCard are now inlined in
  Map.tsx (map-bound); the card stacks the parts and shares the calendarLineParts
  gate with the list card's composeCalendarLine (#72)
- DESIGN_SYSTEM.md: Slider no longer backs the time filter (period toggles now);
  ToggleGroup also drives time-of-day; add the EventChips molecule row;
  NearbyPrompt -> GeolocationPrompt and NearbySuggestion -> GeolocationSuggestion

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying sahajatlas-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: f8f7b33
Status: ✅  Deploy successful!
Preview URL: https://0add4a2e.sahajatlas-design.pages.dev
Branch Preview URL: https://fix-bug-sweep.sahajatlas-design.pages.dev

View logs

@Ardnived Ardnived changed the title fix: UI bug sweep — list, buttons, nav, i18n, carousel & registration fix: UI bug sweep — colour system, time filter, event & registration surfaces, i18n & nav Jul 25, 2026
@Ardnived
Ardnived merged commit 0d8fc1a into main Jul 25, 2026
4 checks passed
@Ardnived
Ardnived deleted the fix/bug-sweep branch July 25, 2026 21:33
Ardnived added a commit that referenced this pull request Jul 25, 2026
Reconcile with #74 (UI bug sweep), which landed on main after this branch
forked. Key reconciliation: #74 replaced the time-of-day filter's
[number,number] hour range with named TimePeriod[] — threaded through the
extracted occurrenceMatchesFilters (so the calendar shares the same
period cut). Also merged both header buttons (Calendar + Search) and
#74's NearbySuggestion→GeolocationSuggestion rename, both atoms
(RadioGroup + SearchableSelect), and both sets of i18n keys.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant