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(agents): use standard conversation share form (#6730)
Eric Hayes73b89a776300
diff --git a/apps/web/src/lib/core/component/TopBar/ShareButton.test.tsx b/apps/web/src/lib/core/component/TopBar/ShareButton.test.tsxindex 91ec81eb11..46ca81b1f0 100644--- a/apps/web/src/lib/core/component/TopBar/ShareButton.test.tsx+++ b/apps/web/src/lib/core/component/TopBar/ShareButton.test.tsx@@ -314,6 +314,24 @@ const share = () =>fireEvent.click(screen.getByRole('button', { name: 'Share' }));describe('agent session sharing', () => {+ it.each([false, true])(+ 'shows the standard share form for owners (mobile: %s)',+ (mobile) => {+ mocks.mobile = mobile;+ mountShare(true);+ expect(+ screen.getByRole('button', { name: 'Select channel' })+ ).toBeTruthy();+ expect(screen.getByRole('button', { name: 'Share' })).toBeTruthy();+ expect(screen.queryByRole('button', { name: 'Copy Link' })).toBeNull();+ expect(+ screen.queryByText(+ 'Recipients can view and control this agent session.'+ )+ ).toBeNull();+ }+ );+it('uses explicit identity outside a block', () => {mocks.inBlock = false;render(() => (@@ -346,9 +364,6 @@ describe('agent session sharing', () => {});it('shares the persisted session instead of its enclosing launcher identity', () => {const { onOpenChange } = mountShare(true);- expect(- screen.getByText('Recipients can view and control this agent session.')- ).toBeTruthy();expect(screen.queryByText('Can view')).toBeNull();expect(screen.queryByText('People with access')).toBeNull();expect(mocks.blockPermissionsRead).not.toHaveBeenCalled();diff --git a/apps/web/src/lib/core/component/TopBar/ShareButton.tsx b/apps/web/src/lib/core/component/TopBar/ShareButton.tsxindex a8097c7ee6..461785c84a 100644--- a/apps/web/src/lib/core/component/TopBar/ShareButton.tsx+++ b/apps/web/src/lib/core/component/TopBar/ShareButton.tsx@@ -139,10 +139,8 @@ async function fetchSharePermissions(id: string, itemType: ItemType) {}}-const agentSessionShareDescription = (canShare: boolean) =>- canShare- ? 'Recipients can view and control this agent session.'- : 'Only the owner can share access to this session. You can copy a link for people who already have access.';+const agentSessionShareDescription =+ 'Only the owner can share access to this session. You can copy a link for people who already have access.';interface IShareDialogContext {isOpen: Accessor<boolean>;@@ -551,9 +549,9 @@ function MobileShareDrawer(props: MobileShareDrawerProps) {display: effectiveActiveTab() === 'share' ? undefined : 'none',}}>- <Show when={props.itemType === 'agent_session'}>+ <Show when={!props.canForward}><p class="px-4 py-3 text-sm text-ink-muted">- {agentSessionShareDescription(props.canForward)}+ {agentSessionShareDescription}</p></Show><Show when={props.canForward}>@@ -581,7 +579,7 @@ function MobileShareDrawer(props: MobileShareDrawerProps) {blockName={props.blockAlias}/></Show>- <Show when={props.itemType === 'agent_session'}>+ <Show when={!props.canForward}><div class="px-4 py-3"><Button variant="outline" onClick={props.copyLink}><CopyIcon class="size-4" />@@ -1224,9 +1222,9 @@ export function ShareModal(props: ShareModalProps) {</Dialog.Title></Panel.Header><Panel.Body>- <Show when={props.itemType === 'agent_session'}>+ <Show when={!canForward()}><p class="px-4 py-3 text-sm text-ink-muted">- {agentSessionShareDescription(canForward())}+ {agentSessionShareDescription}</p></Show><Show when={canForward()}>@@ -1256,7 +1254,7 @@ export function ShareModal(props: ShareModalProps) {blockName={props.blockAlias}/></Show>- <Show when={props.itemType === 'agent_session'}>+ <Show when={!canForward()}><div class="flex justify-end px-4 py-3"><Button variant="outline" onClick={copyLink}><CopyIcon class="size-4" />diff --git a/docs/AGENT_GUIDE/ai-chat.md b/docs/AGENT_GUIDE/ai-chat.mdindex 0c3113d511..d1c6b27bcb 100644--- a/docs/AGENT_GUIDE/ai-chat.md+++ b/docs/AGENT_GUIDE/ai-chat.md@@ -404,7 +404,9 @@ select people or channels and send the session with an optional message usingthe same Share dialog and mobile drawer as documents. Sessions also support**Share** from entity list menus and the entity sharing shortcut. People receive it through a direct orgroup message. Recipients can view and control the session; there is no access-level selector. Cancel closes the composer without sending.+level selector. The owner sees the standard recipient-and-message form without+an extra session notice or Copy Link footer; **Copy Share Link** remains in+the header. Cancel closes the composer without sending.Other participants can copy a link for people who already have access, butcannot grant access. Copying a link alone never changes permissions. New,