Skip to content

feat(calendar): our own Month and Week, naming each class - #538

Merged
Ardnived merged 22 commits into
mainfrom
feat/calendar-names
Nov 28, 2026
Merged

Ardnived merged 22 commits into
mainfrom
feat/calendar-names

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Schedule-X, its patch and temporal-polyfill are gone; the calendar is our own Month and a Week list.
  • Each class shows its name, its time in the visitor's format and its town (recased); online says so.
  • Month | Week | List switch, a "Calendar" button on lists, place title, empty states (g-calendar-week).
  • Phone Month: a dot per class (online primary, in-person secondary), a plus past three, the day's list below.
  • The Week pages on its own ?week=<day>, so Dates stays an ordinary filter in both views.

Change outline

Files — the calendar is ours

Schedule-X and everything that adapted it leave; three small views replace them.

 src/views/CalendarView/
-├── CalendarMount.tsx        # mounted Schedule-X, its plugins and our header plugin
-├── renderers.ts             # DOM renderers for SX's custom-component slots
-├── schedule-x-words.ts      # "+ N classes" / "No classes" fed through the patched translator
-├── timeline.ts              # CalendarEntry → SX events (Temporal)
+├── MonthView.tsx            # MonthGrid (table, weekday head, day number) + WideMonth · PhoneMonth cells
+├── WeekList.tsx             # seven days from the chosen day, FallbackPanel empty states
+├── DayClasses.tsx           # sticky day band + ListItem rows, shared by Week and phone Month
 ├── CalendarView.tsx         # header + body, our own views, and the one URL write
 └── day-heading.ts           # "Thursday 12 Nov" / "Today · 4 classes"
-patches/@[email protected]
-src/types/temporal.d.ts
 package.json                 # -@schedule-x/*, -temporal-polyfill

Types — CalendarEntry and the view

An entry carries the class name and where it is; the view is a URL word.

 CalendarEntry                                  src/lib/shape/calendar.ts
-  title, location, calendarId
+  name        the class title
+  place?      address locality, else region; tidyPlaceCase recases ALL-CAPS; none when online
+  online      boolean
   id, start, end, path
+CalendarViewName = 'month' | 'week'            # ?view=week; List is the place's own list
+calendarViewFromParams / calendarViewToParams(view, week, params)
+weekFromParams(params)                         # ?week=<day>, falling back to an older ?dates= link
+calendarWindow(week, today)                    # the seven days on screen, from that day
+weekFrom(day, today), shiftWeek → a day        # null for this week, which keeps a plain address
+monthGrid(month, firstWeekday), entriesByDay
+chosenCalendarFilters / clearedCalendarFilters # the place alone; dates are a filter like the rest

Components — CalendarView

The header owns navigation; the body picks the view off the URL.

 CalendarView                                   src/views/CalendarView/CalendarView.tsx
   CalendarHeader
     Back · FilterButton (filters, the place excluded) · ExpandSheetButton
+    DrawerTitle        the place's name (regionsQuery + regionRoute), else "Calendar"
+    ToggleGroup        Month | Week | List   # List: dismiss() when we came from it (cameFrom), else navigate to the place
+    arrows + label     "Next 7 days" | formatDateRange | formatMonth; arrows stop at today
   CalendarBody
+    one query on every date                   # neither view's arrows nor a dates filter refetches
+    times note         only when an online class is on screen
+    view === 'week' ? <WeekList> : <MonthView isWide>
-    <CalendarMount>    Schedule-X

Flow — switching view

One URL write moves the view and the Week's day together, keeping the drawer's depth.

 useSetView()(view, week)                       src/views/CalendarView/CalendarView.tsx
+  setSearchParams(prev → calendarViewToParams(view, week, prev))
+  { replace: true, state: location.state }   # the entry's depth survives the replace
 Month → Week                   → weekFrom(focused, today), so the day in view is kept
 Week → Month                   → setFocused(week.start), and `week` is dropped
 "+ N classes" (desktop Month)  → Week from that day
 CalendarButton (lists)         → "Calendar"; dismiss() when the calendar is where we came from

