Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(calendar): leave a Macro call link out of day view chip locations (#9493)

gbirman71cd9c96c200
diff --git a/apps/web/src/features/calendar/components/EventContent.test.tsx b/apps/web/src/features/calendar/components/EventContent.test.tsx
new file mode 100644
index 0000000000..6ad1e9f625
--- /dev/null
+++ b/apps/web/src/features/calendar/components/EventContent.test.tsx
@@ -0,0 +1,104 @@
+/**
+ * @vitest-environment jsdom
+ */
+
+import type { CalendarEvent } from '@app/features/calendar/types';
+import type { EventContentArg } from '@fullcalendar/core';
+import { cleanup, render, screen } from '@solidjs/testing-library';
+import { afterEach, describe, expect, it } from 'vitest';
+import { attachCalendarMacroCall } from '../utils/macro-call-link';
+import { EventContent } from './EventContent';
+
+const CALL_URL =
+ 'https://macro.com/app/meet/join/8m8mGwzHqxzYjeIN5-nJRquRbzyTEhGF';
+
+afterEach(cleanup);
+
+function event(overrides: Partial<CalendarEvent> = {}): CalendarEvent {
+ return {
+ id: '["event-1","2026-10-22T14:00:00Z"]',
+ eventId: 'event-1',
+ occurrenceKey: '2026-10-22T14:00:00Z',
+ isCancelled: false,
+ isReadOnly: false,
+ guestPolicy: {
+ canModify: false,
+ canInviteOthers: true,
+ canSeeOtherGuests: true,
+ },
+ viewerCan: {
+ editDetails: false,
+ inviteGuests: false,
+ removeGuests: false,
+ setGuestPolicy: false,
+ rsvp: true,
+ organize: false,
+ },
+ attendees: [],
+ recurrenceLines: [],
+ sourceCalendarIds: ['calendar-1'],
+ calendarId: 'calendar-1',
+ title: 'Planning',
+ start: '2026-10-22T14:00:00Z',
+ end: '2026-10-22T15:00:00Z',
+ allDay: false,
+ calendar: { id: 'calendar-1', name: 'Calendar', color: 'orange' },
+ visibleCalendars: [],
+ ...overrides,
+ };
+}
+
+/** A Macro call as the editor saves it, next to whatever location was typed. */
+function macroCallEvent(typedLocation: string) {
+ return event(
+ attachCalendarMacroCall(
+ { description: '<p>Agenda</p>', location: typedLocation },
+ CALL_URL
+ )
+ );
+}
+
+function renderDayChip(calendarEvent: CalendarEvent) {
+ const renderProps = {
+ event: { allDay: false },
+ view: { type: 'timeGridDay' },
+ timeText: '',
+ } as unknown as EventContentArg;
+ return render(() => (
+ <EventContent
+ event={calendarEvent}
+ renderProps={renderProps}
+ isSelected={false}
+ timeFormat="12-hour"
+ />
+ ));
+}
+
+describe('the location on a day view event chip', () => {
+ it('leaves out a Macro call link saved as the only location', () => {
+ const { container } = renderDayChip(macroCallEvent(''));
+
+ expect(screen.getByText('Planning')).toBeTruthy();
+ expect(container.textContent).not.toContain('/meet/');
+ });
+
+ it('shows the location typed next to a Macro call', () => {
+ const { container } = renderDayChip(macroCallEvent('Room 4B'));
+
+ expect(screen.getByText('Room 4B')).toBeTruthy();
+ expect(container.textContent).not.toContain('/meet/');
+ });
+
+ it('shows a provider meeting link or a place as written', () => {
+ for (const location of [
+ 'https://meet.google.com/abc-defg-hij',
+ 'https://zoom.us/j/123456789',
+ 'Conference room 4B, third floor',
+ ]) {
+ renderDayChip(event({ location }));
+
+ expect(screen.getByText(location)).toBeTruthy();
+ cleanup();
+ }
+ });
+});
diff --git a/apps/web/src/features/calendar/components/EventContent.tsx b/apps/web/src/features/calendar/components/EventContent.tsx
index 757e8c3020..1c40bcec98 100644
--- a/apps/web/src/features/calendar/components/EventContent.tsx
+++ b/apps/web/src/features/calendar/components/EventContent.tsx
@@ -3,6 +3,7 @@ import ExclamationIcon from '@icon/system/regular/exclamation-mark.svg';
import { cn } from '@ui';
import { Show } from 'solid-js';
import type { CalendarEvent, CalendarTimeFormat } from '../types';
+import { calendarEventLocation } from '../utils/macro-call-link';
import {
formatCompactCalendarTime,
formatCompactCalendarTimeRange,
@@ -119,10 +120,12 @@ export function EventContent(props: EventContentProps) {
</span>
)}
</Show>
- <Show when={showLocation() && props.event.location}>
- <span class="calendar-event-metadata calendar-event-location mt-1 shrink-0 truncate leading-tight opacity-80">
- {props.event.location}
- </span>
+ <Show when={showLocation() && calendarEventLocation(props.event)}>
+ {(location) => (
+ <span class="calendar-event-metadata calendar-event-location mt-1 shrink-0 truncate leading-tight opacity-80">
+ {location()}
+ </span>
+ )}
</Show>
</div>
</div>
diff --git a/apps/web/src/features/calendar/utils/macro-call-link.ts b/apps/web/src/features/calendar/utils/macro-call-link.ts
index 5ad613285f..359db66bd5 100644
--- a/apps/web/src/features/calendar/utils/macro-call-link.ts
+++ b/apps/web/src/features/calendar/utils/macro-call-link.ts
@@ -79,6 +79,14 @@ export function removeCalendarMacroCall(
};
}
+/** The location event details show: empty when it is only the meeting's Macro call link. */
+export function calendarEventLocation(event: CalendarCallContent) {
+ return removeCalendarMacroCall(
+ { location: event.location },
+ calendarMacroCallUrl(event)
+ ).location.trim();
+}
+
/** Attach one invitation link without replacing a physical location or notes. */
export function attachCalendarMacroCall(
content: Pick<CalendarCallContent, 'description' | 'location'>,
diff --git a/docs/agent-guide/calendar.md b/docs/agent-guide/calendar.md
index a41d7c4fe5..db06f99f25 100644
--- a/docs/agent-guide/calendar.md
+++ b/docs/agent-guide/calendar.md
@@ -459,6 +459,8 @@ call instead of creating duplicates. The invitation includes
the call link in its description and, when no location was entered, its location.
Event details show a plain icon row with a standard gray `Join Macro call` button
and `Copy call link`, without an enclosing border or the full URL.
+Day-view chips, which show an event's location under its time on desktop and phone,
+leave out a location that is only the call link and keep a location typed beside it.
Editing or rescheduling an owned event retains and updates its selected Macro call.
Selecting `Macro call` on an owned editable event without one adds a call on save;
choosing another option removes its generated Macro link from the invitation.