Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat(calendar): show every copy of a multi-calendar event side by side (#6212)
gbirman3ae08900bf9c
diff --git a/apps/web/src/components/app/app-sidebar/calendar-sidebar-preview.tsx b/apps/web/src/components/app/app-sidebar/calendar-sidebar-preview.tsxindex 1f5bb23cf3..1832616287 100644--- a/apps/web/src/components/app/app-sidebar/calendar-sidebar-preview.tsx+++ b/apps/web/src/components/app/app-sidebar/calendar-sidebar-preview.tsx@@ -7,9 +7,10 @@ import type { CalendarGridHandle } from '@app/features/calendar/components/Calenimport { CalendarGridSkeleton } from '@app/features/calendar/components/CalendarGridSkeleton';import { useCalendarOccurrenceData } from '@app/features/calendar/hooks/use-calendar-occurrence-data';import { useCalendarSources } from '@app/features/calendar/hooks/use-calendar-sources';-import type {- CalendarEvent,- CalendarTimeFormat,+import {+ type CalendarEvent,+ type CalendarTimeFormat,+ isCalendarEventVisible,} from '@app/features/calendar/types';import { parseLocalDate } from '@app/features/calendar/utils/calendar-date';import { groupCalendarSourcesByAccount } from '@app/features/calendar/utils/calendar-source-groups';@@ -229,7 +230,12 @@ function PreviewContent(props: { dropdownMount?: HTMLElement }) {else next.add(sourceId);return next;});- if (!visible && selectedEvent()?.calendar.id === sourceId) {+ const selected = selectedEvent();+ if (+ !visible &&+ selected &&+ !isCalendarEventVisible(selected, isSourceVisible)+ ) {setSelectedEventId(undefined);}};diff --git a/apps/web/src/features/block-calendar/components/Page.tsx b/apps/web/src/features/block-calendar/components/Page.tsxindex ecfc3ddfb9..3182e6d921 100644--- a/apps/web/src/features/block-calendar/components/Page.tsx+++ b/apps/web/src/features/block-calendar/components/Page.tsx@@ -14,8 +14,11 @@ import {} from '@app/features/calendar/hooks/use-calendar-occurrence-data';import { useCalendarTimeGridHoverIndicator } from '@app/features/calendar/hooks/use-calendar-time-grid-hover-indicator';import { useTeamOooEvents } from '@app/features/calendar/hooks/use-team-ooo';-import type { CalendarEvent } from '@app/features/calendar/types';-import { DEFAULT_CALENDAR_SOURCE } from '@app/features/calendar/types';+import {+ type CalendarEvent,+ DEFAULT_CALENDAR_SOURCE,+ isCalendarEventVisible,+} from '@app/features/calendar/types';import { isCalendarRangeSupported } from '@app/features/calendar/utils/calendar-supported-range';import {type CalendarEventTimeChange,@@ -305,7 +308,7 @@ export function Page(props: {}updateEventTime.mutate(- { eventId: event.eventId, patch: { time } },+ { eventId: event.eventId, calendarId: event.calendarId, patch: { time } },{onError: (error) => {change.revert();@@ -433,21 +436,28 @@ function CalendarPageHost(props: {[isActive(),calendarView.selectedEvent()?.id,- props.data.occurrencesQuery.dataUpdatedAt,+ props.eventsById(),] as const,- ([active, selectedEventId]) => {- if (- !active ||- !selectedEventId ||- !props.data.occurrencesQuery.isSuccess ||- props.data.occurrencesQuery.isPlaceholderData+ ([active, selectedEventId, eventsById]) => {+ if (!active || !selectedEventId) return;++ // Placeholder data is the previous range, so an absent event proves+ // nothing yet.+ const selectedEvent = eventsById.get(selectedEventId);+ if (selectedEvent) {+ if (+ isCalendarEventVisible(selectedEvent, calendarView.isSourceVisible)+ ) {+ calendarView.refreshSelectedEvent(selectedEvent);+ } else {+ calendarView.closeEventDetails();+ }+ } else if (+ props.data.occurrencesQuery.isSuccess &&+ !props.data.occurrencesQuery.isPlaceholderData) {- return;+ calendarView.closeEventDetails();}-- const selectedEvent = props.eventsById().get(selectedEventId);- if (selectedEvent) calendarView.refreshSelectedEvent(selectedEvent);- else calendarView.closeEventDetails();}));diff --git a/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsx b/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsxindex 4fcfdc4c85..7ea0424248 100644--- a/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsx+++ b/apps/web/src/features/block-calendar/components/SelectedEventDetails.tsx@@ -3,9 +3,10 @@ import {EventAttendeesSection,EventDetails,} from '@app/features/calendar/components/EventDetails';-import type {- CalendarEvent,- CalendarTimeFormat,+import {+ type CalendarEvent,+ type CalendarTimeFormat,+ reminderCalendarIdOf,} from '@app/features/calendar/types';import { MobileDrawer } from '@components/app/mobile/MobileDrawer';import { toast } from '@core/component/Toast/Toast';@@ -51,8 +52,9 @@ interface SelectedEventDetailsProps {export function SelectedEventDetails(props: SelectedEventDetailsProps) {const calendarsQuery = useVisibleCalendarsQuery();const defaultReminders = (event: CalendarEvent) =>- calendarsQuery.data?.find((calendar) => calendar.id === event.calendarId)- ?.defaultReminders;+ calendarsQuery.data?.find(+ (calendar) => calendar.id === reminderCalendarIdOf(event)+ )?.defaultReminders;const popoverSelection = createMemo(() => {const event = props.event();@@ -305,6 +307,7 @@ function DeleteEventDialog(const effectiveScope = isRecurring() ? scope() : 'all';deleteEvent.mutate({eventId: props.event.eventId,+ calendarId: props.event.calendarId,scope: effectiveScope,recurrenceId:effectiveScope === 'all'diff --git a/apps/web/src/features/block-calendar/components/SidePanelSections.tsx b/apps/web/src/features/block-calendar/components/SidePanelSections.tsxindex 0129e694db..c9a6cb0be0 100644--- a/apps/web/src/features/block-calendar/components/SidePanelSections.tsx+++ b/apps/web/src/features/block-calendar/components/SidePanelSections.tsx@@ -3,7 +3,6 @@ import { useCalendarView } from '@app/features/calendar/components/CalendarViewCimport { SourceControls } from '@app/features/calendar/components/SourceControls';import {TEAM_OOO_SOURCE_ID,- TEAM_OOO_SOURCE_PREFIX,type TeamOooWindow,useHasTeammates,useUpcomingTeamOoo,@@ -107,19 +106,8 @@ function CalendarTeamOooSidePanelSection() {const hasTeammates = useHasTeammates();const isOverlayVisible = () =>calendarView.isSourceVisible(TEAM_OOO_SOURCE_ID);- const setOverlayVisible = (visible: boolean) => {+ const setOverlayVisible = (visible: boolean) =>calendarView.setSourceVisibility(TEAM_OOO_SOURCE_ID, visible);- // Hiding the whole overlay closes a teammate event's open details, which- // the per-source close in setSourceVisibility only does for exact ids.- if (- !visible &&- calendarView- .selectedEvent()- ?.calendar.id.startsWith(TEAM_OOO_SOURCE_PREFIX)- ) {- calendarView.closeEventDetails();- }- };return (<Show when={hasTeammates()}>diff --git a/apps/web/src/features/calendar/components/CalendarGrid.tsx b/apps/web/src/features/calendar/components/CalendarGrid.tsxindex ae67cb9440..db27ed82cf 100644--- a/apps/web/src/features/calendar/components/CalendarGrid.tsx+++ b/apps/web/src/features/calendar/components/CalendarGrid.tsx@@ -13,6 +13,7 @@ import interactionPlugin from '@fullcalendar/interaction';import timeGridPlugin from '@fullcalendar/timegrid';import {type Accessor,+ createEffect,createMemo,createSignal,type JSX,@@ -203,6 +204,20 @@ export function CalendarGrid(props: CalendarGridProps) {equals: false,});+ // A chip keeps its element across data changes, so a calendar color change+ // recolors it here rather than through a remount. The map is read before+ // the loop because the element map is empty on the first run and the+ // effect would otherwise never subscribe.+ createEffect(() => {+ const eventsById = props.eventsById;+ for (const [id, el] of eventElements) {+ const event = eventsById.get(id);+ if (event) {+ el.style.setProperty('--event-calendar-color', event.calendar.color);+ }+ }+ });+return (<FullCalendar.Rootplugins={[diff --git a/apps/web/src/features/calendar/components/CalendarViewContext.tsx b/apps/web/src/features/calendar/components/CalendarViewContext.tsxindex c540feb234..ba2a696ce3 100644--- a/apps/web/src/features/calendar/components/CalendarViewContext.tsx+++ b/apps/web/src/features/calendar/components/CalendarViewContext.tsx@@ -1,14 +1,15 @@import { createAssertedContextProvider } from '@core/context/createContext';import { isMobile } from '@core/mobile/isMobile';import { makePersisted } from '@solid-primitives/storage';-import { batch, createSignal } from 'solid-js';+import { batch, createMemo, createSignal } from 'solid-js';import { createStore } from 'solid-js/store';import { useCalendarSources } from '../hooks/use-calendar-sources';-import type {- CalendarEvent,- CalendarPeriodView,- CalendarTimeFormat,- CalendarWeekStart,+import {+ type CalendarEvent,+ type CalendarPeriodView,+ type CalendarTimeFormat,+ type CalendarWeekStart,+ isCalendarEventVisible,} from '../types';import { getDefaultCalendarTimeFormat } from '../utils/time-format';@@ -77,8 +78,11 @@ export const [CalendarViewContextProvider, useCalendarView] =// Sources default to visible, so calendars discovered after a// preference was saved (or events whose calendar is still loading)// never silently disappear.+ const hiddenSourceIds = createMemo(+ () => new Set(preferences.hiddenSourceIds)+ );const isSourceVisible = (sourceId: string) =>- !preferences.hiddenSourceIds.includes(sourceId);+ !hiddenSourceIds().has(sourceId);const selection = createCalendarEventSelection();const displaySettings: CalendarDisplaySettings = {@@ -107,7 +111,12 @@ export const [CalendarViewContextProvider, useCalendarView] =: [...current, sourceId]);- if (!visible && selection.event()?.calendar.id === sourceId) {+ const selected = selection.event();+ if (+ !visible &&+ selected &&+ !isCalendarEventVisible(selected, isSourceVisible)+ ) {closeEventDetails();}};diff --git a/apps/web/src/features/calendar/components/EventDetails.tsx b/apps/web/src/features/calendar/components/EventDetails.tsxindex 1511180806..a120c582bc 100644--- a/apps/web/src/features/calendar/components/EventDetails.tsx+++ b/apps/web/src/features/calendar/components/EventDetails.tsx@@ -381,7 +381,7 @@ function EventRemindersItem(props: {resolveReminderOverrides(props.event.reminders,props.defaultReminders,- props.event.eventType+ props.event.reminderEventType ?? props.event.eventType).toSorted((a, b) => a.minutes - b.minutes));diff --git a/apps/web/src/features/calendar/components/composer/create-calendar-event-form-controller.ts b/apps/web/src/features/calendar/components/composer/create-calendar-event-form-controller.tsindex 79587e6317..f59cc8fc0d 100644--- a/apps/web/src/features/calendar/components/composer/create-calendar-event-form-controller.ts+++ b/apps/web/src/features/calendar/components/composer/create-calendar-event-form-controller.ts@@ -206,7 +206,7 @@ export function createCalendarEventFormController(values.reminders,calendarOptionFor(values.calendarId ?? effectiveCalendarId())?.defaultReminders,- values.eventType+ values.reminderEventType ?? values.eventType)));diff --git a/apps/web/src/features/calendar/components/composer/event-form-model.ts b/apps/web/src/features/calendar/components/composer/event-form-model.tsindex 14c7538cfc..45780abd24 100644--- a/apps/web/src/features/calendar/components/composer/event-form-model.ts+++ b/apps/web/src/features/calendar/components/composer/event-form-model.ts@@ -84,6 +84,8 @@ export interface EventEditorInitialValues {* settings — the provider readback does not expose the stored ones.*/outOfOffice?: EventEditorOutOfOffice;+ /** Event type of the copy `reminders` belong to. Absent for new events. */+ reminderEventType?: EventType;}/** Calendar option displayed by the event editor. */@@ -229,6 +231,7 @@ export function calendarEventToEditorInitialValues(conference: initialConferenceChoice(event),reminders: event.reminders,eventType: event.eventType,+ reminderEventType: event.reminderEventType,};}@@ -245,6 +248,7 @@ export function calendarEventToEditorInitialValues(conference: initialConferenceChoice(event),reminders: event.reminders,eventType: event.eventType,+ reminderEventType: event.reminderEventType,};}diff --git a/apps/web/src/features/calendar/hooks/use-calendar-occurrence-data.ts b/apps/web/src/features/calendar/hooks/use-calendar-occurrence-data.tsindex 33ca37b8c2..650d709006 100644--- a/apps/web/src/features/calendar/hooks/use-calendar-occurrence-data.ts+++ b/apps/web/src/features/calendar/hooks/use-calendar-occurrence-data.ts@@ -9,7 +9,8 @@ import { type Accessor, createMemo } from 'solid-js';import {type CalendarEvent,type CalendarSource,- mapCalendarOccurrence,+ isCalendarEventVisible,+ mapCalendarOccurrenceChips,} from '../types';import { isCalendarRangeSupported } from '../utils/calendar-supported-range';@@ -52,18 +53,13 @@ export function useCalendarOccurrenceData(const events = createMemo(() => {if (!isRangeSupported()) return [];const sourceById = options.sourceById?.();- return (occurrencesQuery.data?.items ?? []).map((item) =>- mapCalendarOccurrence(- item,- item.event.calendarId != null- ? sourceById?.get(item.event.calendarId)- : undefined- )+ return (occurrencesQuery.data?.items ?? []).flatMap((item) =>+ mapCalendarOccurrenceChips(item, { sourceById }));});const visibleEvents = createMemo(() =>- events().filter(- (event) => options.isSourceVisible?.(event.calendar.id) !== false+ events().filter((event) =>+ isCalendarEventVisible(event, options.isSourceVisible)));const eventsById = createMemo(diff --git a/apps/web/src/features/calendar/hooks/use-event-editor.ts b/apps/web/src/features/calendar/hooks/use-event-editor.tsindex 49eaddc89c..4f1da4596c 100644--- a/apps/web/src/features/calendar/hooks/use-event-editor.ts+++ b/apps/web/src/features/calendar/hooks/use-event-editor.ts@@ -11,8 +11,11 @@ import {type EventEditorDisabledFields,type EventEditorSubmitValues,} from '../components/composer/event-form-model';-import type { CalendarEvent } from '../types';-import { DEFAULT_CALENDAR_SOURCE } from '../types';+import {+ type CalendarEvent,+ DEFAULT_CALENDAR_SOURCE,+ reminderCalendarIdOf,+} from '../types';import {calendarDisplayLabel,spansMultipleInboxes,@@ -26,6 +29,16 @@ const EDIT_DISABLED_FIELDS = {calendar: true,} satisfies EventEditorDisabledFields;+/**+ * Whether the editor addresses the copy whose reminders Macro's alerts+ * follow and whose guests and conferencing Macro records. Another copy's+ * reminders are Google's own and never fire here, and guests or a Meet link+ * written onto another copy never reach the event Macro shows.+ */+function editsPrimaryCopy(event: CalendarEvent) {+ return reminderCalendarIdOf(event) === event.calendarId;+}+interface UseEventEditorProps {event: Accessor<CalendarEvent | undefined>;onSaved: () => void;@@ -58,15 +71,19 @@ export function useEventEditor(props: UseEventEditorProps) {const event = props.event();if (event) {const calendarId = event.calendarId ?? event.calendar.id;- const calendar = calendarsQuery.data?.find(+ const calendars = calendarsQuery.data ?? [];+ const calendar = calendars.find((candidate) => candidate.id === calendarId);+ const reminderCalendar = calendars.find(+ (candidate) => candidate.id === reminderCalendarIdOf(event)+ );return [{id: calendarId,label: event.calendar.name || 'Calendar',color: event.calendar.color,- defaultReminders: calendar?.defaultReminders,+ defaultReminders: reminderCalendar?.defaultReminders,isPrimary: calendar?.isPrimary ?? event.calendar.isPrimary,},];@@ -107,6 +124,7 @@ export function useEventEditor(props: UseEventEditorProps) {update.mutate({eventId: event.eventId,+ calendarId: event.calendarId,patch: {title: values.title,time: values.time,@@ -150,9 +168,12 @@ export function useEventEditor(props: UseEventEditorProps) {() => {const event = props.event();if (!event) return undefined;+ const editsOtherCopy = !editsPrimaryCopy(event);return {...EDIT_DISABLED_FIELDS,- guests: !viewerCanEditGuests(event),+ guests: editsOtherCopy || !viewerCanEditGuests(event),+ conference: editsOtherCopy,+ reminders: editsOtherCopy,};});diff --git a/apps/web/src/features/calendar/hooks/use-team-ooo.ts b/apps/web/src/features/calendar/hooks/use-team-ooo.tsindex 4c01cd9883..46f16414ce 100644--- a/apps/web/src/features/calendar/hooks/use-team-ooo.ts+++ b/apps/web/src/features/calendar/hooks/use-team-ooo.ts@@ -17,7 +17,7 @@ import { isCalendarRangeSupported } from '../utils/calendar-supported-range';export const TEAM_OOO_SOURCE_ID = 'team-ooo';/** Prefix of every per-teammate visibility-source id. */-export const TEAM_OOO_SOURCE_PREFIX = 'team-ooo:';+const TEAM_OOO_SOURCE_PREFIX = 'team-ooo:';const TEAM_OOO_COLOR = 'var(--color-ink-muted)';const TEAM_OOO_FALLBACK_TITLE = 'Out of office';@@ -57,6 +57,7 @@ function mapTeamOooItem(item: TeamOutOfOfficeItem): CalendarEvent {isReadOnly: true,attendees: [],recurrenceLines: [],+ sourceCalendarIds: [TEAM_OOO_SOURCE_ID],eventType: EventType.out_of_office,timeZone: time.kind === 'timed' ? (time.timeZone ?? undefined) : undefined,title: name ? `${name}: ${title}` : title,diff --git a/apps/web/src/features/calendar/types.test.ts b/apps/web/src/features/calendar/types.test.tsnew file mode 100644index 0000000000..8249ff4fb3--- /dev/null+++ b/apps/web/src/features/calendar/types.test.ts@@ -0,0 +1,215 @@+import type { CalendarEventSourceContent } from '@service-storage/generated/schemas/calendarEventSourceContent';+import type { CalendarOccurrenceItem } from '@service-storage/generated/schemas/calendarOccurrenceItem';+import { describe, expect, it } from 'vitest';+import {+ type CalendarEvent,+ type CalendarSource,+ isCalendarEventVisible,+ mapCalendarEventToFullCalendar,+ mapCalendarOccurrenceChips,+} from './types';++const PRIMARY: CalendarSource = {+ id: 'primary',+ name: '[email protected]',+ color: 'blue',+ isPrimary: true,+};+const SHARED: CalendarSource = {+ id: 'shared',+ name: 'Macro Vacation',+ color: 'orange',+};+const sourceById = new Map([+ [PRIMARY.id, PRIMARY],+ [SHARED.id, SHARED],+]);++function copy(+ calendarId: string,+ overrides: Partial<CalendarEventSourceContent> = {}+): CalendarEventSourceContent {+ return {+ calendarId,+ title: 'OOO',+ eventType: 'out_of_office',+ visibility: 'private',+ transparency: 'opaque',+ isReadOnly: false,+ reminders: {+ useDefault: false,+ overrides: [{ method: 'popup', minutes: 30 }],+ },+ creatorEmail: '[email protected]',+ ...overrides,+ };+}++const sharedCopy = copy('shared', {+ title: '[teo] OOO',+ eventType: 'default',+ isReadOnly: true,+ transparency: 'transparent',+ reminders: { useDefault: false, overrides: [] },+ creatorEmail: '[email protected]',+});++function item(sources: CalendarEventSourceContent[]): CalendarOccurrenceItem {+ return {+ event: {+ id: 'event',+ ownerId: 'macro|[email protected]',+ icalUid: 'uid',+ calendarId: sources[0]?.calendarId,+ sources,+ title: 'OOO',+ status: 'confirmed',+ visibility: 'private',+ transparency: 'opaque',+ eventType: 'out_of_office',+ time: {+ kind: 'timed',+ startsAt: '2026-09-10T13:00:00Z',+ endsAt: '2026-09-10T14:00:00Z',+ },+ recurrenceLines: [],+ sequence: 0,+ isReadOnly: false,+ attendees: [],+ createdAt: '2026-09-01T00:00:00Z',+ updatedAt: '2026-09-01T00:00:00Z',+ },+ occurrence: {+ eventId: 'event',+ occurrenceKey: '2026-09-10T13:00:00+00:00',+ time: {+ kind: 'timed',+ startsAt: '2026-09-10T13:00:00Z',+ endsAt: '2026-09-10T14:00:00Z',+ },+ isCancelled: false,+ },+ };+}++const hidden = (...ids: string[]) => {+ const set = new Set(ids);+ return (id: string) => !set.has(id);+};++describe('mapCalendarOccurrenceChips', () => {+ it('renders one chip per calendar copy, each with its own content', () => {+ const [primary, shared] = mapCalendarOccurrenceChips(+ item([copy('primary'), sharedCopy]),+ { sourceById }+ );++ expect(primary.calendar).toBe(PRIMARY);+ expect(primary.calendarId).toBe('primary');+ expect(primary.title).toBe('OOO');+ expect(primary.eventType).toBe('out_of_office');+ expect(primary.isReadOnly).toBe(false);+ expect(primary.creatorEmail).toBe('[email protected]');+ expect(primary.sourceCalendarIds).toEqual(['primary']);+ expect(shared.calendar).toBe(SHARED);+ expect(shared.calendarId).toBe('shared');+ expect(shared.title).toBe('[teo] OOO');+ expect(shared.eventType).toBe('default');+ expect(shared.isReadOnly).toBe(true);+ expect(shared.creatorEmail).toBe('[email protected]');+ expect(shared.sourceCalendarIds).toEqual(['shared']);+ });++ it('gives each copy its own identity on the shared occurrence', () => {+ const [primary, shared] = mapCalendarOccurrenceChips(+ item([copy('primary'), sharedCopy]),+ { sourceById }+ );++ expect(JSON.parse(primary.id)).toEqual([+ 'event',+ '2026-09-10T13:00:00+00:00',+ 'primary',+ ]);+ expect(JSON.parse(shared.id)).toEqual([+ 'event',+ '2026-09-10T13:00:00+00:00',+ 'shared',+ ]);+ expect(shared.eventId).toBe(primary.eventId);+ expect(shared.occurrenceKey).toBe(primary.occurrenceKey);+ });++ it('keeps the reminders that fire on the primary copy on every chip', () => {+ const chips = mapCalendarOccurrenceChips(+ item([copy('primary'), sharedCopy]),+ { sourceById }+ );++ for (const chip of chips) {+ expect(chip.reminders?.overrides).toEqual([+ { method: 'popup', minutes: 30 },+ ]);+ expect(chip.reminderCalendarId).toBe('primary');+ expect(chip.reminderEventType).toBe('out_of_office');+ }+ });++ it('renders a single-copy event as one chip with the plain occurrence id', () => {+ const chips = mapCalendarOccurrenceChips(item([copy('primary')]), {+ sourceById,+ });++ expect(chips).toHaveLength(1);+ expect(chips[0].id).toBe('["event","2026-09-10T13:00:00+00:00"]');+ expect(chips[0].sourceCalendarIds).toEqual(['primary']);+ });++ it('reads the entity when no copy data is present', () => {+ const [event] = mapCalendarOccurrenceChips(item([]), { sourceById });++ expect(event.title).toBe('OOO');+ expect(event.calendarId).toBeUndefined();+ expect(event.reminderEventType).toBe('out_of_office');+ expect(event.sourceCalendarIds).toEqual([]);+ });+});++describe('isCalendarEventVisible', () => {+ const merged = {+ calendar: SHARED,+ sourceCalendarIds: ['primary', 'shared'],+ } satisfies Pick<CalendarEvent, 'calendar' | 'sourceCalendarIds'>;++ it('stays visible while any of its calendars is shown', () => {+ expect(isCalendarEventVisible(merged, hidden('shared'))).toBe(true);+ expect(isCalendarEventVisible(merged, hidden('primary'))).toBe(true);+ });++ it('hides only when every calendar is hidden', () => {+ expect(isCalendarEventVisible(merged, hidden('primary', 'shared'))).toBe(+ false+ );+ });++ it('falls back to the displayed calendar without copy data', () => {+ const legacy = { calendar: SHARED, sourceCalendarIds: [] };+ expect(isCalendarEventVisible(legacy, hidden('shared'))).toBe(false);+ expect(isCalendarEventVisible(legacy, hidden('other'))).toBe(true);+ });+});++describe('mapCalendarEventToFullCalendar', () => {+ it('keeps each copy identity and title on the rendered event', () => {+ const [primary, shared] = mapCalendarOccurrenceChips(+ item([copy('primary'), sharedCopy]),+ { sourceById }+ ).map(mapCalendarEventToFullCalendar);++ expect(primary.id).toBe('["event","2026-09-10T13:00:00+00:00","primary"]');+ expect(shared.id).toBe('["event","2026-09-10T13:00:00+00:00","shared"]');+ expect(shared.title).toBe('[teo] OOO');+ expect(primary.extendedProps?.calendarEventId).toBe(primary.id);+ expect(shared.extendedProps?.calendarEventId).toBe(shared.id);+ });+});diff --git a/apps/web/src/features/calendar/types.ts b/apps/web/src/features/calendar/types.tsindex a355e05701..ce20cda092 100644--- a/apps/web/src/features/calendar/types.ts+++ b/apps/web/src/features/calendar/types.ts@@ -1,5 +1,6 @@import type { EventInput } from '@fullcalendar/core';import type { CalendarAttendee } from '@service-storage/generated/schemas/calendarAttendee';+import type { CalendarEventSourceContent } from '@service-storage/generated/schemas/calendarEventSourceContent';import type { CalendarOccurrenceItem } from '@service-storage/generated/schemas/calendarOccurrenceItem';import type { EventReminders } from '@service-storage/generated/schemas/eventReminders';import type { EventType } from '@service-storage/generated/schemas/eventType';@@ -51,7 +52,7 @@ export interface CalendarEvent {recurrenceId?: string;/** Whether this materialized occurrence was cancelled. */isCancelled: boolean;- /** Whether the canonical event source is read-only. */+ /** Whether the displayed copy's calendar prohibits editing it. */isReadOnly: boolean;/** Direct conference join URL, when available. */conferenceUrl?: string;@@ -70,12 +71,28 @@ export interface CalendarEvent {creatorEmail?: string;/** Attendees and their RSVP metadata. */attendees: CalendarAttendee[];- /** Per-user reminder configuration; absent means the calendar default. */+ /**+ * Reminder configuration of the primary copy, the one Macro's alerts+ * follow whichever copy a chip shows. Absent means the calendar default.+ */reminders?: EventReminders;+ /** Calendar whose defaults `reminders` resolve against: the primary copy's. */+ reminderCalendarId?: string;+ /**+ * Event type of the primary copy. Status types such as out of office never+ * resolve `reminders` to the calendar defaults.+ */+ reminderEventType?: EventType;/** Provider event type; absent means a regular event. */eventType?: EventType;- /** Canonical calendar entity id, for resolving default reminders. */+ /** Calendar of the copy this chip shows. Mutations address that copy. */calendarId?: string;+ /**+ * Calendars whose visibility governs this chip: the copy's own calendar,+ * or the overlay id for a teammate's out-of-office event. Empty when the+ * event has no copy data, in which case `calendar` decides.+ */+ sourceCalendarIds: string[];/** Raw recurrence rules attached to the canonical event. */recurrenceLines: string[];/** Original IANA timezone for a timed occurrence. */@@ -107,10 +124,60 @@ function optionalText(value: string | null | undefined) {return value ?? undefined;}-/** Maps one backend occurrence projection into the calendar event model. */-export function mapCalendarOccurrence(+/** How an occurrence's chips resolve the calendars they belong to. */+interface CalendarOccurrenceMappingOptions {+ sourceById?: ReadonlyMap<string, CalendarSource>;+}++/**+ * Whether an event renders under a per-source visibility predicate: it+ * stays visible while any of its calendars is shown. The displayed calendar+ * is the fallback for events without copy data.+ */+export function isCalendarEventVisible(+ event: Pick<CalendarEvent, 'calendar' | 'sourceCalendarIds'>,+ isSourceVisible?: (sourceId: string) => boolean+): boolean {+ if (!isSourceVisible) return true;+ const sourceIds =+ event.sourceCalendarIds.length > 0+ ? event.sourceCalendarIds+ : [event.calendar.id];+ return sourceIds.some(isSourceVisible);+}++/** Calendar whose defaults the event's reminders resolve against. */+export function reminderCalendarIdOf(+ event: Pick<CalendarEvent, 'reminderCalendarId' | 'calendarId'>+) {+ return event.reminderCalendarId ?? event.calendarId;+}++/**+ * Maps one backend occurrence projection into the chips it renders as: one+ * per calendar the event is synced from, each carrying that copy's content,+ * so an event on several calendars sits side by side the way the provider+ * shows it. The entity carries the canonical copy's content, so an event+ * with no copy data reads the same as its only copy.+ */+export function mapCalendarOccurrenceChips(item: CalendarOccurrenceItem,- source: CalendarSource = DEFAULT_CALENDAR_SOURCE+ options: CalendarOccurrenceMappingOptions = {}+): CalendarEvent[] {+ const sources = item.event.sources ?? [];+ if (sources.length <= 1) {+ return [buildCalendarEvent(item, options, sources[0], undefined)];+ }+ return sources.map((copy) =>+ buildCalendarEvent(item, options, copy, copy.calendarId)+ );+}++function buildCalendarEvent(+ item: CalendarOccurrenceItem,+ options: CalendarOccurrenceMappingOptions,+ copy: CalendarEventSourceContent | undefined,+ chipCalendarId: string | undefined): CalendarEvent {const { event, occurrence } = item;const time = occurrence.time;@@ -118,33 +185,45 @@ export function mapCalendarOccurrence(time.kind === 'timed'? { allDay: false, start: time.startsAt, end: time.endsAt }: { allDay: true, start: time.startDate, end: time.endDate };+ const content = copy ?? event;+ const canonical = event.sources?.[0] ?? event;+ const calendarId = copy?.calendarId ?? event.calendarId ?? undefined;+ const source =+ (calendarId ? options.sourceById?.get(calendarId) : undefined) ??+ DEFAULT_CALENDAR_SOURCE;return {...range,- id: JSON.stringify([event.id, occurrence.occurrenceKey]),+ id:+ chipCalendarId === undefined+ ? JSON.stringify([event.id, occurrence.occurrenceKey])+ : JSON.stringify([event.id, occurrence.occurrenceKey, chipCalendarId]),eventId: event.id,occurrenceKey: occurrence.occurrenceKey,recurrenceId: occurrence.recurrenceId ?? undefined,recurrenceLines: event.recurrenceLines ?? [],isCancelled: occurrence.isCancelled,- isReadOnly: event.isReadOnly,+ isReadOnly: content.isReadOnly,conferenceUrl: event.conferenceUrl ?? undefined,conferenceProvider:(event.conferenceProvider as ConferenceProvider | null | undefined) ??undefined,organizerName: event.organizerName ?? undefined,organizerEmail: event.organizerEmail ?? undefined,- creatorName: optionalText(event.creatorName),- creatorEmail: optionalText(event.creatorEmail),+ creatorName: optionalText(content.creatorName),+ creatorEmail: optionalText(content.creatorEmail),attendees: event.attendees ?? [],- reminders: event.reminders ?? undefined,- eventType: event.eventType ?? undefined,- calendarId: event.calendarId ?? undefined,+ reminders: canonical.reminders ?? undefined,+ reminderCalendarId: canonical.calendarId ?? undefined,+ reminderEventType: canonical.eventType ?? undefined,+ eventType: content.eventType ?? undefined,+ calendarId,+ sourceCalendarIds: copy ? [copy.calendarId] : [],timeZone: time.kind === 'timed' ? (time.timeZone ?? undefined) : undefined,- title: event.title,+ title: content.title,calendar: source,- location: event.location ?? undefined,- description: event.description ?? undefined,+ location: content.location ?? undefined,+ description: content.description ?? undefined,};}diff --git a/apps/web/src/features/calendar/utils/event-attribution.test.ts b/apps/web/src/features/calendar/utils/event-attribution.test.tsindex c5b46224c0..401cb2a519 100644--- a/apps/web/src/features/calendar/utils/event-attribution.test.ts+++ b/apps/web/src/features/calendar/utils/event-attribution.test.ts@@ -11,6 +11,7 @@ function event(overrides: Partial<CalendarEvent>): CalendarEvent {isReadOnly: false,attendees: [],recurrenceLines: [],+ sourceCalendarIds: [],title: 'd',start: '2026-08-27T19:00:00.000Z',end: '2026-08-27T20:45:00.000Z',diff --git a/apps/web/src/features/calendar/utils/event-guest-editing.test.ts b/apps/web/src/features/calendar/utils/event-guest-editing.test.tsindex 50832d8a6f..a59495db8e 100644--- a/apps/web/src/features/calendar/utils/event-guest-editing.test.ts+++ b/apps/web/src/features/calendar/utils/event-guest-editing.test.ts@@ -23,6 +23,7 @@ function event(overrides: Partial<CalendarEvent>): CalendarEvent {isReadOnly: false,attendees: [],recurrenceLines: [],+ sourceCalendarIds: [],title: 'Sync',start: '2026-08-27T19:00:00.000Z',end: '2026-08-27T20:00:00.000Z',diff --git a/apps/web/src/features/calendar/utils/working-location-events.test.ts b/apps/web/src/features/calendar/utils/working-location-events.test.tsindex 0952ad1410..28c404979f 100644--- a/apps/web/src/features/calendar/utils/working-location-events.test.ts+++ b/apps/web/src/features/calendar/utils/working-location-events.test.ts@@ -33,6 +33,7 @@ function event(isReadOnly: true,attendees: [],recurrenceLines: ['RRULE:FREQ=WEEKLY'],+ sourceCalendarIds: [],title: overrides.title ?? 'Office',start,end,diff --git a/apps/web/src/lib/core/component/AI/component/tool/calendar/event-preview-model.ts b/apps/web/src/lib/core/component/AI/component/tool/calendar/event-preview-model.tsindex 84e705b6aa..eea56545f8 100644--- a/apps/web/src/lib/core/component/AI/component/tool/calendar/event-preview-model.ts+++ b/apps/web/src/lib/core/component/AI/component/tool/calendar/event-preview-model.ts@@ -59,8 +59,7 @@ export function buildCalendarToolPreviewEvent(return {...range,- // FullCalendar only reapplies the event color when an event remounts.- id: JSON.stringify([input.id, calendar.id, calendar.color]),+ id: input.id,eventId: input.id,occurrenceKey: input.id,isCancelled: false,@@ -69,6 +68,7 @@ export function buildCalendarToolPreviewEvent(recurrenceLines: input.recurrenceLines ?? input.values.recurrenceLines,calendarId: input.calendar?.id ?? input.values.calendarId,eventType: input.values.eventType,+ sourceCalendarIds: [],title: input.values.title.trim() || 'New event',calendar,location: input.values.location || undefined,diff --git a/apps/web/src/lib/queries/calendar/mutations.ts b/apps/web/src/lib/queries/calendar/mutations.tsindex b8ba3af712..befdb4767f 100644--- a/apps/web/src/lib/queries/calendar/mutations.ts+++ b/apps/web/src/lib/queries/calendar/mutations.ts@@ -10,6 +10,7 @@ import type { CalendarEvent as CalendarEventEntity } from '@service-email/generaimport type { CreateCalendarEventRequest } from '@service-email/generated/schemas/createCalendarEventRequest';import type { UpdateCalendarEventRequest } from '@service-email/generated/schemas/updateCalendarEventRequest';import type { AttendeeResponseStatus } from '@service-storage/generated/schemas/attendeeResponseStatus';+import type { CalendarEventSourceContent } from '@service-storage/generated/schemas/calendarEventSourceContent';import type { CalendarOccurrenceItem } from '@service-storage/generated/schemas/calendarOccurrenceItem';import type { EventTime } from '@service-storage/generated/schemas/eventTime';import { useMutation } from '@tanstack/solid-query';@@ -41,10 +42,7 @@ async function patchOccurrenceCaches(const previous = queryClient.getQueriesData<CalendarOccurrencesData>({queryKey: calendarKeys.occurrences._def,});- queryClient.setQueriesData<CalendarOccurrencesData>(- { queryKey: calendarKeys.occurrences._def },- (old) => old && { ...old, items: update(old.items) }- );+ patchOccurrenceQueries(update);return {rollback: () => {for (const [queryKey, data] of previous) {@@ -59,7 +57,9 @@ function patchEventItems(patch: (item: CalendarOccurrenceItem) => CalendarOccurrenceItem) {return (items: CalendarOccurrenceItem[]) =>- items.map((item) => (item.event.id === eventId ? patch(item) : item));+ items.some((item) => item.event.id === eventId)+ ? items.map((item) => (item.event.id === eventId ? patch(item) : item))+ : items;}export interface RsvpCalendarEventArgs {@@ -145,7 +145,11 @@ function patchOccurrenceQueries() {queryClient.setQueriesData<CalendarOccurrencesData>({ queryKey: calendarKeys.occurrences._def },- (old) => old && { ...old, items: update(old.items) }+ (old) => {+ if (!old) return old;+ const items = update(old.items);+ return items === old.items ? old : { ...old, items };+ });}@@ -264,6 +268,8 @@ export function useRsvpCalendarEventMutation(callbacks?: RsvpCallbacks) {export interface DeleteCalendarEventArgs {eventId: string;+ /** Calendar whose copy of the event is deleted. Omit for the canonical copy. */+ calendarId?: string;/** How much of a recurring series to remove; defaults to all of it. */scope?: CalendarDeletionScope;/** Original-start key of the occurrence a scoped deletion targets. */@@ -288,6 +294,66 @@ function survivesDeletion(return false;}+/** The entity fields the server re-projects from the copy that becomes canonical. */+function canonicalContentOf(+ copy: CalendarEventSourceContent+): Partial<CalendarOccurrenceItem['event']> {+ return {+ calendarId: copy.calendarId,+ title: copy.title,+ description: copy.description,+ location: copy.location,+ eventType: copy.eventType,+ reminders: copy.reminders,+ isReadOnly: copy.isReadOnly,+ transparency: copy.transparency,+ visibility: copy.visibility,+ creatorName: copy.creatorName,+ creatorEmail: copy.creatorEmail,+ };+}++/**+ * Cached items after an optimistic deletion. Deleting a whole event that is+ * one copy among several retires only that copy at the provider, so the+ * event stays under its remaining calendars with that copy dropped and, when+ * the copy was canonical, the entity re-projected from the next one.+ * Everything else removes the covered occurrences.+ */+function applyDeletion(+ items: CalendarOccurrenceItem[],+ args: DeleteCalendarEventArgs+): CalendarOccurrenceItem[] {+ if (!items.some((item) => item.event.id === args.eventId)) return items;+ return items.flatMap((item) => {+ if (item.event.id !== args.eventId) return [item];+ const sources = item.event.sources ?? [];+ const targetCalendarId = args.calendarId ?? sources[0]?.calendarId;+ const remaining = sources.filter(+ (copy) => copy.calendarId !== targetCalendarId+ );+ const [nextCanonical] = remaining;+ if (+ (args.scope ?? 'all') !== 'all' ||+ !nextCanonical ||+ remaining.length === sources.length+ ) {+ return survivesDeletion(item, args) ? [item] : [];+ }+ const removesCanonical = targetCalendarId === sources[0]?.calendarId;+ return [+ {+ ...item,+ event: {+ ...item.event,+ ...(removesCanonical ? canonicalContentOf(nextCanonical) : {}),+ sources: remaining,+ },+ },+ ];+ });+}+type DeleteCallbacks = MutationCallbacks<unknown,Error,@@ -301,6 +367,7 @@ export function useDeleteCalendarEventMutation(callbacks?: DeleteCallbacks) {mutationFn: async (args: DeleteCalendarEventArgs) =>await throwOnErr(() =>emailClient.deleteCalendarEvent(args.eventId, {+ calendarId: args.calendarId,scope: args.scope,recurrenceId: args.recurrenceId,})@@ -313,9 +380,7 @@ export function useDeleteCalendarEventMutation(callbacks?: DeleteCallbacks) {>({onMutate: (args) =>- patchOccurrenceCaches((items) =>- items.filter((item) => survivesDeletion(item, args))- ),+ patchOccurrenceCaches((items) => applyDeletion(items, args)),onError: (_error, _args, context) => context?.rollback(),onSettled: (_data, _error, args) => {invalidateCalendarEventPreviews(args.eventId);@@ -329,7 +394,9 @@ export function useDeleteCalendarEventMutation(callbacks?: DeleteCallbacks) {export interface UpdateCalendarEventArgs {eventId: string;- patch: UpdateCalendarEventRequest;+ /** Calendar whose copy of the event is patched. Omit for the canonical copy. */+ calendarId?: string;+ patch: Omit<UpdateCalendarEventRequest, 'calendarId'>;}type UpdateCallbacks = MutationCallbacks<@@ -339,27 +406,53 @@ type UpdateCallbacks = MutationCallbacks<CalendarMutationContext>;-/**- * Applies the field patch to a cached item. Times are only patched through- * to standalone occurrences — recurring expansion is the provider's job, so- * recurring series keep their cached instances until the refetch lands.- */-function applyEventPatch(- item: CalendarOccurrenceItem,- patch: UpdateCalendarEventRequest-): CalendarOccurrenceItem {- const event = { ...item.event };+/** The per-copy fields a patch rewrites on one copy of the event. */+function applyCopyPatch<+ T extends Pick<+ CalendarEventEntity,+ 'title' | 'description' | 'location' | 'reminders'+ >,+>(copy: T, patch: UpdateCalendarEventArgs['patch']): T {+ const next = { ...copy };if (patch.title !== undefined && patch.title !== null) {- event.title = patch.title;+ next.title = patch.title;}if (patch.description !== undefined) {- event.description = patch.description;+ next.description = patch.description;}if (patch.location !== undefined) {- event.location = patch.location;+ next.location = patch.location;}if (patch.reminders !== undefined && patch.reminders !== null) {- event.reminders = patch.reminders;+ next.reminders = patch.reminders;+ }+ return next;+}++/**+ * Applies the field patch to a cached item. Per-copy fields land on the+ * addressed copy — the named calendar's, else the canonical (first) one —+ * and on the entity when that copy is canonical, mirroring how the server+ * records them. Times are only patched through to standalone occurrences —+ * recurring expansion is the provider's job, so recurring series keep their+ * cached instances until the refetch lands.+ */+function applyEventPatch(+ item: CalendarOccurrenceItem,+ args: UpdateCalendarEventArgs+): CalendarOccurrenceItem {+ const { patch } = args;+ const sources = item.event.sources ?? [];+ const targetCalendarId = args.calendarId ?? sources[0]?.calendarId;+ const patchesCanonical =+ sources.length === 0 || targetCalendarId === sources[0]?.calendarId;+ const event = patchesCanonical+ ? applyCopyPatch(item.event, patch)+ : { ...item.event };+ if (sources.length > 0) {+ event.sources = sources.map((copy) =>+ copy.calendarId === targetCalendarId ? applyCopyPatch(copy, patch) : copy+ );}const time = patch.time ?? undefined;const isStandalone =@@ -381,7 +474,10 @@ export function useUpdateCalendarEventMutation(callbacks?: UpdateCallbacks) {return useMutation(() => ({mutationFn: async (args: UpdateCalendarEventArgs) =>await throwOnErr(() =>- emailClient.updateCalendarEvent(args.eventId, args.patch)+ emailClient.updateCalendarEvent(args.eventId, {+ ...args.patch,+ calendarId: args.calendarId,+ })),...withCallbacks<CalendarEventEntity,@@ -392,9 +488,7 @@ export function useUpdateCalendarEventMutation(callbacks?: UpdateCallbacks) {{onMutate: (args) =>patchOccurrenceCaches(- patchEventItems(args.eventId, (item) =>- applyEventPatch(item, args.patch)- )+ patchEventItems(args.eventId, (item) => applyEventPatch(item, args))),onError: (_error, _args, context) => context?.rollback(),onSettled: (_data, _error, args) => {diff --git a/apps/web/src/lib/queries/calendar/tests/mutations.test.tsx b/apps/web/src/lib/queries/calendar/tests/mutations.test.tsxindex 798332f1d5..ad1d2ee6ae 100644--- a/apps/web/src/lib/queries/calendar/tests/mutations.test.tsx+++ b/apps/web/src/lib/queries/calendar/tests/mutations.test.tsx@@ -106,6 +106,42 @@ const recurringItem = (): CalendarOccurrenceItem =>},}) as unknown as CalendarOccurrenceItem;+const copy = (calendarId: string, title: string) => ({+ calendarId,+ title,+ eventType: 'default',+ visibility: 'default',+ transparency: 'opaque',+ isReadOnly: false,+ reminders: { useDefault: true, overrides: [] },+});++const sharedItem = (): CalendarOccurrenceItem =>+ ({+ event: {+ id: 'event-3',+ title: 'OOO',+ recurrenceLines: [],+ calendarId: 'primary',+ sources: [copy('primary', 'OOO'), copy('shared', '[me] OOO')],+ time: {+ kind: 'timed',+ startsAt: '2026-08-07T13:00:00Z',+ endsAt: '2026-08-07T17:00:00Z',+ },+ attendees: [],+ },+ occurrence: {+ eventId: 'event-3',+ occurrenceKey: '2026-08-07T13:00:00Z',+ time: {+ kind: 'timed',+ startsAt: '2026-08-07T13:00:00Z',+ endsAt: '2026-08-07T17:00:00Z',+ },+ },+ }) as unknown as CalendarOccurrenceItem;+const seedViewports = () => {const data = (): CalendarOccurrencesData => ({items: [standaloneItem(), recurringItem()],@@ -483,6 +519,50 @@ describe('useDeleteCalendarEventMutation', () => {expect(items).toHaveLength(2);}});++ it('drops only the addressed copy of a multi-calendar event', async () => {+ deleteCalendarEventMock.mockResolvedValue(ok({}));+ testQueryClient.setQueryData(+ calendarKeys.occurrences('user', viewportA).queryKey,+ { items: [sharedItem()], syncStatus: 'ready' }+ );+ const remove = renderHook(() => useDeleteCalendarEventMutation());++ await remove.mutateAsync({ eventId: 'event-3', calendarId: 'primary' });+ expect(deleteCalendarEventMock).toHaveBeenCalledWith('event-3', {+ calendarId: 'primary',+ scope: undefined,+ recurrenceId: undefined,+ });+ let items = viewportData(viewportA)?.items ?? [];+ expect(items).toHaveLength(1);+ expect(items[0].event.sources?.map((source) => source.calendarId)).toEqual([+ 'shared',+ ]);+ expect(items[0].event.calendarId).toBe('shared');+ expect(items[0].event.title).toBe('[me] OOO');++ await remove.mutateAsync({ eventId: 'event-3', calendarId: 'shared' });+ items = viewportData(viewportA)?.items ?? [];+ expect(items).toHaveLength(0);+ });++ it('drops the canonical copy when no calendar is named', async () => {+ deleteCalendarEventMock.mockResolvedValue(ok({}));+ testQueryClient.setQueryData(+ calendarKeys.occurrences('user', viewportA).queryKey,+ { items: [sharedItem()], syncStatus: 'ready' }+ );+ const remove = renderHook(() => useDeleteCalendarEventMutation());++ await remove.mutateAsync({ eventId: 'event-3' });+ const items = viewportData(viewportA)?.items ?? [];+ expect(items).toHaveLength(1);+ expect(items[0].event.sources?.map((source) => source.calendarId)).toEqual([+ 'shared',+ ]);+ expect(items[0].event.calendarId).toBe('shared');+ });});describe('useUpdateCalendarEventMutation', () => {diff --git a/apps/web/src/lib/service-clients/service-email/client.ts b/apps/web/src/lib/service-clients/service-email/client.tsindex 97043a57f4..08fe046f8a 100644--- a/apps/web/src/lib/service-clients/service-email/client.ts+++ b/apps/web/src/lib/service-clients/service-email/client.ts@@ -613,7 +613,11 @@ export const emailClient = {},async deleteCalendarEvent(eventId: string,- options?: { scope?: CalendarDeletionScope; recurrenceId?: string }+ options?: {+ scope?: CalendarDeletionScope;+ recurrenceId?: string;+ calendarId?: string;+ }) {const params = new URLSearchParams();if (options?.scope && options.scope !== 'all') {@@ -622,6 +626,9 @@ export const emailClient = {if (options?.recurrenceId) {params.set('recurrenceId', options.recurrenceId);}+ if (options?.calendarId) {+ params.set('calendarId', options.calendarId);+ }const query = params.toString();return fetchWithToken<EmptyResponse, CalendarMutationErrorCode>(`${emailHost}/calendar/events/${eventId}${query ? `?${query}` : ''}`,diff --git a/docs/AGENT_GUIDE/surfaces.md b/docs/AGENT_GUIDE/surfaces.mdindex e1c2194012..4193df1a82 100644--- a/docs/AGENT_GUIDE/surfaces.md+++ b/docs/AGENT_GUIDE/surfaces.md@@ -56,6 +56,15 @@ out-of-office event's decline settings can still be changed — they read as unsprovider does not report the stored ones. Out-of-office events render on the grid as solidchips filled with their calendar color (like Google), unlike regular events' outlined chips,and their details card shows an `Out of office` line under the schedule.+An event that Google carries on several of an account's calendars (a shared calendar's+re-import of a member's own event, for example) renders once per calendar, side by side,+the way Google Calendar shows it: each chip carries its own copy's title, color, and+editability, and hiding a calendar hides its chip. Reminders, guests, and conferencing+always show and follow the primary copy, since that is the copy Macro's alerts fire from+and whose guest list and join link Macro records, and the editor only lets them be changed+there. Answering an invitation likewise addresses the primary copy. The details popover and+the editor act on the chip's copy, so editing or deleting it targets that calendar's event+at Google.Teammates' Google Calendar out-of-office events overlay the grid as read-only chips titled`<name>: <event title>`. The side panel's `Team out of office` section (shown only when the