Behaviour — shared pieces touched

 Chip                        src/components/atoms/Chip
+  casing variant; min-h-11 tap floor only when closable
 ListItem                    src/components/molecules/List
+  count optional, tag slot (the Online chip)
 SkeletonCalendarControls    src/components/atoms/Skeleton
+  back row, title row, switch + arrows row — the header it stands for
 .ladle/components.tsx
+  StoryDevice: react-responsive Context sized to the story frame; dark paints the whole page
 scripts/assert-css-scoped.mjs
+  no rem anywhere in the emitted CSS

Contract — docs/embedding.md and CHANGELOG.md

The view rides inside atlas, so a host writes no new parameter; the rem caveat goes with Schedule-X.

 What the widget does to your page
-  the calendar is the one part still sized in rem, so a host root font-size shrinks it
+  the calendar follows the same side panel and sizing as every other page
 Troubleshooting: "looks wrong on your site only"
-  … your root font-size (the calendar only) …
 CHANGELOG [#538]
+  /calendar?view=week&week=2026-12-10 inside atlas; no origin, CSP or permission change

Preview

Test results

  • Lean gate: ✓ (lint, typecheck, unit lane — 222 files, 2742 tests)
  • Browser lane: ✓ 39 passed, whole lane (with PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH, per docs/testing.md)
  • Build: ✓, pnpm size ✓ (standalone 1.2 KiB under budget)

Manual verification

  1. Phone width: tap days, arrow keys move the chosen day and stop at today; dots, plus and list agree.
  2. Desktop: a day with 4+ classes shows "+ N classes", which opens the Week from that day.
  3. From a place's list, "Calendar" then "List" returns to the same list (Back history unchanged).
  4. On the Week, page the arrows, then set a Dates filter: the pill and the count show it, Clear clears it.
  5. Dark mode: dots, chips and the today pill readable.

Notes for reviewer

  • Scope grew: g-calendar-entries and g-calendar-week ship together, since the week work replaced Schedule-X.
  • Copy from feat(translations): the atlas calendar's day count, "+ N classes" and "No classes" keys SahajCloud#1301, #1305, #1309 (all merged). Six #1305 keys are now unused (see_calendar, see_list, share_title, none_in_window, none_match_filters, clear_filters) and listed in RETIRING_KEYS; a SahajCloud retire PR follows.
  • Dismissed: "keys born retiring" (already in production, retire upstream); renderers-rebuild nit (file deleted); a live region over the whole day list (only the heading is announced, to keep it brief).
  • All seven adversarial-review findings are built, none rebutted. The week param is the only one a host can observe.
  • Part of town is deliberately left out of the place.
Detail
  • Schedule-X needed a patch for our words and a Temporal binding that must not touch the host's globals; owning ~400 lines of Month/Week was smaller than keeping both.
  • Ladle's fixed-width stories now measure their own frame through react-responsive's Context, so a phone-width story renders the phone layout.
  • Month boxes are plain links (no ul/li) so the skeleton spec's row geometry compares like with like.
  • Giving the Week ?week= rather than the dates filter also means a dates filter now narrows the Week, which the empty state's "next class" button already leads out of.
  • The phone grid dropped its memoized day-name Map: the names feed an aria-label, and luxon caches the formatter.

🤖 Generated with Claude Code

Ardnived and others added 4 commits November 27, 2026 10:45
Each calendar entry leads with the class's name, then its time in the visitor's own
format and the town it is in, read off the address city and recased when typed in
capitals. "Online" is written out.

- Phone month list: Schedule-X's rows are drawn by our own renderers, as a plain list
  under a day heading ("Thursday 12 Nov", then "Today · 4 classes" on a quieter line).
- Desktop month box: its time and town, with the class name on hover. Week and list
  write the name, then where.
- Schedule-X's own "+ N events" and "No events" come from SahajCloud's calendar.more
  and calendar.none in every language, through a hook the Schedule-X patch adds to its
  translator.
- Every day with classes gets one solid dot, plain text on the tints in both themes,
  and the clocks line moves above the grid.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…loud

Syncs the snapshot with production, which now serves calendar.day_count, calendar.more
and calendar.none (sydevs/SahajCloud#1301), plus production's own recasing of
countries.place_title. The words table moves into its own module so a spec can read it
through a real i18next instance, as the day heading's does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-dispatcher

sydevs-dispatcher Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running
conflict held since 20:13Z, waiting for the base to settle

recent dispatches
  • 23:19Z address-review · attempt 1 · session · done
  • 23:19Z address-review · attempt 1 · session
  • 23:09Z review-pr · attempt 2 · session · done
  • 23:09Z review-pr · attempt 2 · session
  • 21:58Z review-pr · attempt 1 · session · timed out

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 27, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 27, 2026
…as Schedule-X lists the day

The heading's custom properties restyled the whole grid on every date change in every
view (about 20 ms in a long list), so only the month agenda sets them. The count now
includes a class that runs past midnight from the day before, as Schedule-X's list
does. Rows hold their height before our renderers fill them, and the grid remounts on a
language switch so Schedule-X's words follow it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design f8b9db6 Nov 27 2026, 11:44 PM

@sydevs-dispatcher sydevs-dispatcher Bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 27, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 27, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 27, 2026
Ardnived and others added 3 commits November 27, 2026 12:34
…Item rows, no Share button

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ls the page; the Week's empty states use FallbackPanel

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lour and chip; varied story classes; the full widget's box fits a phone preview

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-dispatcher sydevs-dispatcher Bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 27, 2026
@sydevs-dispatcher

Copy link
Copy Markdown
Contributor

The session for review-pr did not finish after 3 attempts. I have stopped retrying. A mention (@sydevs-bot) or a push from you starts me again.

🤖 sydevs dispatcher

@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 27, 2026
Ardnived added a commit that referenced this pull request Nov 27, 2026
- Sync the translation snapshot: Copy number and the share Email label
  now read `event.actions.copy_number` and `share.email`
  (sydevs/SahajCloud#1304), and the three keys sydevs/SahajCloud#1306
  dropped leave RETIRING_KEYS. Keys published ahead of #538 and #542 join
  PENDING_KEYS.
- tests/browser/skeleton.spec.ts measures the sign-up form, filters and
  calendar. It caught three header mismatches, now fixed: the sign-up
  form's reassurance line, the filters' close-button row, and the
  calendar's own controls in place of a Back-and-title header.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Ardnived and others added 3 commits November 27, 2026 13:22
…nded day headings; today as a pill

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e in the class card's primary chip, in-person in secondary

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ardnived and others added 7 commits November 27, 2026 14:04
…last class it stands for

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	CHANGELOG.md
#	src/config/translations.en.json
#	src/config/translations.test.ts
#	src/views/CalendarView/CalendarView.tsx
The calendar's own rules (chosen and cleared filters, the week a day opens, the view in the
address, an entry's day and time) move into lib/shape and are read by both views; one
cameFrom guards the list/calendar step back; the Week's feed expansion is keyed on the filters'
string form; only a closable Chip takes the 44px touch floor; the phone grid's day buttons
carry data-vaul-no-drag and the focus ring, and stop at today; the CSS gate proves its rem
detector still reads the build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Pending in SYDevelopers Technical Roadmap Nov 27, 2026
@Ardnived Ardnived changed the title feat(calendar): name each class and make entries readable feat(calendar): our own Month and Week, naming each class Nov 27, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 27, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 27, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 27, 2026
Ardnived and others added 2 commits November 27, 2026 16:10
The skeleton spec skips a list inside a grid cell, so the boxes keep their list
semantics and the panel's rows still compare like with like.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Week no longer borrows the dates filter for its seven days, so dates stays an
ordinary filter in both views and survives Month → Week → Month. That drops the
masking around it: chosenCalendarFilters, clearedCalendarFilters, weekFilters,
keepDates and hideDates. Also folds use-calendar-view.ts into CalendarView, reads
an entry's wall clock with fromFormat, and inlines placeOf.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

Dropping Schedule-X, its patch and temporal-polyfill for ~400 lines of our own Month and Week is the right trade: the library needed a patch for our words and a Temporal binding that must not touch the host's globals. It nets −930 lines. The contract side is right — the rem caveat leaves docs/embedding.md, the rem gate now covers every sheet, and no origin, CSP or permission moves.

Where it is bigger than the problem is the Week's dates. In the shared filters.dateRange they cost nine pieces to make five files ignore a filter that is not one; a week param of its own removes all of them. Beside that, the two Month grids are one grid written twice — which is why the today-pill colour bug needs fixing twice.

Findings

  • should-fix — the Week's days ride in the shared filters (FilterView.tsx:67)
  • should-fix — today in a neighbouring month's grid gets a grey pill (MonthView.tsx:105)
  • should-fix — the two Month grids are one grid (MonthView.tsx:77)
  • should-fix — a hook file for one consumer (use-calendar-view.ts:13)
  • should-fix — EntryList.tsx exports only DayClasses (EntryList.tsx:17)
  • consider — Month → Week discards the month in view (CalendarView.tsx:106)
  • consider — counted names three things, and pairs with live (EntryList.tsx:21)

What was checked

Read whole on the branch: shape/calendar.ts, CalendarView, MonthView, WeekList, EntryList, use-calendar-view, lib/time.ts, Chip, ListItem, shared.tsx, assert-css-scoped.mjs and its spec, the four changed docs. Ladder walked over the luxon reuse (no new dependency), Info.getStartOfWeek and Intl.formatRange. Streamliner: 61 pieces, 46 kept, 8 raised, 5 held. Every new calendar.* key resolves in translations.en.json; calendarWindow and the dropped resolveCalendarView agree with AGENTS.md.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread src/views/FilterView/FilterView.tsx Resolved
Comment thread src/views/CalendarView/MonthView.tsx Resolved
Comment thread src/views/CalendarView/MonthView.tsx Resolved
Comment thread src/hooks/use-calendar-view.ts Resolved
Comment thread src/views/CalendarView/EntryList.tsx Resolved
Comment thread src/views/CalendarView/EntryList.tsx Resolved
Comment thread src/views/CalendarView/CalendarView.tsx Resolved
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 27, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 27, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor

Built all seven adversarial-review findings; none rebutted.

Base merged clean. Lean gate ✓, browser lane ✓ 39. No CSP or origin moves; ?week= is in the CHANGELOG.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 27, 2026
@sydevs-dispatcher

Copy link
Copy Markdown
Contributor

I could not merge the relay here, so this is the step left for you.

  • merge the relay — GitHub said: claude/relay-538-4bec5ca conflicts with feat/calendar-names: Merge conflict - https://docs.github.com/rest/branches/branches#merge-a-branch

🤖 sydevs dispatcher

@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 27, 2026

@sydevs-dispatcher sydevs-dispatcher Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is

@Ardnived
Ardnived added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit 5ae273c Nov 28, 2026
28 checks passed
@Ardnived
Ardnived deleted the feat/calendar-names branch November 28, 2026 00:10
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 28, 2026
Ardnived added a commit that referenced this pull request Nov 28, 2026
Brings in #520–#551. Resolutions:
- ShareView stays deleted (#540); the inline split's class views are the class and its sign-up,
  and the aside under the map takes the actions, then Register, in #540's order.
- The calendar's width reads #538's `isCalendarFullWidth` off the URL; #466's
  `calendarFillsWidth` goes with Schedule-X.
- MapControls and Mapbox take both `settings` and #542's `filterMenus`; MapLayer passes the
  floating filter buttons, and DrawerStack claims them only for a sheeted stack.
- The root view's new title (#531) is a place's, so inline it gives way to the page heading.
- Main's Event "Layout" control is dropped: the Expanded form shows the phone sheet.
- The panel stays 384px, including FilterMenus' cap; translations re-synced from production.

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

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants