Skip to content

calendar: implement #89 frontend design - #145

Merged
michielbdejong merged 14 commits into
mainfrom
claude/impl-89-calendar
Sep 25, 2026
Merged

michielbdejong merged 14 commits into
mainfrom
claude/impl-89-calendar

Conversation

@michielbdejong

@michielbdejong michielbdejong commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

For users

See your Google Calendar next to your own data, edit events in Atomic, and send the changes back only once you've checked them.

Calendar brings the events of one Google calendar into a table in your Atomic drive. You can see them as a week or as an agenda, next to your projects, notes and timesheets. You can also fix an event right there: change its title, time, place or notes. Nothing goes back to Google until you've looked at the changes and pressed Send.

What you get

  • Your week at a glance. A week view with all-day events on top and a line for the current time, or a day-by-day agenda that works on a phone.
  • Edit without switching apps. Change an event's title, start and end, all-day setting, location or notes. You see exactly what will change ("Room 4 → Room 2") before anything is sent.
  • No surprises in Google. Changes are only sent from the review screen. If someone changed the event in Google in the meantime, your change isn't sent over theirs, and you can review it again.
  • You decide when both sides changed. If the same detail was changed here and in Google, the app asks you which one to keep instead of overwriting either.
  • Your data stays yours. The events are ordinary rows in your own table, which you can sort, filter and link like anything else in Atomic.

How it works

  1. Connect Google Calendar. Atomic asks you to confirm the connection first.
  2. Choose the calendar to bring in. Its events are copied into this app's table.
  3. Look, edit, review, send. Browse the week or the agenda, edit an event, then press "Review changes" to send your edits to Google.

Good to know

  • Google Calendar only, for now. Outlook and Apple Calendar are shown as "Not available yet".
  • One calendar per app. To bring in a second calendar, add a second Calendar app.
  • Recurring events aren't imported yet. The app tells you how many it left out. Cancelled events aren't imported either.
  • You can't create or delete events in Google from here yet. Events you add to the table stay in Atomic, and nothing in Google is ever deleted.
  • Guests aren't emailed about your changes. Guests, reminders and video links are still edited in Google Calendar.
  • The month view is your table's own Calendar view in Atomic. "Month" opens it.
  • Syncing is manual. The app syncs when you open it and when you press "Sync now". Each sync reads the whole calendar, up to 25,000 events.
  • This is a first version. It hasn't yet been tried against a real Google account; everything so far has been tested with sample data.

