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(mentions): paint unavailable preview sheets opaque (#9297)
Wolf Mermelstein0da1910ca533
diff --git a/apps/web/src/components/app/mobile/MobileDrawer.tsx b/apps/web/src/components/app/mobile/MobileDrawer.tsxindex f2220cdbff..cc4a0e05b9 100644--- a/apps/web/src/components/app/mobile/MobileDrawer.tsx+++ b/apps/web/src/components/app/mobile/MobileDrawer.tsx@@ -61,12 +61,18 @@ function MobileDrawerContent(maxHeight?: number;/** Initial/start height as a percentage of the viewport (vh). Clamped to 100. Fits content when omitted. */targetHeight?: number;+ /**+ * Paint the opaque menu fill instead of the default translucent glass.+ * Use when the sheet shows a message over page text (mention previews).+ */+ opaque?: boolean;}) {const [local, rest] = splitProps(props, ['class','maxHeight','targetHeight',+ 'opaque',]);const maxHeight = () =>@@ -93,7 +99,10 @@ function MobileDrawerContent(}}class={cn('portal-scope',- 'fixed! inset-x-2 bottom-[calc(var(--virtual-keyboard-height,0px)+8px)] z-modal mobile-sheet glass bg-menu-glass [--color-dialog:var(--color-menu-glass)] flex flex-col max-h-[min(var(--drawer-max-h),calc(100dvh-var(--safe-top,0px)-var(--virtual-keyboard-height,0px)-16px))] data-transitioning:transition-transform data-transitioning:duration-200 ease-out motion-reduce:transition-none',+ 'fixed! inset-x-2 bottom-[calc(var(--virtual-keyboard-height,0px)+8px)] z-modal mobile-sheet glass flex flex-col max-h-[min(var(--drawer-max-h),calc(100dvh-var(--safe-top,0px)-var(--virtual-keyboard-height,0px)-16px))] data-transitioning:transition-transform data-transitioning:duration-200 ease-out motion-reduce:transition-none',+ local.opaque+ ? 'bg-menu [--color-dialog:var(--color-menu)]'+ : 'bg-menu-glass [--color-dialog:var(--color-menu-glass)]',targetHeight() != null ? 'h-(--drawer-h)' : 'h-fit',virtualKeyboardVisible()? 'pb-4 has-[[data-drawer-scroll-body]]:pb-0'diff --git a/apps/web/src/lib/core/component/AccessErrorViews/Unauthorized.tsx b/apps/web/src/lib/core/component/AccessErrorViews/Unauthorized.tsxindex f6faff9401..8ea184789d 100644--- a/apps/web/src/lib/core/component/AccessErrorViews/Unauthorized.tsx+++ b/apps/web/src/lib/core/component/AccessErrorViews/Unauthorized.tsx@@ -2,14 +2,18 @@ import { useIsAuthenticated } from '@core/auth';import { useEmail } from '@core/context/user';import NoAccessGraphic from '@design/empty-state-no-access.svg';import { EmptyStatePanel } from '@ui';-import { onMount, type ParentProps } from 'solid-js';+import { onMount, type ParentProps, Show } from 'solid-js';import { openLoginModal } from '../TopBar/LoginButton';/*** @description This is the view for when a user tries to access an item that returns a 401 indicating they do not have permission to access it.* `noun` names the item when it is not a file, such as an event.+ * `compact` is the mention preview card: title and signed-in line only, so a+ * phone sheet does not stretch to the full-page empty state.*/-export default function Unauthorized(props: ParentProps<{ noun?: string }>) {+export default function Unauthorized(+ props: ParentProps<{ noun?: string; compact?: boolean }>+) {const currentUserEmail = useEmail();const isAuthenticated = useIsAuthenticated();@@ -19,17 +23,37 @@ export default function Unauthorized(props: ParentProps<{ noun?: string }>) {}});+ const title = () => `You don't have access to this ${props.noun ?? 'file'}`;+ const description = () =>+ currentUserEmail() ? `Signed in as ${currentUserEmail()}` : undefined;+return (- <EmptyStatePanel- centered- graphic={NoAccessGraphic}- graphicClass="mb-6"- title={`You don't have access to this ${props.noun ?? 'file'}`}- description={- currentUserEmail() ? `Signed in as ${currentUserEmail()}` : undefined+ <Show+ when={!props.compact}+ fallback={+ <div+ data-unauthorized-compact+ class="flex flex-col items-center py-6 text-center"+ >+ <h2 class="text-base font-semibold text-ink">{title()}</h2>+ <Show when={description()}>+ {(signedIn) => (+ <p class="mt-3 text-sm/6 text-ink-muted">{signedIn()}</p>+ )}+ </Show>+ {props.children}+ </div>}>- {props.children}- </EmptyStatePanel>+ <EmptyStatePanel+ centered+ graphic={NoAccessGraphic}+ graphicClass="mb-6"+ title={title()}+ description={description()}+ >+ {props.children}+ </EmptyStatePanel>+ </Show>);}diff --git a/apps/web/src/lib/core/component/DocumentPreview.tsx b/apps/web/src/lib/core/component/DocumentPreview.tsxindex cb77474858..6f052670bb 100644--- a/apps/web/src/lib/core/component/DocumentPreview.tsx+++ b/apps/web/src/lib/core/component/DocumentPreview.tsx@@ -1172,7 +1172,7 @@ export function DocumentPreviewContent(props: DocumentPreviewContentProps) {</div></Show>{noAccessItem().access === 'no_access' ? (- <Unauthorized noun={itemNoun()} />+ <Unauthorized compact noun={itemNoun()} />) : (<NotFound message={deletedMessage()} />)}diff --git a/apps/web/src/lib/core/component/DocumentPreviewSheet.tsx b/apps/web/src/lib/core/component/DocumentPreviewSheet.tsxindex a99066c115..c78732b38b 100644--- a/apps/web/src/lib/core/component/DocumentPreviewSheet.tsx+++ b/apps/web/src/lib/core/component/DocumentPreviewSheet.tsx@@ -9,7 +9,8 @@ import { DocumentPreviewSkeleton } from './DocumentPreviewSkeleton';/*** The preview card as a bottom sheet. `HoverCard` renders nothing on touch* devices, so a mention whose tap shows its preview instead of opening it- * presents the same card here.+ * presents the same card here. Opaque so page text cannot show through+ * unavailable-item empty states.*/export function DocumentPreviewSheet(props: DocumentPreviewContentProps & {@@ -30,7 +31,7 @@ export function DocumentPreviewSheet(><MobileDrawer.Portal><MobileDrawer.Overlay />- <MobileDrawer.Content aria-label="Preview">+ <MobileDrawer.Content aria-label="Preview" opaque><MobileDrawer.Handle /><MobileDrawer.ScrollBody class="px-3 text-ink"><Suspense fallback={<DocumentPreviewSkeleton />}>diff --git a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/browser-test/unavailable-mention.browser.e2e.ts b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/browser-test/unavailable-mention.browser.e2e.tsindex 091cb78644..f1584234c8 100644--- a/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/browser-test/unavailable-mention.browser.e2e.ts+++ b/apps/web/src/lib/core/component/LexicalMarkdown/component/decorator/browser-test/unavailable-mention.browser.e2e.ts@@ -132,4 +132,26 @@ test.describe('on a phone', () => {await expect(sheet.getByText(card, { exact: true })).toBeVisible();});}++ test('the no-access sheet is opaque over the page', async ({ page }) => {+ await page.goto(fixture);+ await chip(page, 'Hidden agent session', 'Private agent session').tap({+ force: true,+ });+ const sheet = page.getByRole('dialog', { name: 'Preview' });+ await expect(sheet).toBeVisible();+ const alpha = await sheet.evaluate((el) => {+ const color = getComputedStyle(el).backgroundColor;+ const canvas = document.createElement('canvas');+ canvas.width = 1;+ canvas.height = 1;+ const ctx = canvas.getContext('2d');+ if (!ctx) return 0;+ ctx.fillStyle = color;+ ctx.fillRect(0, 0, 1, 1);+ return ctx.getImageData(0, 0, 1, 1).data[3];+ });+ expect(alpha).toBe(255);+ await expect(sheet.locator('[data-unauthorized-compact]')).toBeVisible();+ });});diff --git a/docs/agent-guide/calendar.md b/docs/agent-guide/calendar.mdindex f5c9beafe6..0214a2c3b5 100644--- a/docs/agent-guide/calendar.md+++ b/docs/agent-guide/calendar.md@@ -743,7 +743,7 @@ in that list without a marker, as documents shared that way sit beside your own;names the shared event, so it opens for whoever can already see it. Posting it elsewhere doesnot share it on (only someone holding the event on their own calendar can), so people withoutaccess see `No Access`, like any other mention they cannot open; clicking it (a tap on a phone,-which opens a sheet) shows `You don't have access to this event`.+which opens an opaque sheet) shows `You don't have access to this event`.A calendar event mentioned in a channel message opens the calendar focused on the viewer'sown copy of the meeting. When a person holds the event on their own calendar and posts themention, it is shared read-only with the channel's current members: a member without a copy ofdiff --git a/docs/agent-guide/documents.md b/docs/agent-guide/documents.mdindex 8472f6b703..ee957baf1a 100644--- a/docs/agent-guide/documents.md+++ b/docs/agent-guide/documents.md@@ -2625,8 +2625,8 @@ appear below the header. Long titles wrap in place without a full-name tooltip.A reference to something deleted reads `Deleted`, and one the viewer can't openreads `No Access`. Clicking either keeps its card open instead of doing nothing,-and on a touch device a tap opens the same card as a bottom sheet. The card names-the item: `This document was deleted or doesn't exist.`, `This channel was deleted+and on a touch device a tap opens the same card as an opaque bottom sheet. The+card names the item: `This document was deleted or doesn't exist.`, `This channel was deletedor doesn't exist.`, `You don't have access to this event`, and so on (a calendarevent's reads `This event was deleted or cancelled.`). Skill, task and snippetreferences name their kind rather than "document". Database, form and routine