Skip to content

calendar 0.1.2: views place events like the host Calendar view (#172) - #201

Merged
michielbdejong merged 4 commits into
mainfrom
claude/calendar-match-builtin-view
Sep 29, 2026
Merged

michielbdejong merged 4 commits into
mainfrom
claude/calendar-match-builtin-view

Conversation

@michielbdejong

Copy link
Copy Markdown
Contributor

Follow-up to #172/#194, per Michiel's decision on ontola/atomic-server#1803: keep the host's existing calendar format (exclusive End day), and have the app's own views draw what the built-in Calendar view draws. Changing the built-in view is out of scope.

Stacked on #171 (base claude/post-89-timesheets-issue-tracker). Merge after #171 lands; GitHub then retargets it to main.

Placement. The app's Agenda and Week now place rows by Day, All day and End day using the host's own isAllDayOnDate (imported from browser/lib/src/calendar-date.ts, not copied). Before, they placed rows from Start and End in the viewer's zone. Cases that changed:

  • an all-day row with no End day, or an invalid one;
  • rows created by the host view's "+" (no Start/End). They now show, read-only and untimed;
  • Day or End day edited in the host table;
  • timed events crossing midnight: now on their start day only, with the block stopping at 24:00 and the label giving the real end;
  • timed rows with a Day but unusable times;
  • rows with no Day: drawn nowhere, as in the host.

Lens. devonian/google-calendar/lens/projection.ts threw on an all-day end.date == start.date. It now writes End day = the next day, the same #184 choice adapter.ts already makes.

Decisions for Michiel (also in the README):

  1. Clock times in the grid use the event's stored offset, not the viewer's zone, so time and Day stay on one clock. The drawer shows both.
  2. Overnight and multi-day timed events show on their start day only, following the host rather than Google's UI.
  3. Editing Start or End in the host table doesn't re-derive Day or End day, so the event doesn't move until it is edited in the app.

Release. The app becomes 0.1.2 (apps/calendar/0.1.2/ui.js, 107,798 bytes). The catalog entry stays enabled: false.

Checks run locally:

  • calendar lane: typecheck, unit tests (124, including 15 placement cases checked against the host's isAllDayOnDate) and e2e 4/4;
  • apps.mjs check, certify, the e2e typecheck, oxfmt, and oxlint with 0 errors.

The new placement is covered by unit tests only; no e2e has run it in a timezone other than Europe/Amsterdam.

🤖 Generated with Claude Code

Michiel de Jong and others added 2 commits September 29, 2026 13:58
Following the decision on atomic-server#1803 (#172): the data keeps the
host's format with the exclusive End day, and the app's own Agenda and Week
must draw every row on exactly the days the host table's Calendar view
draws it.

events.ts now places rows by Day, All day and End day, with the host's own
isAllDayOnDate imported from the pinned browser/lib/src/calendar-date.ts,
the way CalendarView.tsx buckets them:
- all day with End day: Day <= day < End day (End day == Day, before Day
  or not a date: nowhere);
- all day without End day, and every timed row: Day only, End day ignored;
- no Day: nowhere.

So a timed event that crosses midnight or spans days is drawn on its Day
only (block capped at 24:00, labels give the real end), a timed event is
placed by the date and clock of its stored offset rather than the viewer's
zone, rows added with the host view's "+" (Day and End day, no Start or
End) now show, untimed, and a Day or End day edited in the host table moves
the event in the app too. The drawer no longer throws on a row without
Start or End.

The LocalThought lens (devonian/google-calendar/lens/projection.ts) failed
the whole projection on an all-day event with end.date == start.date; it
now reads it as one day with End day the day after, as project() does
since #184.

Unit tests check each case against the host's isAllDayOnDate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Built with `node integrations/tooling/apps.mjs write calendar`; 0.1.0 and
0.1.1 stay published unchanged. The catalog entry stays enabled: false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michielbdejong
michielbdejong changed the base branch from claude/post-89-timesheets-issue-tracker to main September 29, 2026 14:48
@michielbdejong
michielbdejong merged commit 0bd5f81 into main Sep 29, 2026
30 checks passed
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