Implements the approved frontend design for the Calendar plugin (#89, design in #105, now at integrations/calendar/design/). Everything is inside integrations/calendar/. The branch is rebased on main at pin 69602364b (candidate6, which contains the 007869464 host operations), after #142 (#54 phase 2). #142's store.ts, relay.ts and connect handling are kept; store.ts only gains the pin-007869464 operations as optional members.

issues.md items

Item Status Notes
C1 scaffold and state machine Done The app from #101 already existed, so this extends it rather than scaffolding a new one. controller.snapshot() feeds the views. describe(), pill(), banner() and classify() are pure and unit-tested.
C2 shared chrome, --pl-* tokens Done Lives in app/ui/ (styles.ts "PLUGIN CSS", chrome.ts, dom.ts, theme.ts). The frame follows a host theme switch without a reload (checked in the e2e). Reduced motion stops the spinner and the progress edge.
C3 transport Done Reuses #142's relay.ts. The adapter's own Google Calendar returned NNN errors now carry their status and retry-after. Before this, any non-2xx from Google was also read as a spent connection (the adapter's message says "reconnect").
C4 picker and import Partial One calendar per app, not several (see decisions). The calendar's colour, access role and account are kept on the table, and each row keeps Google's htmlLink (display only, never written back). Import shows per-page progress and a skeleton, plus "Not shown: N recurring, M cancelled". The event's timeZone is still not kept.
C5 Agenda Done agendaDays() is pure and unit-tested (exclusive all-day end, midnight crossings, viewer zone). Rows are at least 48px with complete accessible names.
C6 Week Done packWeek() is pure and unit-tested. Includes all-day bars, overlap lanes (collapsing to "+N" below 44px per lane), now line, today tint, dashed edge for edited events, "!" for conflicts, and 3/5/7 days by width. Each column is a labelled <section>, and "Switch to agenda view" comes first.
C7 Month Done "Month ↗" (and m) opens this app's table in the host with store.openResource, where the table's own Calendar view shows the month (§11 decision 1).
C8 drawer and local edit Done Edit covers exactly the five mapped fields, with validation equivalent to the adapter's, and saves to the row only ("Saved here · not sent to Google yet"). Offsets come from the viewer's zone. Focus moves to the heading and back. Read-only calendars get no Edit. "Open in Google Calendar ↗" goes through store.openExternal, so the host shows the destination and asks first.
C9 review and send Done Per-field before and after, per-event Discard, per-row Sending/Sent/Changed in Google/Unknown status, and Review again after a 412. It sends with If-Match (the host already relays ifMatch, so X1 needs nothing more). The footer says guests are not emailed (sendUpdates=none, already settled on main).
C10 conflicts Done Per-field "Keep mine"/"Use Google's" with nothing preselected, where Resolve stays disabled until every field has a choice, and a kept value goes to review, never straight to Google. "Keep as local event" works, and "Remove local copy" asks for an in-page confirmation first. A missing or rebound row gets "Open row in table" (store.openResource).
C11 errors and reconnect Done Banners for 401, 403, 404, 429 (counting down from retry-after, then retrying), 5xx/network, over 25,000 events, and an uncertain write. Only 401/403 use role="alert". Every banner says "Nothing here was changed". Rows stay visible under every banner. Proxy refusals (#142 codes) show "Reconnect needed", or "The integration proxy refused this request".
C12 keyboard and a11y Done Keyboard shortcuts: t, ←/→, j/k, a, w, e, Esc and ? (with an overlay). None of them fires while typing in a field. axe finds zero violations at 360, 720 and 1200px in light and dark, on the real host (e2e) and on every screen against the fake store. A contrast test covers the tints of Google's 24 classic colours (see decisions).
Disconnect Done The connection menu's Disconnect calls store.proxy.disconnect: only this app's delegation goes; the connection and the rows stay.
C13 e2e screenshots Done A new test renders 360, 720 and 1200px frames under the host's light and dark themes. It checks for no sideways scroll and no axe violations, and attaches screenshots to the Playwright report (CI's playwright-report-calendar artifact).
X1 If-Match relay Already in host Nothing needed.
C14–C17 (later) Not started Out of scope, as the design says. Recurring events stay out of import.

Decisions I made (please check)

  • One calendar per app. The picker uses radios, not the mockup's checkboxes. The table model from Calendar: establish one supported installation path and verify its declared scope end to end #101, which merged after the design, binds one calendar per table and never switches. Supporting several calendars would need a calendar id on each row and one preview per calendar. The one chip toggles visibility only. "Choose calendars" in the connection menu is disabled and says why.
  • Host operations are feature-detected. openExternal, openResource, proxy.disconnect and getTheme/onThemeChange are optional in store.ts. On an older host their controls are not shown, and dark mode falls back to the luminance of --t-color-bg-body. On pin 007869464, data-pl-theme follows colorScheme, and --pl-pos reads --t-color-success.
  • Outlook/Apple: shown as "Not available yet".
  • Last view is not remembered. The null-origin frame has no usable localStorage, and build.test.ts forbids storage, so the default view is picked by width each time the app opens.
  • Week scroll: starts at 08:00 when now is between 08:00 and 18:00, otherwise one hour before now. This matches the mockup, whose "now" of 14:20 still shows 09:00 at the top.
  • 403/404 actions are Retry. "Choose calendars" and "Remove from list" have nothing to act on with one calendar per app. After an uncertain write the banner offers Sync now. Since #54 phase 2 (client side): plugins talk to the 0.2 proxy through frame capabilities; pin atomic-server 11264e83e #142 nothing is spent, and on an older host the sync itself leads to Reconnect.
  • Event's own zone: the drawer shows the event's stored UTC offset ("10:00 – 11:00 in the event's time zone (UTC−04:00)") instead of a zone name, because timeZone is not imported.
  • Contrast: plain --pl-muted falls below 4.5:1 on the design's 14%/22% tints for 9 (light) and 17 (dark) of Google's 24 colours. So the week time line uses a 60/40 mix of --pl-text and --pl-muted. Pill text is mixed a quarter towards --pl-text for the same reason. --pl-text itself passes on every tint.
  • Bundle: app/build.mjs minifies the JS (minify: true) and runs each embedded stylesheet through esbuild.transform(css, { loader: 'css', minify: true }). Measured 103,825 bytes; the build-test limit is 112 KiB (measured plus about 10%), with the reason in a comment.
  • Shared chrome stays in app/ui/. Money, Timesheets, Notion and Issue tracker designs use the same chrome. Extracting it to a shared kit is your call.
  • Native <input type="date">/time in the editor, not the mockup's text fields.

Needs outside this PR

  • Nothing is blocking. Pin 007869464 supplied the missing host operations (openExternal, openResource, proxy.disconnect, colorScheme, --t-color-success).
  • atomic-plugins docs: the Google Calendar row in integrations/READINESS.md could mention the designed UI and the new e2e tests. I left it alone because it is outside the plugin folder.
  • Google: still no live verification. There is no test account; everything here runs against the fake store and the mock proxy.

Conflict risk with #54 phase 2

#142 merged before this PR opened, and the branch is rebased on it. The only conflict was in fakeStore.ts, resolved by keeping #142's revoke() next to the new answerNext()/throwNext(). relay.ts, store.ts and the connect handler are #142's code; the only addition is backgroundColor on CalendarEntry. In e2e/calendar.spec.ts, connectThroughHost and the connect steps are unchanged. Only the assertions after connecting changed, plus one new test block.

How I tested

  • node integrations/tooling/run-lane.mjs calendar --tier typecheck: passed.

  • --tier unit: 93 tests passed. New suites: controller.test.ts (state, pill, banners, local operations), events.test.ts (time and layout), view.test.ts (every screen in jsdom against the fake store, checking that nothing reaches Google except Send), contrast.test.ts.

  • --tier e2e against the pinned host (69602364b, the published e2e image) with the mock proxy: 4 tests passed. The two new ones check that "Open in Google Calendar" reaches the host's "Open a link" confirmation with the event's htmlLink, that Disconnect leaves the connection without this app's delegation and keeps the rows, and that Month opens the app's table in the host.

  • node integrations/tooling/certify.mjs --layer js: money, notion and pets passed. The calendar is not a certified package.

  • The localthought unit lane still passes with htmlLink added to the shared Google Calendar fixture.

  • oxfmt --check and oxlint on integrations: clean.

  • Visual check against design/mockups.html: I rendered every state with a fake-store harness in Chromium and compared screenshots with the mockup sections:

    • 5.1 and 5.2/5.3 at 480px.
    • 5.4 at 480px.
    • 5.5 at 720px.
    • 5.6 at 720px.
    • 5.7 at 1120px in light and dark, and at 720 and 360px.
    • 5.8 at 360px in light and dark.
    • 5.9: detail at 1120px, edit with the "End must be after start" error, and the saved state at 380px.
    • 5.10: ready and after sending.
    • 5.11.
    • 5.12: 401 over the agenda at 360px, and 429 with Details open.

    They match the mockups in layout, copy and colour, apart from the decisions above. Examples: header row with chip, pill and primary action; connection bar; sidebar with mini month, "My calendars" and "Not shown"; week grid with the all-day row, now line, dashed edited block and "!" conflict badge; agenda with day strip and "Not sent yet"/"Conflict" taglines. In the real host, the e2e screenshots show the same views under the host's own light and dark themes and font.

Closes nothing on its own: #89 covers five plugins.

🤖 Generated with Claude Code

Michiel de Jong and others added 14 commits September 25, 2026 09:24
The controller now exposes a snapshot the designed views draw from:
the imported calendar's name, colour, access role and account (kept on
the table as display-only JSON), the rows as events with pending and
conflict flags, and the last preview, which stays valid under an error.
Pure pill(), banner() and classify() carry the copy of DESIGN.md §3 and
§5.12. New local operations: drawer save, review Discard, per-field
conflict resolution, keep as local event, remove local copy; none of
them writes to Google.

