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): simplify meeting note sharing and layout (#8863)
gbirman775cccb51c39
diff --git a/apps/web/AGENTS.md b/apps/web/AGENTS.mdindex b8e2801213..0de66b1b97 100644--- a/apps/web/AGENTS.md+++ b/apps/web/AGENTS.md@@ -28,7 +28,8 @@ Discussion link scrolling has a backend-free browser regression:Phone sheets stacked on each other (Connect email over Settings, Add guests,RSVP scope and the delete confirmation over event details) have a backend-freebrowser regression for backdrop taps that must not press what the scrim covers,-and for taps inside the top sheet that must still press its own controls:+including mixed pointerdown/pointerup dismissal, and for taps inside the top+sheet that must still press its own controls:`bunx playwright test --config src/components/app/mobile/browser-test/playwright.config.ts`.Composer typeahead menus choosing the side with room for their full list@@ -41,7 +42,9 @@ phone browser coverage in `features/calendar-notes`:`bunx playwright test --config src/features/calendar-notes/browser-test/playwright.config.ts`.The browser fixture uses the real event details popover and mobile drawer oversample data; keep notes aligned with those existing surfaces and preserve their-dialog open guards. Optional note sharing uses existing team memberships.+dialog open guards. Open the existing document Share dialog for note access,+keep labeled Options controls visible beside truncated titles without redundant+hover tooltips, and use existing team memberships for optional note sharing.Gate event notes and document Share meeting-link controls with`enable-calendar-meeting-notes` before mounting their query sources; it defaultson in dev and uses PostHog in production.diff --git a/apps/web/src/components/app/mobile/MobileDrawer.tsx b/apps/web/src/components/app/mobile/MobileDrawer.tsxindex c592972a5d..18098bd4e0 100644--- a/apps/web/src/components/app/mobile/MobileDrawer.tsx+++ b/apps/web/src/components/app/mobile/MobileDrawer.tsx@@ -247,8 +247,8 @@ function dismissesDrawer(event: PointerEvent) {* The rest of a tap that dismisses a drawer must not reach what its scrim* covered. Corvu dismisses on the tap's pointerdown or pointerup, and a sheet* its owner unmounts on close (a `<Show>` around it, or `openDialog`'s host)- * takes the scrim with it, so the tap's mouse events and click are hit-tested- * against the control underneath and press it. Swallow them until the tap's+ * takes the scrim with it, so pointerup can dismiss the parent and mouse events+ * can press the control underneath. Swallow them until the tap's* click, the next pointerdown or a key press, but only once the drawer has* really closed: an owner that keeps it open leaves the tap to its target.*/@@ -260,7 +260,7 @@ function swallowRestOfTap() {event.stopPropagation();if (event.type === 'click') listening.abort();};- for (const type of ['mousedown', 'mouseup', 'click'])+ for (const type of ['pointerup', 'mousedown', 'mouseup', 'click'])window.addEventListener(type, swallow, {capture: true,signal: listening.signal,diff --git a/apps/web/src/components/app/mobile/browser-test/fixture.tsx b/apps/web/src/components/app/mobile/browser-test/fixture.tsxindex 830359dc11..d15ea726ea 100644--- a/apps/web/src/components/app/mobile/browser-test/fixture.tsx+++ b/apps/web/src/components/app/mobile/browser-test/fixture.tsx@@ -97,13 +97,18 @@ function DeleteEventDialog(props: ManagedDialogProps) {function EventDetailsDrawer(props: { onClose: () => void }) {const [guests, setGuests] = createSignal(false);const [rsvpScope, setRsvpScope] = createSignal(false);+ const [share, setShare] = createSignal(false);const deleteDialog = useImperativeDialog(DeleteEventDialog);return (<MobileDrawerside="bottom"openonOpenChange={(open) => {- if (!open && (guests() || rsvpScope() || deleteDialog.isOpen())) return;+ if (+ !open &&+ (guests() || rsvpScope() || share() || deleteDialog.isOpen())+ )+ return;props.onClose();}}>@@ -118,6 +123,7 @@ function EventDetailsDrawer(props: { onClose: () => void }) {<Button onClick={() => press('Edit')}>Edit</Button><Button onClick={() => setGuests(true)}>Add guests</Button><Button onClick={() => setRsvpScope(true)}>RSVP</Button>+ <Button onClick={() => setShare(true)}>Share note</Button><Button onClick={() => deleteDialog.open({})}>Delete</Button></MobileDrawer.ScrollBody><Dialog open={guests()} onOpenChange={setGuests}>@@ -145,6 +151,22 @@ function EventDetailsDrawer(props: { onClose: () => void }) {</MobileDrawer.Content></MobileDrawer.Portal></MobileDrawer>+ <Show when={share()}>+ <MobileDrawer+ side="bottom"+ open+ onOpenChange={setShare}+ closeOnOutsidePointerStrategy="pointerdown"+ >+ <MobileDrawer.Portal>+ <MobileDrawer.Overlay />+ <MobileDrawer.Content aria-label="Share note">+ <MobileDrawer.Handle />+ <div class="h-40 px-6">Share note</div>+ </MobileDrawer.Content>+ </MobileDrawer.Portal>+ </MobileDrawer>+ </Show></MobileDrawer.Content></MobileDrawer.Portal></MobileDrawer>diff --git a/apps/web/src/components/app/mobile/browser-test/stacked-sheets.browser.e2e.ts b/apps/web/src/components/app/mobile/browser-test/stacked-sheets.browser.e2e.tsindex 4dd431909a..88c5d81cf9 100644--- a/apps/web/src/components/app/mobile/browser-test/stacked-sheets.browser.e2e.ts+++ b/apps/web/src/components/app/mobile/browser-test/stacked-sheets.browser.e2e.ts@@ -14,6 +14,34 @@ async function settled(sheet: Locator) {const pressed = (page: Page) => page.getByRole('status', { name: 'Pressed' });+test('a pointerdown dismissal does not dismiss the parent on pointerup', async ({+ page,+}) => {+ await page.goto('/?scenario=event');+ const details = page.getByRole('dialog', { name: 'Weekly product sync' });+ await settled(details);+ await tap(page, details.getByRole('button', { name: 'Share note' }));+ const share = page.getByRole('dialog', { name: 'Share note' });+ await settled(share);++ await tap(+ page,+ page.getByRole('button', { name: 'Page control', includeHidden: true })+ );++ await expect(share).toHaveCount(0);+ await expect(details).toBeVisible();+ await expect(pressed(page)).toHaveText('');+ await tap(page, details.getByRole('button', { name: 'Edit' }));+ await expect(pressed(page)).toHaveText('Edit');+ await tap(+ page,+ page.getByRole('button', { name: 'Page control', includeHidden: true })+ );+ await expect(details).toHaveCount(0);+ await expect(pressed(page)).toHaveText('Edit');+});+for (const control of ['Remove', 'Back to settings']) {test(`a tap on the dimmed Settings sheet over ${control} closes only Connect email`, async ({page,diff --git a/apps/web/src/features/calendar-notes/browser-test/fixture.tsx b/apps/web/src/features/calendar-notes/browser-test/fixture.tsxindex 7e6bcd83af..5d056ce9f0 100644--- a/apps/web/src/features/calendar-notes/browser-test/fixture.tsx+++ b/apps/web/src/features/calendar-notes/browser-test/fixture.tsx@@ -99,6 +99,13 @@ function Fixture() {<DocumentNotesViewsource={{links: () => ({ data: links(), pending: false }),+ team: () => ({ data: null, pending: false }),+ setTeam: async () => {+ setLinks((current) =>+ current.map((link) => ({ ...link, team: undefined }))+ );+ return ok(undefined);+ },retry: async () => {},unlink: async () => {setLinks([]);diff --git a/apps/web/src/features/calendar-notes/browser-test/notes.browser.e2e.ts b/apps/web/src/features/calendar-notes/browser-test/notes.browser.e2e.tsindex d499ac8053..b98e0a3e8f 100644--- a/apps/web/src/features/calendar-notes/browser-test/notes.browser.e2e.ts+++ b/apps/web/src/features/calendar-notes/browser-test/notes.browser.e2e.ts@@ -38,30 +38,37 @@ test('full-detail team viewers can link and open notes without provider actions'await expect(notes).toHaveCount(0);});-test('a note tooltip does not block selecting a neighboring document', async ({+test('long note titles keep their options accessible without horizontal scrolling', async ({page,- isMobile,}) => {- test.skip(isMobile, 'Touch devices do not show hover tooltips');await page.goto('/');await page.getByRole('button', { name: 'Link existing', exact: true }).click();const dialog = page.getByRole('dialog', { name: 'Link meeting notes' });- await dialog- .getByRole('button', { name: 'Weekly product sync', exact: true })- .hover();- await expect(page.getByRole('tooltip', { includeHidden: true })).toHaveText(- 'Weekly product sync'- );- await dialog- .getByRole('button', { name: 'Q4 product roadmap', exact: true })- .click();+ const title =+ 'Agent: offers to add a meeting to another calendar after the organizer updates a recurring event';+ await dialog.getByRole('button', { name: title, exact: true }).click();await dialog.getByRole('button', { name: 'Link note', exact: true }).click();await expect(dialog).not.toBeVisible();+ const notes = page.getByRole('region', { name: 'Meeting notes' });+ expect(await notes.evaluate((element) => element.scrollWidth)).toBe(+ await notes.evaluate((element) => element.clientWidth)+ );+ const options = notes.getByRole('button', {+ name: `Options for ${title}`,+ exact: true,+ });+ await expect(options).toBeInViewport({ ratio: 1 });+ await options.click();+ await page.getByRole('menuitem', { name: 'Unlink from meeting' }).click();+ await page+ .getByRole('dialog', { name: 'Unlink meeting notes?' })+ .getByRole('button', { name: 'Unlink note', exact: true })+ .click();await expect(- page.getByRole('button', { name: 'Open Q4 product roadmap', exact: true })- ).toBeVisible();+ notes.getByRole('button', { name: `Open ${title}` })+ ).toHaveCount(0);});test('create and open multiple notes with meeting access and no team sharing', async ({@@ -171,7 +178,7 @@ test('link a note, optionally share with a team, open it, and unlink it', async.getByRole('button', { name: 'Link existing', exact: true }).click();const dialog = page.getByRole('dialog', {- name: /Link meeting notes|Note access|Unlink meeting notes/,+ name: /Link meeting notes|Unlink meeting notes/,});await expect(dialog.getByRole('button', { name: 'Link note', exact: true })@@ -194,10 +201,15 @@ test('link a note, optionally share with a team, open it, and unlink it', asyncawait page.getByRole('button', { name: 'Options for Weekly product sync' }).click();- await page.getByRole('menuitem', { name: 'Manage access' }).click();- await dialog.getByText('Also share with Macro').click();- await dialog.getByRole('button', { name: 'Save access' }).click();- await expect(dialog).not.toBeVisible();+ await page.getByRole('menuitem', { name: 'Share', exact: true }).click();+ const share = page.getByRole('dialog', {+ name: 'Share: Weekly product sync',+ exact: true,+ });+ await share.getByText('Also share with Macro').click();+ await expect(share.getByRole('checkbox')).toBeChecked();+ await share.getByRole('button', { name: 'Done', exact: true }).click();+ await expect(share).not.toBeVisible();await expect(page.getByRole('region', { name: 'Meeting notes' })).toContainText('Also shared with Macro');@@ -238,7 +250,7 @@ test('a failed link preserves the selected document and sharing choice for retry.getByRole('button', { name: 'Link existing', exact: true }).click();const dialog = page.getByRole('dialog', {- name: /Link meeting notes|Note access|Unlink meeting notes/,+ name: /Link meeting notes|Unlink meeting notes/,});await dialog.getByRole('button', { name: 'Weekly product sync', exact: true })@@ -275,7 +287,7 @@ test('removing a note during an open options menu does not block event dismissal.getByRole('button', { name: 'Options for Weekly product sync' }).click();await expect(- page.getByRole('menuitem', { name: 'Manage access' })+ page.getByRole('menuitem', { name: 'Share', exact: true })).toBeVisible();await page.evaluate(() =>document.dispatchEvent(@@ -283,7 +295,7 @@ test('removing a note during an open options menu does not block event dismissal));await expect(- page.getByRole('menuitem', { name: 'Manage access' })+ page.getByRole('menuitem', { name: 'Share', exact: true })).not.toBeVisible();await page.keyboard.press('Escape');await expect(@@ -355,7 +367,7 @@ test('search, dismiss, and reopen reset the unfinished choice', async ({});await trigger.click();const dialog = page.getByRole('dialog', {- name: /Link meeting notes|Note access|Unlink meeting notes/,+ name: /Link meeting notes|Unlink meeting notes/,});await dialog.getByRole('textbox').fill('no matching note');await expect(dialog.getByText('No notes match this name.')).toBeVisible();diff --git a/apps/web/src/features/calendar-notes/browser-test/preview-adapters.tsx b/apps/web/src/features/calendar-notes/browser-test/preview-adapters.tsxindex c8d2f64ee7..45344db48f 100644--- a/apps/web/src/features/calendar-notes/browser-test/preview-adapters.tsx+++ b/apps/web/src/features/calendar-notes/browser-test/preview-adapters.tsx@@ -1,8 +1,9 @@-import { Avatar } from '@ui';+import { Avatar, Button, Dialog } from '@ui';import { createContext, type ParentProps, useContext } from 'solid-js';import { EventAttendeesSection } from '../../calendar/components/EventDetails';import type { CalendarEvent } from '../../calendar/types';import type { NotesSource } from '../context/notes-source';+import { DocumentNotesView } from '../views/document-notes';import { MeetingNotesView } from '../views/meeting-notes';export { sanitizeCalendarDescription } from '../../calendar/utils/calendar-description-sanitizer';@@ -46,6 +47,53 @@ export function CalendarMeetingNotes(props: {props.onOpenDocument(note.documentId);}}onDialogChange={props.onDialogChange}+ shareDialog={(note, onClose) => (+ <Dialog+ open+ onOpenChange={(open) => {+ if (!open) onClose();+ }}+ position="center"+ class="w-[720px]"+ >+ <div class="p-4">+ <Dialog.Title>Share: {note.name}</Dialog.Title>+ <Dialog.Description class="my-3 text-xs text-ink-muted">+ Preview of meeting access controls. The app opens the full+ document Share dialog.+ </Dialog.Description>+ <DocumentNotesView+ source={{+ links: () => ({+ pending: false,+ data: source+ .notes()+ .data?.filter((item) => item.documentId === note.documentId)+ .map((item) => ({+ eventId: props.event.eventId,+ occurrenceKey: props.event.occurrenceKey,+ eventTitle: props.event.title,+ team: item.team,+ })),+ }),+ team: () => ({+ pending: false,+ data: { id: 'macro', name: 'Macro' },+ }),+ retry: source.retry,+ setTeam: (_target, teamId) =>+ source.link(note.documentId, teamId),+ unlink: () => source.unlink(note.documentId),+ }}+ />+ <div class="mt-4 flex justify-end">+ <Button variant="ghost" onClick={onClose}>+ Done+ </Button>+ </div>+ </div>+ </Dialog>+ )}/>);}diff --git a/apps/web/src/features/calendar-notes/calendar-meeting-notes.tsx b/apps/web/src/features/calendar-notes/calendar-meeting-notes.tsxindex 36ed7d56f7..a27e26e589 100644--- a/apps/web/src/features/calendar-notes/calendar-meeting-notes.tsx+++ b/apps/web/src/features/calendar-notes/calendar-meeting-notes.tsx@@ -1,3 +1,5 @@+import { Permissions } from '@core/component/SharePermissions';+import { ShareModal } from '@core/component/TopBar/ShareButton';import { useUserId } from '@core/context/user';import { Show, Suspense } from 'solid-js';import type { CalendarEvent } from '../calendar/types';@@ -32,6 +34,22 @@ export function CalendarMeetingNotes(props: {recurring={props.event.recurrenceLines.length > 0}guestListHidden={!props.event.guestPolicy.canSeeOtherGuests}onOpen={(note) => props.onOpenDocument(note.documentId)}+ shareDialog={(note, onClose) => (+ <Suspense>+ <ShareModal+ open+ onOpenChange={(open) => {+ if (!open) onClose();+ }}+ id={note.documentId}+ itemType="document"+ blockAlias="md"+ name={note.name}+ owner={userId()}+ userPermissions={Permissions.OWNER}+ />+ </Suspense>+ )}onDialogChange={props.onDialogChange}/>)}diff --git a/apps/web/src/features/calendar-notes/components/document-notes-section.tsx b/apps/web/src/features/calendar-notes/components/document-notes-section.tsxindex e08d2e067d..38dedfa9b5 100644--- a/apps/web/src/features/calendar-notes/components/document-notes-section.tsx+++ b/apps/web/src/features/calendar-notes/components/document-notes-section.tsx@@ -1,15 +1,17 @@import CalendarIcon from '@phosphor/calendar-blank.svg';-import { Button } from '@ui';+import { Button, Checkbox } from '@ui';import { For, Show } from 'solid-js';-import type { DocumentNoteLink, NoteRead } from '../core/types';+import type { DocumentNoteLink, NoteRead, NoteTeam } from '../core/types';export function DocumentNotesSection(props: {state: NoteRead<DocumentNoteLink[]>;+ team: NoteRead<NoteTeam | null>;selected?: DocumentNoteLink;saving: boolean;error?: string;onSelect: (link: DocumentNoteLink | undefined) => void;onRemove: () => void;+ onTeam: (link: DocumentNoteLink, teamId?: string) => void;onRetry: () => void;}) {return (@@ -24,25 +26,29 @@ export function DocumentNotesSection(props: {><h3 class="font-medium">Meeting links</h3><p class="mt-1 text-xs leading-relaxed text-ink-muted">- Access granted through meeting links. Unlink removes these grants and- keeps the document.+ People who can see a meeting’s details can read this note.</p><Show when={props.state.pending}><p role="status" class="mt-3 text-xs text-ink-muted">Loading meeting access…</p></Show>- <Show when={props.state.error}>+ <Show when={props.state.error || props.team.error}><divrole="alert"class="mt-3 flex items-center justify-between gap-3 text-xs text-failure">- {props.state.error}+ {props.state.error || props.team.error}<Button size="sm" variant="ghost" onClick={props.onRetry}>Retry</Button></div></Show>+ <Show when={props.error}>+ <p role="alert" class="mt-3 text-xs text-failure">+ {props.error}+ </p>+ </Show><For each={props.state.data}>{(link) => (<div class="mt-3 rounded-xl border border-edge-muted p-3">@@ -54,8 +60,7 @@ export function DocumentNotesSection(props: {{link.occurrenceKey === 'single'? 'One-time meeting': link.occurrenceKey.slice(0, 10)}{' '}- · Meeting viewers- {link.team ? ` + ${link.team.name}` : ''} · Can view+ · Can view</p></div><Button@@ -67,6 +72,42 @@ export function DocumentNotesSection(props: {Unlink</Button></div>+ <Show when={props.team.data}>+ {(team) => (+ <Checkbox+ checked={link.team?.id === team().id}+ disabled={props.saving}+ onChange={(checked) =>+ props.onTeam(link, checked ? team().id : undefined)+ }+ class="mt-3 gap-2"+ >+ <Checkbox.Control />+ <Checkbox.Label class="text-xs font-normal text-ink-muted">+ Also share with {team().name}+ </Checkbox.Label>+ </Checkbox>+ )}+ </Show>+ <Show+ when={+ link.team &&+ props.team.data !== undefined &&+ link.team.id !== props.team.data?.id+ }+ >+ <div class="mt-3 flex items-center justify-between gap-3 text-xs text-ink-muted">+ <span>{link.team?.name} can also view this note.</span>+ <Button+ variant="ghost"+ size="sm"+ disabled={props.saving}+ onClick={() => props.onTeam(link, undefined)}+ >+ Remove team access+ </Button>+ </div>+ </Show><Showwhen={props.selected?.eventId === link.eventId &&@@ -78,11 +119,6 @@ export function DocumentNotesSection(props: {Remove this meeting link and its team access? The documentand its other sharing stay the same.</p>- <Show when={props.error}>- <p role="alert" class="mt-2 text-xs text-failure">- {props.error}- </p>- </Show><div class="mt-3 flex justify-end gap-2"><Buttonvariant="ghost"diff --git a/apps/web/src/features/calendar-notes/components/note-dialog.tsx b/apps/web/src/features/calendar-notes/components/note-dialog.tsxindex ed7dd5cd34..25288a0e8a 100644--- a/apps/web/src/features/calendar-notes/components/note-dialog.tsx+++ b/apps/web/src/features/calendar-notes/components/note-dialog.tsx@@ -4,17 +4,12 @@ import FileTextIcon from '@phosphor/file-text.svg';import LinkIcon from '@phosphor/link.svg';import MagnifyingGlassIcon from '@phosphor/magnifying-glass.svg';import XIcon from '@phosphor/x.svg';-import { Button, Checkbox, Dialog, InputGroup, Tooltip } from '@ui';+import { Button, Checkbox, Dialog, InputGroup } from '@ui';import { For, Show } from 'solid-js';-import type {- NoteDocument,- NotePicker,- NoteRead,- NoteTeam,-} from '../core/types';+import type { NoteDocument, NotePicker, NoteRead } from '../core/types';export function NoteDialog(props: {- kind: 'link' | 'sharing' | 'unlink';+ kind: 'link' | 'unlink';eventTitle: string;recurring: boolean;guestListHidden?: boolean;@@ -25,7 +20,6 @@ export function NoteDialog(props: {onSelect: (document: NoteDocument) => void;linkedIds: string[];teamId?: string;- currentTeam?: NoteTeam;onTeam: (id: string | undefined) => void;saving: boolean;error?: string;@@ -33,11 +27,7 @@ export function NoteDialog(props: {onClose: () => void;}) {const title = () =>- props.kind === 'unlink'- ? 'Unlink meeting notes?'- : props.kind === 'sharing'- ? 'Note access'- : 'Link meeting notes';+ props.kind === 'unlink' ? 'Unlink meeting notes?' : 'Link meeting notes';return (<Dialogopen@@ -45,11 +35,14 @@ export function NoteDialog(props: {if (!open) props.onClose();}}position="center"- class="w-[400px]"+ class={props.kind === 'link' ? 'w-[720px]' : 'w-[400px]'}contentOwnsScrollanimate>- <div class="relative flex min-h-0 max-h-[calc(100dvh-var(--virtual-keyboard-height,0px)-2rem)] flex-col p-4">+ <div+ class="relative flex min-h-0 max-h-[calc(100dvh-var(--virtual-keyboard-height,0px)-2rem)] flex-col p-4 sm:p-6"+ classList={{ 'h-[680px]': props.kind === 'link' }}+ ><div class="flex min-h-8 shrink-0 items-center justify-between gap-3 pr-8"><Dialog.Title class="text-base font-medium text-ink sm:text-sm">{title()}@@ -61,13 +54,7 @@ export function NoteDialog(props: {fallback="The document stays in your files. Access granted by this meeting link will be removed; other sharing stays the same."><span class="flex min-w-0 items-center gap-2">- <Tooltip- label={props.eventTitle}- as="span"- class="min-w-0 truncate"- >- {props.eventTitle}- </Tooltip>+ <span class="min-w-0 truncate">{props.eventTitle}</span><Show when={props.recurring}><span class="shrink-0 text-xs text-ink-extra-muted">· This occurrence@@ -93,7 +80,7 @@ export function NoteDialog(props: {</InputGroup></div><div- class="mt-2 flex min-h-0 max-h-48 flex-col gap-1 overflow-y-auto overscroll-contain"+ class="mt-3 flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto overscroll-contain"role="region"aria-label="Your markdown documents"aria-busy={props.picker.pending}@@ -117,7 +104,7 @@ export function NoteDialog(props: {variant="ghost"size="md"fullWidth- label={document.name}+ aria-label={document.name}aria-pressed={props.selected?.documentId === document.documentId}@@ -162,9 +149,7 @@ export function NoteDialog(props: {{(document) => (<div class="mt-3 flex shrink-0 items-center gap-2 rounded-lg bg-ink/4 p-3 text-sm text-ink"><FileTextIcon class="size-4 text-accent" />- <Tooltip label={document().name} class="min-w-0 flex-1">- <span class="block truncate">{document().name}</span>- </Tooltip>+ <span class="min-w-0 flex-1 truncate">{document().name}</span></div>)}</Show>@@ -202,35 +187,6 @@ export function NoteDialog(props: {</For></div></Show>- <Show- when={- props.currentTeam &&- props.teamId === props.currentTeam.id &&- props.picker.data &&- !props.picker.data.teams.some(- (team) => team.id === props.teamId- )- }- >- <div class="mt-3 rounded-lg border border-edge-muted p-3 text-xs text-ink-muted">- <p>- {props.currentTeam?.name} still has view access. You no longer- belong to this team.- </p>- <Button- variant="ghost"- size="sm"- class="mt-2"- disabled={props.saving}- onClick={() => props.onTeam(undefined)}- >- Remove team access- </Button>- </div>- </Show>- <p class="mt-2 text-xs leading-relaxed text-ink-extra-muted">- Other document access stays the same.- </p><Show when={props.guestListHidden}><p class="mt-2 text-xs leading-relaxed text-ink-extra-muted">This meeting hides its guest list. Some guests may need a direct@@ -267,18 +223,16 @@ export function NoteDialog(props: {? 'Saving…': props.kind === 'unlink'? 'Unlink note'- : props.kind === 'sharing'- ? 'Save access'- : 'Link note'}+ : 'Link note'}</Button></div><Dialog.CloseButtonas={Button}variant="ghost"size="icon-sm"- label="Close"+ aria-label="Close"disabled={props.saving}- class="absolute right-4 top-4"+ class="absolute right-4 top-4 sm:right-6 sm:top-6"><XIcon /></Dialog.CloseButton>diff --git a/apps/web/src/features/calendar-notes/components/notes-section.tsx b/apps/web/src/features/calendar-notes/components/notes-section.tsxindex 34df1c3c27..15f1cb512a 100644--- a/apps/web/src/features/calendar-notes/components/notes-section.tsx+++ b/apps/web/src/features/calendar-notes/components/notes-section.tsx@@ -50,9 +50,9 @@ export function NotesSection(props: {<Show when={props.state.data}><div class="flex shrink-0 items-center gap-1"><Button- variant={props.state.data?.length ? 'ghost' : 'strong'}+ variant="ghost"size="xs"- label={createLabel()}+ aria-label={createLabel()}disabled={props.creating}onClick={props.onCreate}>@@ -64,7 +64,7 @@ export function NotesSection(props: {variant="ghost"size="xs"depth={3}- label="Link existing"+ aria-label="Link existing"disabled={props.creating}onClick={props.onLink}>@@ -94,19 +94,19 @@ export function NotesSection(props: {</Button></div></Show>- <div class="flex flex-col gap-1">+ <div class="flex flex-col gap-2"><For each={props.state.data}>{(note) => {onCleanup(() => props.onMenuChange(note.documentId, false));return (<div class="min-w-0">- <div class="flex min-w-0 items-center gap-1">+ <div class="grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2"><Buttonvariant="ghost"size="sm"depth={3}- class="min-w-0 flex-1"- label={`Open ${note.name}`}+ class="min-w-0 justify-start"+ aria-label={`Open ${note.name}`}onClick={() => props.onOpen(note)}><span class="min-w-0 flex-1 truncate text-left">@@ -122,9 +122,9 @@ export function NotesSection(props: {}><Dropdown.Trigger- variant="ghost"+ variant="outline"size="xs"- label={`Options for ${note.name}`}+ aria-label={`Options for ${note.name}`}disabled={props.creating}>Options@@ -141,7 +141,7 @@ export function NotesSection(props: {<Dropdown.ItemonSelect={() => props.onSharing(note)}>- Manage access+ Share</Dropdown.Item><Dropdown.ItemonSelect={() => props.onUnlink(note)}diff --git a/apps/web/src/features/calendar-notes/context/notes-source.ts b/apps/web/src/features/calendar-notes/context/notes-source.tsindex 7e271e9f10..92791dda4b 100644--- a/apps/web/src/features/calendar-notes/context/notes-source.ts+++ b/apps/web/src/features/calendar-notes/context/notes-source.ts@@ -9,6 +9,7 @@ import type {NotePicker,NoteRead,NoteTarget,+ NoteTeam,} from '../core/types';/** Reactive reads and writes owned by the calendar-note feature. */@@ -29,6 +30,11 @@ export type NotesSource = {export type DocumentNotesSource = {links: Accessor<NoteRead<DocumentNoteLink[]>>;+ team: Accessor<NoteRead<NoteTeam | null>>;retry: () => Promise<unknown>;+ setTeam: (+ target: NoteTarget,+ teamId?: string+ ) => Promise<Result<void, NoteFailure>>;unlink: (target: NoteTarget) => Promise<Result<void, NoteFailure>>;};diff --git a/apps/web/src/features/calendar-notes/primitives/document-notes-controller.ts b/apps/web/src/features/calendar-notes/primitives/document-notes-controller.tsindex 5a2fe95edf..117b9a9447 100644--- a/apps/web/src/features/calendar-notes/primitives/document-notes-controller.ts+++ b/apps/web/src/features/calendar-notes/primitives/document-notes-controller.ts@@ -25,5 +25,14 @@ export function createDocumentNotesController(source: DocumentNotesSource) {if (result.isErr()) setError(result.error.message);else select(undefined);}- return { selected, saving, error, select, remove };+ async function setTeam(link: DocumentNoteLink, teamId?: string) {+ if (saving()) return;+ setSaving(true);+ setError(undefined);+ const result = await source.setTeam(link, teamId);+ if (disposed) return;+ setSaving(false);+ if (result.isErr()) setError(result.error.message);+ }+ return { selected, saving, error, select, remove, setTeam };}diff --git a/apps/web/src/features/calendar-notes/primitives/notes-controller.ts b/apps/web/src/features/calendar-notes/primitives/notes-controller.tsindex 98357eae89..bac86ca383 100644--- a/apps/web/src/features/calendar-notes/primitives/notes-controller.ts+++ b/apps/web/src/features/calendar-notes/primitives/notes-controller.ts@@ -22,10 +22,7 @@ export function createNotesController(disposed = true;onDialogChange(false);});- const picker = source.picker(- query,- () => !!dialog() && dialog()?.kind !== 'unlink'- );+ const picker = source.picker(query, () => dialog()?.kind === 'link');function reportOpen() {if (disposed) return;@@ -51,7 +48,7 @@ export function createNotesController(async function save() {const active = dialog();const document = selected();- if (!active || !document || saving()) return;+ if (!active || active.kind === 'sharing' || !document || saving()) return;setSaving(true);setError(undefined);const result =diff --git a/apps/web/src/features/calendar-notes/queries/notes-source.ts b/apps/web/src/features/calendar-notes/queries/notes-source.tsindex db6d0d6a3a..a19de28fbe 100644--- a/apps/web/src/features/calendar-notes/queries/notes-source.ts+++ b/apps/web/src/features/calendar-notes/queries/notes-source.ts@@ -3,6 +3,7 @@ import { catchToResult, throwOnErr } from '@core/util/result';import { Telemetry } from '@macro-inc/observability';import { queryClient } from '@queries/client';import { queryReadyGate } from '@queries/gate';+import { useCurrentTeamQuery } from '@queries/team/teams';import { calendarNotesClient } from '@service-calendar/notes';import { createDebouncedMemo } from '@solid-primitives/memo';import { useMutation, useQuery } from '@tanstack/solid-query';@@ -217,6 +218,11 @@ export function createDocumentNotesSource(documentId: Accessor<string>): DocumentNotesSource {const links = useQuery(() => documentLinksOptions(userId(), documentId()));+ const team = useCurrentTeamQuery();+ const link = useMutation(() => ({+ mutationFn: linkNote,+ onSuccess: refreshNotes,+ }));const unlink = useMutation(() => ({mutationFn: unlinkNote,onSuccess: refreshNotes,@@ -227,7 +233,22 @@ export function createDocumentNotesSource(pending: links.isPending,error: links.isError ? 'Couldn’t load meeting access.' : undefined,}),- retry: () => links.refetch(),+ team: () => ({+ data: queryReadyGate(team) ? (team.data?.team ?? null) : undefined,+ pending: team.isPending,+ error: team.isError ? 'Couldn’t load your team.' : undefined,+ }),+ retry: () => Promise.all([links.refetch(), team.refetch()]),+ async setTeam(target, teamId) {+ const input = { ...target, documentId: documentId(), teamId };+ return (await catchToResult(() => link.mutateAsync(input))).mapErr(+ (): NoteFailure => ({+ kind: 'link_failed',+ message:+ 'Couldn’t update team access. Check that you can still view the meeting, then try again.',+ })+ );+ },async unlink(target) {return (await catchToResult(() =>diff --git a/apps/web/src/features/calendar-notes/tests/fake-source.ts b/apps/web/src/features/calendar-notes/tests/fake-source.tsindex 8fe3880372..386185c3c9 100644--- a/apps/web/src/features/calendar-notes/tests/fake-source.ts+++ b/apps/web/src/features/calendar-notes/tests/fake-source.ts@@ -9,6 +9,10 @@ export function createFakeNotesSource(options: { fail?: boolean } = {}) {{ documentId: 'roadmap', name: 'Q4 product roadmap' },{ documentId: 'research', name: 'Customer research · October' },{ documentId: 'retro', name: 'Team retrospective' },+ {+ documentId: 'long',+ name: 'Agent: offers to add a meeting to another calendar after the organizer updates a recurring event',+ },];const team = { id: 'macro', name: 'Macro' };const [notes, setNotes] = createSignal<MeetingNote[]>([]);diff --git a/apps/web/src/features/calendar-notes/views/document-notes.tsx b/apps/web/src/features/calendar-notes/views/document-notes.tsxindex cd5fac5401..79d6ba8ee0 100644--- a/apps/web/src/features/calendar-notes/views/document-notes.tsx+++ b/apps/web/src/features/calendar-notes/views/document-notes.tsx@@ -8,10 +8,14 @@ export function DocumentNotesView(props: { source: DocumentNotesSource }) {return (<DocumentNotesSectionstate={props.source.links()}+ team={props.source.team()}selected={controller.selected()}saving={controller.saving()}error={controller.error()}onSelect={controller.select}+ onTeam={(link, teamId) =>+ fireAndForget(controller.setTeam(link, teamId), 'calendar.notes.team')+ }onRemove={() =>fireAndForget(controller.remove(), 'calendar.notes.revoke')}diff --git a/apps/web/src/features/calendar-notes/views/meeting-notes.tsx b/apps/web/src/features/calendar-notes/views/meeting-notes.tsxindex 386a327a66..3862393563 100644--- a/apps/web/src/features/calendar-notes/views/meeting-notes.tsx+++ b/apps/web/src/features/calendar-notes/views/meeting-notes.tsx@@ -1,5 +1,5 @@import { fireAndForget } from '@core/util/fireAndForget';-import { Show } from 'solid-js';+import { type JSX, Show } from 'solid-js';import { NoteDialog } from '../components/note-dialog';import { NotesSection } from '../components/notes-section';import type { NotesSource } from '../context/notes-source';@@ -13,6 +13,7 @@ export function MeetingNotesView(props: {recurring: boolean;guestListHidden?: boolean;onOpen: (note: MeetingNote) => void;+ shareDialog: (note: MeetingNote, onClose: () => void) => JSX.Element;onDialogChange: (open: boolean) => void;}) {const controller = createNotesController(props.source, props.onDialogChange);@@ -40,10 +41,22 @@ export function MeetingNotesView(props: {fireAndForget(props.source.retry(), 'calendar.notes.retry')}/>- <Show when={controller.dialog()}>+ <Show+ when={controller.dialog()?.kind === 'sharing' && controller.dialog()}+ >+ {(dialog) => {+ const active = dialog();+ return active.kind === 'sharing'+ ? props.shareDialog(active.note, controller.close)+ : undefined;+ }}+ </Show>+ <Show+ when={controller.dialog()?.kind !== 'sharing' && controller.dialog()}+ >{(dialog) => (<NoteDialog- kind={dialog().kind}+ kind={dialog().kind === 'unlink' ? 'unlink' : 'link'}eventTitle={props.eventTitle}recurring={props.recurring}guestListHidden={props.guestListHidden}@@ -56,10 +69,6 @@ export function MeetingNotesView(props: {props.source.notes().data?.map((note) => note.documentId) ?? []}teamId={controller.teamId()}- currentTeam={(() => {- const active = dialog();- return active.kind === 'link' ? undefined : active.note.team;- })()}onTeam={controller.setTeamId}saving={controller.saving()}error={controller.error()}diff --git a/apps/web/src/lib/core/component/TopBar/ShareButton.test.tsx b/apps/web/src/lib/core/component/TopBar/ShareButton.test.tsxindex 6ac2ea4588..d17256adbd 100644--- a/apps/web/src/lib/core/component/TopBar/ShareButton.test.tsx+++ b/apps/web/src/lib/core/component/TopBar/ShareButton.test.tsx@@ -116,6 +116,7 @@ const mocks = vi.hoisted(() => ({blockPermissionsRead: vi.fn(),blockEditPermissionEnabled: true,inBlock: true,+ blockId: 'launcher-placeholder',}));vi.mock('@app/features/crm/sharing-adapter', () => ({fetchPipelineSharePermissions: mocks.getPipelinePermissions,@@ -161,7 +162,7 @@ vi.mock('@core/block', () => ({useBlockName: () => 'md',useMaybeBlockName: () => 'md',useMaybeBlockAliasedName: () => 'md',- useMaybeBlockId: () => 'launcher-placeholder',+ useMaybeBlockId: () => (mocks.inBlock ? mocks.blockId : undefined),}));vi.mock('@core/component/CustomScrollbar', () => ({CustomScrollbar: () => null,@@ -432,6 +433,10 @@ beforeEach(() => {vi.clearAllMocks();mocks.meetingNotesFlag = () => ({ enabled: true, loading: false });mocks.inBlock = true;+ mocks.blockId = 'launcher-placeholder';+ mocks.getDocumentPermissions.mockResolvedValue(+ ok({ channelSharePermissions: [] })+ );mocks.blockEditPermissionEnabled = true;mocks.mobile = false;mocks.hasTeam = false;@@ -469,10 +474,46 @@ beforeEach(() => {afterEach(cleanup);describe('document meeting-link management', () => {+ it('loads the linked note’s permissions instead of its enclosing calendar block', async () => {+ mocks.blockId = 'calendar';+ mocks.blockEditPermissionEnabled = false;+ mocks.getDocumentPermissions.mockResolvedValue(+ ok({+ linkShare: 'PUBLIC',+ linkShareAccessLevel: 'view',+ channelSharePermissions: [],+ })+ );+ render(() => (+ <ShareModal+ id="linked-note"+ name="Linked note"+ owner={ME}+ itemType="document"+ blockAlias="md"+ userPermissions={Permissions.OWNER}+ open+ onOpenChange={vi.fn()}+ />+ ));+ await vi.waitFor(() =>+ expect(mocks.getDocumentPermissions).toHaveBeenCalledWith({+ document_id: 'linked-note',+ })+ );+ expect(+ await screen.findByRole('group', { name: 'Link sharing scope' })+ ).toBeTruthy();+ expect(mocks.blockPermissionsRead).not.toHaveBeenCalled();+ expect(+ await screen.findByRole('button', { name: 'Set option edit' })+ ).toBeTruthy();+ });it.each([false, true])('gates the meeting source without implying grants were revoked (mobile: %s)',async (mobile) => {mocks.mobile = mobile;+ mocks.blockId = 'meeting-note';const [flag, setFlag] = createSignal({ enabled: false, loading: true });const [documentId, setDocumentId] = createSignal('meeting-note');mocks.meetingNotesFlag = flag;@@ -512,7 +553,7 @@ describe('document meeting-link management', () => {setDocumentId('another-note');expect(screen.queryByText('Shared')).toBeNull();- expect(screen.getByText('Restricted')).toBeDefined();+ expect(await screen.findByText('Restricted')).toBeDefined();expect(mocks.mountMeetingNotes).toHaveBeenCalledTimes(1);setFlag({ enabled: true, loading: false });expect(mocks.mountMeetingNotes).toHaveBeenLastCalledWith('another-note');@@ -1037,6 +1078,7 @@ describe('share edit availability', () => {});function mountChatShare() {+ mocks.blockId = 'chat-1';mocks.blockPermissionsRead.mockReturnValue({isErr: () => false,value: {@@ -1063,6 +1105,7 @@ function mountChatShare() {}function mountCallShare() {+ mocks.blockId = 'call-1';mocks.blockPermissionsRead.mockReturnValue({isErr: () => false,value: {@@ -1280,6 +1323,7 @@ describe('chat team sharing', () => {});function mountProjectShare() {+ mocks.blockId = 'project-1';mocks.blockPermissionsRead.mockReturnValue({isErr: () => false,value: {@@ -1741,6 +1785,7 @@ describe('pipeline sharing', () => {});it('database sharing reads its block permissions and disables public links', () => {+ mocks.blockId = 'database-id';mocks.blockPermissionsRead.mockReturnValue({isErr: () => false,value: { id: 'database-id', owner: 'owner', channelSharePermissions: [] },@@ -1764,6 +1809,7 @@ it('database sharing reads its block permissions and disables public links', ()describe('database team sharing', () => {function mountDatabaseShare() {+ mocks.blockId = 'database-id';mocks.blockPermissionsRead.mockReturnValue({isErr: () => false,value: {@@ -1818,6 +1864,9 @@ describe('database team sharing', () => {});describe('form share roles', () => {+ beforeEach(() => {+ mocks.blockId = 'form-id';+ });it.each([false, true])('shows form link sharing in the native link area (mobile: %s)',async (mobile) => {diff --git a/apps/web/src/lib/core/component/TopBar/ShareButton.tsx b/apps/web/src/lib/core/component/TopBar/ShareButton.tsxindex 8cab82cd21..2594ab6a21 100644--- a/apps/web/src/lib/core/component/TopBar/ShareButton.tsx+++ b/apps/web/src/lib/core/component/TopBar/ShareButton.tsx@@ -45,6 +45,7 @@ import {UnderlineTabs,} from '@core/component/UnderlineTabs';import { UserIcon } from '@core/component/UserIcon';+import { resolveBlockAlias } from '@core/constant/allBlocks';import {ENABLE_MARKDOWN_COMMENTS,ENABLE_MARKDOWN_LIVE_COLLABORATION,@@ -185,9 +186,21 @@ function shareUrl(type: ShareBlockType, id: string): string {/** The levels a recipient can hold on an item; forms have no comments. */export function shareLevelsFor(- itemType: ShareItemType+ itemType: ShareItemType,+ blockAlias?: ShareBlockType): readonly AccessLevel[] | undefined {- return itemType === 'form' ? ['view', 'edit'] : undefined;+ if (itemType === 'form') return ['view', 'edit'];+ if (+ itemType === 'document' &&+ blockAlias &&+ resolveBlockAlias(blockAlias) === 'md'+ ) {+ const levels: AccessLevel[] = ['view'];+ if (ENABLE_MARKDOWN_COMMENTS) levels.push('comment');+ if (ENABLE_MARKDOWN_LIVE_COLLABORATION) levels.push('edit');+ return levels;+ }+ return undefined;}const SHARE_LINK_SUBTEXT =@@ -391,6 +404,7 @@ function GroupChannelLabel(props: { channelId: string; fallbackName: string }) {interface LinkSharingControlsProps {editPermissionEnabled?: boolean;+ allowedAccessLevels?: readonly AccessLevel[];linkShare: LinkShare | null | undefined;linkShareAccessLevel: AccessLevel | null | undefined;hasExplicitShares: boolean;@@ -543,6 +557,7 @@ function LinkSharingControls(props: LinkSharingControlsProps) {<span>Access level</span><ShareOptionseditPermissionEnabled={props.editPermissionEnabled}+ allowedAccessLevels={props.allowedAccessLevels}permissions={props.linkShareAccessLevel ?? 'view'}hideNoAccess={true}setPermissions={props.setLinkShareAccessLevel}@@ -801,7 +816,10 @@ function MobileShareDrawer(props: MobileShareDrawerProps) {initialAccessLevel={props.itemType === 'email' ? 'view' : null}- allowedAccessLevels={shareLevelsFor(props.itemType)}+ allowedAccessLevels={shareLevelsFor(+ props.itemType,+ props.blockAlias+ )}/></AfterFirstPaint></Show>@@ -890,7 +908,10 @@ function MobileShareDrawer(props: MobileShareDrawerProps) {<div class="flex items-center"><ShareOptionseditPermissionEnabled={props.editPermissionEnabled}- allowedAccessLevels={shareLevelsFor(props.itemType)}+ allowedAccessLevels={shareLevelsFor(+ props.itemType,+ props.blockAlias+ )}disabled={props.userPermissions !== Permissions.OWNER}permissions={recipient.access_level}setPermissions={(accessLevel) => {@@ -918,6 +939,10 @@ function MobileShareDrawer(props: MobileShareDrawerProps) {when={props.linkSharing}fallback={<LinkSharingControls+ allowedAccessLevels={shareLevelsFor(+ props.itemType,+ props.blockAlias+ )}loading={props.permissionsLoading}meetingAccess={props.meetingAccess}editPermissionEnabled={props.editPermissionEnabled}@@ -994,9 +1019,12 @@ export function ShareModal(props: ShareModalProps) {const callRecordQuery = useCallRecordQuery(() =>props.itemType === 'call' ? props.id : '');- // These entities are never their enclosing block's, so read their own grants.- const isBlockContext =- isInBlock() &&+ // A calendar can open Share for a linked note. Only reuse the enclosing+ // block's permissions when the dialog is sharing that same entity.+ const enclosingBlockId = useMaybeBlockId();+ const isBlockContext = () =>+ !!enclosingBlockId &&+ enclosingBlockId === props.id &&props.itemType !== 'agent_session' &&props.itemType !== 'initiative' &&props.itemType !== 'crm_pipeline';@@ -1005,10 +1033,10 @@ export function ShareModal(props: ShareModalProps) {const queryClient = useQueryClient();const fallbackPermissionsQuery = useQuery(() => ({...sharePermissionsQueryOptions(props.id, props.itemType),- enabled: !isBlockContext && !!props.id,+ enabled: !isBlockContext() && !!props.id,}));const sharePermission = () => {- if (isBlockContext) {+ if (isBlockContext()) {const result = permissionsBlockResource[0].latest;return result && !result.isErr() ? result.value : undefined;}@@ -1017,12 +1045,12 @@ export function ShareModal(props: ShareModalProps) {: (fallbackPermissionsQuery.data ?? undefined);};const permissionsLoading = () =>- isBlockContext+ isBlockContext()? permissionsBlockResource[0].loading &&!permissionsBlockResource[0].latest: fallbackPermissionsQuery.isLoading;const refetch = async () => {- if (isBlockContext) {+ if (isBlockContext()) {await permissionsBlockResource[1].refetch();return;}@@ -1086,8 +1114,15 @@ export function ShareModal(props: ShareModalProps) {props.itemType === 'crm_pipeline' && canSharePipeline()? Permissions.OWNER: userPermissions();- const editPermissionEnabled = () =>- props.itemType === 'agent_session' ? true : undefined;+ const editPermissionEnabled = () => {+ if (props.itemType === 'agent_session') return true;+ if (+ props.itemType === 'document' &&+ resolveBlockAlias(props.blockAlias) === 'md'+ )+ return ENABLE_MARKDOWN_LIVE_COLLABORATION;+ return undefined;+ };const [recipientScrollRef, setRecipientScrollRef] =createSignal<HTMLElement>();@@ -1759,7 +1794,10 @@ export function ShareModal(props: ShareModalProps) {initialAccessLevel={props.itemType === 'email' ? 'view' : null}- allowedAccessLevels={shareLevelsFor(props.itemType)}+ allowedAccessLevels={shareLevelsFor(+ props.itemType,+ props.blockAlias+ )}/></AfterFirstPaint></Show>@@ -1923,7 +1961,8 @@ export function ShareModal(props: ShareModalProps) {<ShareOptionseditPermissionEnabled={editPermissionEnabled()}allowedAccessLevels={shareLevelsFor(- props.itemType+ props.itemType,+ props.blockAlias)}disabled={recipientPermissions() !==@@ -1995,6 +2034,10 @@ export function ShareModal(props: ShareModalProps) {when={props.linkSharing}fallback={<LinkSharingControls+ allowedAccessLevels={shareLevelsFor(+ props.itemType,+ props.blockAlias+ )}loading={permissionsLoading()}meetingAccess={meetingAccessForSharing()}editPermissionEnabled={editPermissionEnabled()}diff --git a/docs/agent-guide/calendar.md b/docs/agent-guide/calendar.mdindex 890974a2fb..35b9e1f4fa 100644--- a/docs/agent-guide/calendar.md+++ b/docs/agent-guide/calendar.md@@ -3,8 +3,7 @@## Meeting notesMeeting notes require `enable-calendar-meeting-notes`. It is on automatically in-dev; production uses PostHog, with an initial rollout intended for `@macro.com`-users. `VITE_ENABLE_CALENDAR_MEETING_NOTES=true` or `false` overrides it locally.+dev; production uses PostHog, enabled for `@macro.com` users. `VITE_ENABLE_CALENDAR_MEETING_NOTES=true` or `false` overrides it locally.With the flag off, event notes and document Share meeting-link controls do notmount or request note data, on desktop or phone. The flag does not revoke savedmeeting/team grants or change API permissions.@@ -15,7 +14,7 @@ viewer access, and opens it immediately. Team access starts off. A meeting canhave multiple notes; **Create** and **Link** remain on the section title rowso you can keep creating notes or linking existing documents.-Choose **Link** to search your markdown documents, select one, review+Choose **Link** to search the titles of Markdown documents you own, select one, reviewthe sharing explanation, and optionally include your existing team before**Link note**. Team access starts off for each note. Recurring meetings link onlythe displayed occurrence. Notes on a@@ -28,14 +27,19 @@ Open the linked title to read the original document. On desktop it opens in anew split; on mobile it replaces the calendar pane and closes event details.Opening a note leaves focus available to the document as it mounts; dismissingdesktop details normally returns focus to the calendar event.-Meeting access and occurrence scope are explained in the linking/access dialog;-each note shows any additional team audience. Document owners use **Options →-Manage access** to change that team, or **Options → Unlink from meeting** to remove-this meeting's grants without deleting the document. Keep access explanations as-plain text and actions labeled.-In the linking dialog, only the document results scroll. The meeting context,+Meeting access and occurrence scope are explained in the linking dialog;+each note shows any additional team audience. **Options → Share** opens the same+document Share dialog as the note toolbar. Its **Meeting links** section lets the+owner change each link’s optional team access. **Options → Unlink from meeting**+removes this meeting’s grants without deleting the document. Keep the labeled+Options button visible beside long titles; truncate the title without widening+the event details. Labeled note controls do not need extra hover tooltips.+The linking dialog uses a wider desktop layout and a phone sheet. Only the+document results scroll. The picker uses the calendar notes endpoint’s title+search (up to 30 recently updated owned Markdown documents), not full-text search. The meeting context,sharing controls, and action buttons stay visible, including in a short viewport.-If the owner has since left the selected team, **Remove team access** still works.+A former team’s grant can be removed in Share while the meeting is still visible;+unlinking remains available even if the meeting is no longer accessible.Failed saves retain the selection and audience for retry; dismissing starts fresh.If creation succeeds but linking fails, **Retry linking** reuses the saved document;**Open saved note** lets you continue editing before the link is confirmed. Closing@@ -59,10 +63,12 @@ viewer leaves that team; it does not make the calendar event visible to that teaVerify on desktop and phone: create and open notes, add a second note, retry a failedlink without duplicating the new document, link an existing note with team unchecked,-add/remove a team, and unlink while keeping the document. On desktop, hover a note-title and select a neighboring note while its tooltip is visible. The+add/remove a team in Share, and unlink while keeping the document. Link a long+title and verify its Options menu opens without horizontal scrolling. Thebackend-free browser suite mounts the real event popover and mobile drawer with-sample data and preview service adapters. It is+sample data and preview service adapters. It previews the real meeting-access+controls inside a sample Share shell; verify the full Share dialog in the app+as well. It is`apps/web/src/features/calendar-notes/browser-test/playwright.config.ts`.API permission cases are covered in `crates/calendar_events/src/outbound/pg/test/notes.rs`.The fixture accepts `?notes=off` to check the event details without notes.diff --git a/docs/agent-guide/documents.md b/docs/agent-guide/documents.mdindex 5c79e79063..9e01c3d7a5 100644--- a/docs/agent-guide/documents.md+++ b/docs/agent-guide/documents.md@@ -6,7 +6,9 @@ sharing dialog; copying a link is a separate action.With `enable-calendar-meeting-notes` enabled, owned markdown documents' Sharepanel also lists **Meeting links** (under the **Link** tab on mobile).-Each shows its occurrence and optional team view grant.+Each shows its occurrence and optional team view grant. Toggle **Also share with+<team>** here to update that link’s team access; changes save immediately.+Calendar notes’ **Options → Share** opens this same dialog.Use **Unlink** and confirm to remove that grant without deleting the document.This remains available when the meeting is cancelled or no longer shared withyou; unavailable meeting details are hidden. See [Calendar meeting notes](calendar.md#meeting-notes).diff --git a/docs/agent-guide/media/calendar-notes/desktop.png b/docs/agent-guide/media/calendar-notes/desktop.pngindex 614a34f057..9dc2233f89 100644Binary files a/docs/agent-guide/media/calendar-notes/desktop.png and b/docs/agent-guide/media/calendar-notes/desktop.png differdiff --git a/docs/agent-guide/media/calendar-notes/link-desktop.png b/docs/agent-guide/media/calendar-notes/link-desktop.pngindex d3b5ee0c8b..f1846439a8 100644Binary files a/docs/agent-guide/media/calendar-notes/link-desktop.png and b/docs/agent-guide/media/calendar-notes/link-desktop.png differdiff --git a/docs/agent-guide/media/calendar-notes/link-phone.png b/docs/agent-guide/media/calendar-notes/link-phone.pngindex 53bdc9d57f..7080b56e7f 100644Binary files a/docs/agent-guide/media/calendar-notes/link-phone.png and b/docs/agent-guide/media/calendar-notes/link-phone.png differdiff --git a/docs/agent-guide/media/calendar-notes/phone.png b/docs/agent-guide/media/calendar-notes/phone.pngindex 481e5e9e0c..0bf113e5ff 100644Binary files a/docs/agent-guide/media/calendar-notes/phone.png and b/docs/agent-guide/media/calendar-notes/phone.png differdiff --git a/docs/architecture/calendar-meeting-notes.md b/docs/architecture/calendar-meeting-notes.mdindex f649c0a433..3793f118e6 100644--- a/docs/architecture/calendar-meeting-notes.md+++ b/docs/architecture/calendar-meeting-notes.md@@ -73,7 +73,9 @@ data source, query adapter, controller, and presentational view. It mounts withidesktop and mobile event details. Its shared dialog becomes a phone sheet with`Dialog.contentOwnsScroll`: only document results scroll, while context, sharing,and actions stay visible. Choices survive failures. Note options use labeled menu-actions; the host dialog guard follows both the menu and access dialog, and clears+actions; **Share** opens the existing document Share dialog, whose Meeting links+section owns optional team access. The host dialog guard follows the menu and+Share dialog, and clearswhen a note disappears during a live refresh.**Create** and **Link** stay beside the section title so additional notes can beadded without leaving the meeting. **Create** uses the standard Markdown creation@@ -82,8 +84,8 @@ captures the account and occurrence before creation starts, suppresses duplicateclicks, and retains the created document for retry if linking fails. A disposedview never navigates on a late result. There is no separate calendar-owned contentstore or create endpoint.-The document Share panel also lists owner-only durable links and offers inline-unlink confirmation. That list does not require current meeting access. It uses+The document Share panel also lists owner-only durable links, immediate optional+team access controls, and inline unlink confirmation. That list does not require current meeting access. It usesgeneric labels for inaccessible or indirectly shared meetings, so it cannot reveala richer canonical event title through a restricted provider projection.