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
fix(calendar): stop offering Add to calendar once you have asked to join (#8635)
gbirman43d85d839cee
diff --git a/apps/web/src/features/calendar-view/components/SharedEventActions.test.tsx b/apps/web/src/features/calendar-view/components/SharedEventActions.test.tsxindex bdf8d2b0e0..cafe3f2c34 100644--- a/apps/web/src/features/calendar-view/components/SharedEventActions.test.tsx+++ b/apps/web/src/features/calendar-view/components/SharedEventActions.test.tsx@@ -298,6 +298,38 @@ describe('shared event actions', () => {expect(screen.getByText('Invited')).toBeTruthy();});+ it('offers no Add to calendar while a request to join is outstanding', () => {+ mocks.calendars = [calendar({})];+ const [status, setStatus] = createSignal<+ 'pending' | 'accepted' | 'declined' | undefined+ >();+ render(() => (+ <SharedEventActions+ eventId="shared-event"+ title="Design review"+ canRequestToJoin+ joinRequestStatus={status()}+ onAdded={vi.fn()}+ />+ ));+ const addButton = () =>+ screen.queryByRole('button', { name: 'Add to calendar' });+ expect(addButton()).toBeTruthy();++ fireEvent.click(screen.getByRole('button', { name: 'Ask to join' }));+ expect(addButton()).toBeNull();+ expect(screen.getByRole('button', { name: 'Download .ics' })).toBeTruthy();++ setStatus('pending');+ expect(addButton()).toBeNull();++ setStatus('accepted');+ expect(addButton()).toBeNull();++ setStatus('declined');+ expect(addButton()).toBeTruthy();+ });+it('explains instead of offering to ask when the sharer cannot add guests', () => {renderActions(vi.fn(), { canRequestToJoin: false });diff --git a/apps/web/src/features/calendar-view/components/SharedEventActions.tsx b/apps/web/src/features/calendar-view/components/SharedEventActions.tsxindex 1227ddd2ed..3fbb1670d4 100644--- a/apps/web/src/features/calendar-view/components/SharedEventActions.tsx+++ b/apps/web/src/features/calendar-view/components/SharedEventActions.tsx@@ -88,6 +88,13 @@ export function SharedEventActions(props: {const sent = askedFrom();return sent !== undefined && sent.status === props.joinRequestStatus;};+ // The sharer's answer is an invitation to the meeting itself. A snapshot+ // added meanwhile would take that invitation in under its own UID and stay+ // a snapshot, so adding one waits until the request is declined.+ const requestOutstanding = () =>+ props.joinRequestStatus === 'pending' ||+ props.joinRequestStatus === 'accepted' ||+ asked();const requestToJoin = useRequestToJoinCalendarEventMutation({onSuccess: () => {setAskedFrom({ status: props.joinRequestStatus });@@ -131,7 +138,7 @@ export function SharedEventActions(props: {</Button></Match></Switch>- <Show when={addSharedEvent()}>+ <Show when={addSharedEvent() && !requestOutstanding()}><Showwhen={targetCalendars().length > 1}fallback={@@ -193,14 +200,7 @@ export function SharedEventActions(props: {<DownloadSimpleIcon />Download .ics</Button>- <Show- when={- !props.canRequestToJoin &&- props.joinRequestStatus !== 'pending' &&- props.joinRequestStatus !== 'accepted' &&- !asked()- }- >+ <Show when={!props.canRequestToJoin && !requestOutstanding()}><p class="w-full text-xs text-ink-muted">The person who shared this event can't add guests to it.</p>diff --git a/docs/agent-guide/calendar.md b/docs/agent-guide/calendar.mdindex b75c856535..135144d6ee 100644--- a/docs/agent-guide/calendar.md+++ b/docs/agent-guide/calendar.md@@ -568,7 +568,9 @@ flagged. `Ask to join` asks the person who shared the event to add the viewer asshows only when that person's copy lets them add guests (they organize it, or it is a Googlecopy whose organizer lets guests invite others and shows the guest list), and otherwise the cardreads `The person who shared this event can't add guests to it.` The card then shows-`Requested`, and `Invited` once accepted. The sharer gets a `calendar_event_join_request`+`Requested`, and `Invited` once accepted, and stops offering `Add to calendar` until the request+is declined: the sharer's answer is an invitation to the meeting, and a snapshot added meanwhile+would take that invitation in and stay a snapshot. The sharer gets a `calendar_event_join_request`notification (Settings → Notifications → Calendar → Requests to join) that opens the event,whose details list each request with `Add as guest` and `Decline` on desktop and in the phonedrawer. Adding writes the guest through the same invite path as `Add guests`, so Google or