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): exclude working locations from upcoming events (#7299)
gbirmanc05da446996f
diff --git a/apps/web/src/features/meetings/queries/upcoming-calendar-events.test.ts b/apps/web/src/features/meetings/queries/upcoming-calendar-events.test.tsindex 395896859d..e6ab623503 100644--- a/apps/web/src/features/meetings/queries/upcoming-calendar-events.test.ts+++ b/apps/web/src/features/meetings/queries/upcoming-calendar-events.test.ts@@ -109,6 +109,36 @@ afterEach(() => {});describe('upcoming calendar events source', () => {+ it('skips working locations and keeps looking for upcoming events', async () => {+ const locations = [0, 1, 2, 3, 4].map((day) =>+ occurrence(day, { title: 'Office', eventType: 'working_location' })+ );+ const allDay = {+ kind: 'allDay' as const,+ startDate: '2026-09-23',+ endDate: '2026-09-24',+ };+ locations[0].event.time = allDay;+ locations[0].occurrence.time = allDay;+ list+ .mockResolvedValueOnce(+ ok({ items: locations, hasMore: false, syncStatus: 'ready' })+ )+ .mockResolvedValueOnce(+ ok({+ items: [16, 17, 18, 19, 20].map((day) => occurrence(day)),+ hasMore: false,+ syncStatus: 'ready',+ })+ );+ const { result } = setup();+ await vi.waitFor(() => expect(result.events()).toHaveLength(5));+ expect(result.events().map((event) => event.title)).toEqual(+ [16, 17, 18, 19, 20].map((day) => `event-${day}`)+ );+ expect(list).toHaveBeenCalledTimes(2);+ });+it('stops after the first window when five events are available', async () => {respond([5, 3, 2, 4, 1].map((day) => occurrence(day)));const { result } = setup();@@ -128,6 +158,36 @@ describe('upcoming calendar events source', () => {);});+ it('uses the visible copy type without filtering ordinary events named Office', async () => {+ const location = occurrence(0, {+ sources: [+ {+ calendarId: source.id,+ title: 'Office',+ isReadOnly: false,+ eventType: 'working_location',+ reminders: { useDefault: true, overrides: [] },+ transparency: 'transparent',+ visibility: 'default',+ },+ ],+ });+ respond([+ location,+ ...[1, 2, 3, 4, 5].map((day) => occurrence(day, { title: 'Office' })),+ ]);+ const { result } = setup();+ await vi.waitFor(() => expect(result.events()).toHaveLength(5));+ expect(result.events().map((event) => event.eventId)).toEqual(+ [1, 2, 3, 4, 5].map((day) => `event-${day}`)+ );+ expect(+ result.findEvent(+ JSON.stringify(['event-0', location.occurrence.occurrenceKey])+ )+ ).toBeUndefined();+ });+it('widens to later windows after filtering cancelled, declined and hidden events', async () => {const hidden = occurrence(1, {sources: [diff --git a/apps/web/src/features/meetings/queries/upcoming-calendar-events.ts b/apps/web/src/features/meetings/queries/upcoming-calendar-events.tsindex 4e506e27a8..8ff05a23e2 100644--- a/apps/web/src/features/meetings/queries/upcoming-calendar-events.ts+++ b/apps/web/src/features/meetings/queries/upcoming-calendar-events.ts@@ -73,6 +73,7 @@ export function useUpcomingCalendarEventsSource(options: SourceOptions) {isSourceVisible: options.isSourceVisible,});if (+ event.eventType === 'working_location' ||event.isCancelled ||!isCalendarEventVisible(event, options.isSourceVisible) ||event.attendees.some(diff --git a/docs/AGENT_GUIDE/surfaces.md b/docs/AGENT_GUIDE/surfaces.mdindex b9294a6460..172f8b87f2 100644--- a/docs/AGENT_GUIDE/surfaces.md+++ b/docs/AGENT_GUIDE/surfaces.md@@ -1165,6 +1165,8 @@ Declining or timing out does not remove an invited live call from Channels `LiveThe list updates as calls end and new calls start. Calls from other conferencingproviders open their own join links. A failed upcoming-list request has a `Retry`action and does not prevent creating a call.+Working locations (such as `Office` or `Home`) stay on the calendar grid but are+excluded from Upcoming events, including both all-day and hourly locations.Events require connecting a Google account (`Connect calendar`). The`Calendar settings` (gear) menu has an `Accounts`section listing each connected account with a per-account `Enable` (grant calendar) or