Errors from Google now carry their status and retry-after, and are no
longer mistaken for a spent relay connection (the adapter's message
says "reconnect" for every non-2xx, which used to drop the connection).
The adapter's preview adds the local, remote and base values and the
ETag to both-changed conflicts; the five-field write mapping is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agendaDays() groups events per day in the viewer's zone, all-day first,
using the exclusive all-day end and splitting timed events that cross
midnight. packWeek() spans all-day bars across columns and packs
overlapping timed events into lanes. time.ts builds the offset-qualified
strings an edit stores from the viewer's zone; nothing is stored as a
Date or a number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plain-DOM builders for the #89 design family's chrome: header row, status
pill, connection bar with an indeterminate progress edge and overflow
menu, banner with one action and a Details disclosure, empty-state card,
segmented control and modal sheet. PLUGIN_CSS maps every --pl-* token to
the host's --t-* variable with the design's light and dark fallbacks;
theme.ts sets data-pl-theme from the host's background so the values the
host has no variable for (tint strength, success green, text on accent)
follow a theme switch without a reload. Reduced motion stops the spinner
and the progress edge.

Kept inside the Calendar plugin (per-plugin containment); written so it
can move to a shared kit as is, which is the maintainer's call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s (C4-C6, C8-C11)

Replaces the plain placeholder view with the #89 design:
- first run with Google connect and Outlook/Apple "Not available yet",
  connecting with Cancel, no-relay card (5.1-5.3);
- calendar picker with colours, access roles and Read-only tags, one
  calendar per app as the table model requires (5.4);
- first-import progress and skeleton under the final chrome (5.5);
- Agenda with day strip and sticky day headers, Week with all-day bars,
  overlap lanes ("+N" when too narrow), now line and edited/conflict
  markers, 3/5/7 days by width, sidebar at 900px+ (5.6-5.8);
- event drawer with viewer-zone times and the event's own offset, and a
  local editor of exactly the five mapped fields with adapter-equivalent
  validation (5.9);
- review sheet with per-field before/after, Discard, per-row send status
  and Review again after a 412 (5.10);
- conflicts sheet: per-field Keep mine / Use Google's, Keep as local
  event, Remove local copy behind an in-page confirmation (5.11);
- banners mapped from the provider status, 429 countdown (5.12);
- keyboard shortcuts t, arrows, j/k, a, w, e, Esc, ? (§6).

view.test.ts drives these in jsdom against the fake store and checks that
nothing reaches Google except the Review sheet's Send. contrast.test.ts
checks --pl-text on the event tints of Google's 24 classic colours; the
time line uses a darker mix of text and muted because plain --pl-muted
fails 4.5:1 on 9 (light) and 17 (dark) of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From an axe run over every screen at 360, 720 and 1120px in light and
dark against the fake store:
- landmarks: the header row and connection bar are one <header>, the
  content one <main>; screens without the chrome get a hidden <h1>;
- buttons keep their own colours (the reset no longer out-ranks
  .btn-primary, which left dark text on the accent);
- pill text and out-of-month mini-month days meet 4.5:1;
- sidebar headings follow the page outline; the picker is a div with
  role=form.
Week blocks under 75 minutes clamp their title to one line so the time
stays visible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Agenda (the default below 720px, where the sidebar is hidden) now
ends with the same "N recurring … aren't imported yet" note. Provider
status and retry-after are attached only to the adapter's own "Google
Calendar returned NNN" errors, so a relay or proxy refusal keeps its
"Connect again" meaning. After an uncertain write the banner offers
Sync now rather than Reconnect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
build.mjs sets minify: true (about 105 KB), so the build test keeps its
160 KB limit. A delegation revoked at the integration proxy, or a
capability that expired even after the frame's retry, shows "Reconnect
needed"; any other refusal by the proxy says the proxy refused and that
Google was not asked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The supported-path spec now drives the #89 UI: the first-run card, the
picker's Read-only tag, the status pill, Sync now, the Review sheet (Send,
412 "Changed in Google", Review again) and the lost-response banner.
The connect steps (connectThroughHost) are unchanged.

A second test renders the imported calendar in 360, 720 and 1200px
frames under the host's light and dark themes: the host's theme switch
restyles the frame without a reload, nothing scrolls sideways, axe finds
no violations, and a screenshot of each is attached to the report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… size

build.mjs runs each exported stylesheet string through esbuild's CSS
minifier before embedding. The bundle measures 101,723 bytes; the build
test's limit is that plus about 10% (110 KiB), with the reason in a
comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…onnect, theme)

- C8: the import keeps Google's htmlLink on each row (display only, never
  written back); the drawer's "Open in Google Calendar" goes through
  store.openExternal, which asks the person first.
- C7: "Month" (and m) opens the app's table in the host with
  store.openResource, where the table's own Calendar view shows the month.
- C10: a missing or rebound row gets "Open row in table".
- The connection menu's Disconnect calls store.proxy.disconnect: only this
  app's delegation goes; the rows stay.
- data-pl-theme follows store.getTheme()/onThemeChange() instead of the
  background's luminance (kept as the fallback for older hosts);
  --pl-pos reads --t-color-success.
All are feature-detected: an older host shows none of these controls.
The build-test limit is re-measured: 103,825 bytes, limit 112 KiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two e2e tests: the drawer's Open in Google Calendar reaches the host's
"Open a link" confirmation with the event's htmlLink; Disconnect leaves
the connection with no delegation and keeps the rows; Month opens the
app's table in the host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mock's fixture is shared by the lane's tests, so its title may be an
earlier test's; delegations are counted for this test's own agent only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, while it previews

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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