Repository navigation
Description
Summary
Product direction (confirmed):
We previously added and removed an Add to Calendar button. Let's reintroduce it as part of the registration confirmation screen. It needs to support all major providers. If possible rely on a small external library.
Reintroduce calendar export at the moment it is most wanted — right after a successful registration — rather than back into the event action row it was cut from. Today no calendar export exists at all (zero repo hits for .ics / VCALENDAR / Blob — .claude/reports/RELEASE_READINESS.md §7 and Appendix D), even though the CMS already supplies icalRule on the wire. A viewer cannot get an event into their own calendar — a real end-user portability gap.
Prior art (git archaeology)
- Added as part of the feat(event): redesign event display & registration surfaces #52/feat(event): redesign event display & registration surfaces #58 event-surfaces redesign:
93047bafeat(lib): calendar export, distance formatter, display formatting hookshipped a hand-rolled RFC 5545 builder —src/lib/ics.ts(buildEventIcs/buildGoogleCalendarUrl, RRULE + EXDATE expansion, ~294 lines + ~311 lines of tests) — and726d098put the action in the event panel's action row. Landed onmainin squashb52d831(PR feat(event): redesign event display & registration surfaces #58). - Removed end-to-end in
4f6b397feat(events)!: remove the Add to calendar action and the iCalendar export, landed onmainin6af130c(PR fix: bug sweep — dark-mode marker, drawer stack depth, event surfaces, drop Add to calendar #83). The stated shape: "Drops the feature end to end rather than hiding the CTA" — the removal was a product-scoping call from the action-row rebalance to a four-action maximum (Directions · Website · Contact · Share,996ba3c), not a technical defect. The deleted builder + its spec are recoverable:git show 4f6b397^:src/lib/ics.ts(and:src/lib/ics.test.ts). - The removal also deleted
actions.add_calendar/actions.download_icsfrom all ten locales — those translations are recoverable from4f6b397^too. - The wire contract deliberately kept the door open:
src/config/api/fetch.ts:93still selectsicalRuleon the feed, and the comment atsrc/config/api/fetch.ts:77-80notes the calendar-export-only fields (monthDay,weekdayOfMonth,untilDate,exclusions) stay off the feed — "the export runs on the full doc".src/types/event.ts:66still parsesicalRule: z.string().nullish().
Proposed changes
- Placement: the registration confirmation screen — the
submittedbranch ofRegistrationForm(src/components/organisms/RegistrationForm/RegistrationForm.tsx:87holds the state; the confirmation block renders atRegistrationForm.tsx:159-163). The form is deliberately event-decoupled ("generic and config-driven (no Event coupling)" —RegistrationForm.tsx:67);RegistrationViewalready holds the full event doc (useEventFromPath,src/views/RegistrationView/RegistrationView.tsx:53), so pass the export inputs down as props (or render the CTA block via a slot) without re-coupling the form. - Providers (all major): Google Calendar, Apple (ICS download), Outlook.com, Office 365, Yahoo.
- Library: prefer a small external one, evaluated by bundle cost first. Candidates like
calendar-link(provider-URL builder) + a tiny ICS blob generator are the expected weight class;add-to-calendar-button(a full web component) is likely too heavy. The eager payload is already 477 KiB gz (readiness report §1.1), so whatever is chosen must be lazy-loaded on the confirmation screen (dynamic import whensubmittedflips) and must not join the eager graph; its gz size must be stated in the implementation report. Hand-rolled provider-URL builders + a tiny ICS blob generator is an acceptable outcome if libraries are too heavy — the removedlib/ics.tsis a working starting point. - Recurrence must be correct. The CMS recurrence is structured and
icalRulerides the full doc — verify whaticalRuleactually contains for weekly and monthly events (and forexclusions/untilDate) before trusting it; provider URLs need the recurrence too where the provider supports it. - Localized labels via
pnpm i18n:addacross all 10 locales (cs, de, en, es, fr, hu, nl, pt-BR, ru, uk) — consider resurrecting the removed keys' translations from4f6b397^.
Acceptance criteria
- The registration confirmation screen offers add-to-calendar for Google Calendar, Apple/ICS download, Outlook.com, Office 365, and Yahoo.
- A one-off event exports with correct start/end + timezone; a weekly and a monthly event export with correct recurrence — verified against what
icalRule/ the structured schedule actually contain, with findings stated in the implementation report. - The export builds from the full event doc (
getEventviauseEventFromPath), never the trimmed feed (perfetch.ts:77-80). - The chosen library (or hand-rolled module) is lazy-loaded from the confirmation screen; the eager payload (entry + every modulepreload in
dist/index.html, gzipped, measured both ways) does not grow; the chunk's gz cost is stated in the implementation report. -
RegistrationFormstays event-decoupled — export inputs arrive via props/slot fromRegistrationView. - New labels exist across all 10 locales (added via
pnpm i18n:add). - Unit tests for the ICS / provider-URL builder in the node lane (co-located
src/lib/*.test.ts). - If the change introduces any new fetched cross-origin target (top-level provider-link navigations and
blob:downloads don't count), update the CSP table in the integrator docs (README) — additively. - Lint + typecheck +
pnpm test:runpass. - Verified in the running widget: register against the local seed, open each provider link, import the
.icsinto a real calendar app. - Write an implementation report to
.claude/reports/<issue-number>-<short-slug>.md— in the MAIN checkout at /Users/devindra/Documents/Projects/SahajAtlasWeb even when implementing from a worktree (the folder is gitignored) — covering what changed, what was deliberately NOT changed, and which readiness-report findings are resolved.
Files affected
src/components/organisms/RegistrationForm/RegistrationForm.tsx— confirmation-screen region only (a sibling a11y ticket owns the form's submit/focus logic)src/views/RegistrationView/RegistrationView.tsx— pass the event/export inputs downsrc/lib/ics.ts(new, or similarly named) +src/lib/ics.test.ts- the new lazy chunk for the export module/library
public/locales/<lng>/events.json× 10 (viapnpm i18n:add)
Parallel implementation: this ticket OWNS the files listed above; sibling release-hardening tickets run concurrently — avoid edits outside owned files except strictly additive ones.
References
.claude/reports/RELEASE_READINESS.md§7 (ICS export absent;icalRuleselected, unused), §1.1 (477 KiB gz eager payload), Appendix D- Prior implementation:
93047ba/726d098(added, PR feat(event): redesign event display & registration surfaces #58); removal4f6b397(PR fix: bug sweep — dark-mode marker, drawer stack depth, event surfaces, drop Add to calendar #83, squash6af130c) — recover withgit show 4f6b397^:src/lib/ics.ts - Issue feat(event): redesign event display & registration surfaces #52 (the redesign whose action-row rebalance de-scoped the button)
Metadata
Metadata
Assignees
Labels
Type
Fields
Hold Until
Activity