Repository navigation
Description
Summary
Add a CalendarView — a full-width calendar surface for browsing events by date, complementing the map/list. Unlike the other drawer views (a narrow ≤22rem left panel on ≥md), the calendar spans the full width of the widget (minus the margins we already establish for the floating drawer) so a month grid is legible. It switches between Month / Week / Schedule (agenda) modes, reads the same URL-driven event filters as the rest of the app, and clicking an event navigates into the existing EventView. To support "what's on in this region", we also add a Region filter (a searchable single-select over all loaded regions) to the shared FilterView, plus a calendar entry-point button on the RegionView header that opens the calendar pre-scoped to that region.
Library: Schedule-X (@schedule-x/react + @schedule-x/calendar) — MIT, lightweight (this is a public embeddable bundle), built-in light/dark theming, and month-grid / week / agenda(list) views. Events are a controlled array we derive from the cached feed, which fits our filter-driven data model.
Proposed changes
Grouped into workstreams; land as coordinated PRs but tracked here as one feature.
1. Add Schedule-X + a full-width calendar surface
- Add
@schedule-x/react,@schedule-x/calendar, and the theme package (depsscope). Confirm the exact view constructors (month-grid / week / agenda-or-list) during implementation. - Theme Schedule-X's CSS variables (
--sx-*) to our design tokens so it matches light/dark + accent; drive dark viauseTheme(). - Introduce a full-width variant of the drawer surface for this one view: on ≥md the calendar fills the widget container minus the established floating-drawer insets (
lg:inset-y-4 lg:start-4), not the--sy-drawer-w(~22rem) left panel; on mobile it's the bottom sheet at the near-full snap.DrawerStackpeek-strip/narrow-panel geometry must not assume the narrow width for this view.
2. CalendarView + routing
- New
src/views/CalendarView/(view + story), dispatched byDrawerStack'sTopView. - Route it as a top-level view like
/search: addcalendartoRESERVED_SLUGS, a{ kind: 'calendar' }StackEntry, andresolveStack/TopViewhandling (src/lib/shape/path.ts,src/views/DrawerStack/DrawerStack.tsx). - Header mirrors SearchView: title + the FilterButton and CloseButton in the same right-aligned group and order. A Month/Week/Schedule switcher lives in the header/toolbar.
3. Event data → calendar entries (occurrences, timezone-correct)
- Source events from the cached
['geojson']feed joined with['event-titles', locale](same source as list/map), including online/placeless events — a calendar isn't geographic. - Expand each event's
schedule.upcomingDatesinto one entry per occurrence in the visible range (events recur — DAILY/WEEKLY/MONTHLY), each linking back to the same event. - Place each occurrence with the app's existing timezone rule (
eventTimeZone— event's own zone, viewer's zone for online, UTC whenfirstDate_tzis null), not naive JS-local time. - Apply the active URL filters via
matchesFiltersso calendar, list, and map agree. - Clicking an entry navigates to the event (
event.path→ EventView) via the atlas Link/navigate (camera/depth stamping).
4. Region filter (global) + searchable select
- Extend
EventFilterswithregion: string | null(slug); wire throughDEFAULT_FILTERS,filtersToParams/filtersFromParams(?region=<slug>, validated against the loaded region set — unknown slug ⇒ no restriction),FILTER_PARAM_KEYS,filtersKey,activeFilterCount, and ActiveFilterPills. - Region-aware matching: an event matches when its region equals the selected region or is a descendant of it.
matchesFilterstoday only seesFilterableEvent(eventType/languages/schedule); thread region ancestry in without regressing the map's hot path — resolve via the['regions']tree / feedregion.id+ancestorIds. Decide the seam (optional ancestry-resolver arg, or apply the region cut where the index is already in hand). - New searchable-select atom: we have no combobox (the Select atom is Radix Select; the language filter is Dropdown+Checkbox). Add a searchable single-select atom (Radix Popover + filter input + filtered list, or
cmdk) and use it for Region in SearchFilters. Options are the loaded regions restricted to those present in the feed; disambiguate same-named regions (show level/breadcrumb). Newatoms/<Name>/folder + story. - Scope: global — Region is a normal URL filter, so SearchView, the events list, the map, and the calendar all honor it (new pill + header badge everywhere).
5. FilterView origin-awareness
FilterView.commitcurrently hardcodesnavigate('/search', …), so applying from the calendar would jump to Search. Make commit return to the origin view (calendar or search), preserving its query (region/center/bbox/q). The FilterButton already stacks<current>/filters(so/calendar/filtersworks); the fix is on apply/clear.
6. RegionView entry point
- Add a calendar button to RegionView's header control group (next to Close, alongside SearchButton), reusing the existing
CalendarIcon(src/components/atoms/Icons/symbols.tsx). Clicking opens/calendar?region=<slug>(pre-sets the Region filter).
7. i18n
- Add labels across all locales via
pnpm i18n:add(not en-only — these drift): calendar title, three view-mode labels, region filter label + search placeholder + empty state, and the calendar empty state. Weekday/month names come from luxon/Schedule-X locale.
Acceptance criteria
- CalendarView opens at
/calendarand, from the RegionView button, at/calendar?region=<slug>with the Region filter pre-set. - On ≥md the calendar spans full widget width minus the established floating-drawer margins; on mobile it's the bottom sheet at the near-full snap; it also works map-less/standalone (fills the container).
- The view switches between Month, Week, and Schedule (agenda) modes.
- Entries reflect event occurrences (recurring events show every upcoming occurrence in view), each placed in the correct timezone; online events appear.
- The calendar honors the active URL filters (format/day/time/date/language/cadence and region) — its set matches list/map for the same filters.
- Clicking a calendar entry opens the corresponding EventView.
- The header shows FilterButton + CloseButton in the same position/order as SearchView; opening filters stacks
/calendar/filters. - Applying/clearing filters from the calendar returns to the calendar (query preserved), not
/search; from search it still returns to search. - FilterView has a Region filter: a searchable single-select over the loaded regions; typing filters the list; selecting sets
?region=<slug>; it contributes to the active count/badge + shows an ActiveFilterPill; "Clear" resets it. - Region matching includes the selected region's descendants (selecting a country shows its regions/areas/venues' events).
- Schedule-X is themed to our tokens and follows light/dark (+ accent).
- New/updated i18n keys exist in every locale.
- Unit tests: region filter URL codec,
activeFilterCountwith region, region-awarematchesFilters(self + descendant + non-match). Node-only SSR for presentational atoms; calendar interaction exercised in Ladle/browser. - Lint + typecheck +
test:run+ build +ladle:buildpass. - Verified in the running widget (map + map-less, mobile + ≥md; region-scoped open; event click → EventView).
Files affected
src/views/CalendarView/(new),src/views/DrawerStack/DrawerStack.tsx,src/views/shared.tsxsrc/lib/shape/path.ts(reserved slug, StackEntry, resolveStack),src/lib/shape/filters.ts(region filter + codec + matchesFilters)src/components/molecules/SearchFilters/SearchFilters.tsx,src/components/molecules/ActiveFilterPills/src/components/atoms/<SearchableSelect>/(new) +atoms/index.tssrc/views/FilterView/FilterView.tsx(origin-aware commit),src/views/RegionView/RegionView.tsx(entry button)src/hooks/use-filters.ts(if region plumbing needed),public/locales/*/common.json(+events.json),package.json
References
- Schedule-X: https://schedule-x.dev (React adapter + calendar + theme)
- Filters live in the URL:
.claude/rules/i18n-and-state.md,src/lib/shape/filters.ts - Drawer stack / routing:
src/views/DrawerStack/DrawerStack.tsx,src/lib/shape/path.ts - Data layer (
['regions']+['geojson']caches):.claude/rules/data-layer.md,src/config/api/fetch.ts - Related: recurrence/time popover feat(map): show recurrence + time popover on event pin hover #72, event-surfaces redesign feat(event): redesign event display & registration surfaces #52
Metadata
Metadata
Assignees
Labels
Type
Fields
Hold Until
Activity
feat(calendar): full-width CalendarView, region combobox + input erro…
feat(widget): add a report-issue modal with turnstile captcha (#81)