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: make star, mute, sender and task actions report what happened (#8793)

teo2b3833378f16
diff --git a/apps/web/src/features/block-email/component/useEmailThreadTools.tsx b/apps/web/src/features/block-email/component/useEmailThreadTools.tsx
index ee237e23ef..52481c08f6 100644
--- a/apps/web/src/features/block-email/component/useEmailThreadTools.tsx
+++ b/apps/web/src/features/block-email/component/useEmailThreadTools.tsx
@@ -314,21 +314,27 @@ export function useEmailThreadTools(props: EmailThreadToolsOptions) {
label: 'Sender → Signal',
icon: SignalIcon,
action: () => emailCtx.markSenderSignal(),
- condition: () => isOwnThread() && senderBucket() !== 'signal',
+ condition: () =>
+ isOwnThread() &&
+ emailCtx.canActOnSender() &&
+ senderBucket() !== 'signal',
},
{
group: 'sender',
label: 'Sender → Noise',
icon: NoiseIcon,
action: () => emailCtx.markSenderNoise(),
- condition: () => isOwnThread() && senderBucket() !== 'noise',
+ condition: () =>
+ isOwnThread() &&
+ emailCtx.canActOnSender() &&
+ senderBucket() !== 'noise',
},
{
group: 'sender',
label: 'Block Sender',
icon: ProhibitIcon,
action: () => emailCtx.blockSender(),
- condition: isOwnThread,
+ condition: () => isOwnThread() && emailCtx.canActOnSender(),
},
];
diff --git a/apps/web/src/features/block-email/util/emailHotkeys.ts b/apps/web/src/features/block-email/util/emailHotkeys.ts
index 5f7c5bccff..ab2b41692f 100644
--- a/apps/web/src/features/block-email/util/emailHotkeys.ts
+++ b/apps/web/src/features/block-email/util/emailHotkeys.ts
@@ -78,6 +78,7 @@ export function registerEmailHotkeys(
keyDownHandler: handlers.blockSender,
hotkeyToken: TOKENS.email.blockSender,
displayPriority: 5,
+ condition: () => handlers.canActOnSender(),
});
registerHotkey({
scopeId: scopeId,
@@ -85,6 +86,7 @@ export function registerEmailHotkeys(
keyDownHandler: handlers.markSenderSignal,
hotkeyToken: TOKENS.email.markSenderSignal,
displayPriority: 5,
+ condition: () => handlers.canActOnSender(),
});
registerHotkey({
scopeId: scopeId,
@@ -92,6 +94,7 @@ export function registerEmailHotkeys(
keyDownHandler: handlers.markSenderNoise,
hotkeyToken: TOKENS.email.markSenderNoise,
displayPriority: 5,
+ condition: () => handlers.canActOnSender(),
});
registerHotkey({
hotkey: ['arrowup', 'p'],
diff --git a/apps/web/src/features/email-thread/context/email-thread-context.ts b/apps/web/src/features/email-thread/context/email-thread-context.ts
index f50c17bde8..aff6b352c6 100644
--- a/apps/web/src/features/email-thread/context/email-thread-context.ts
+++ b/apps/web/src/features/email-thread/context/email-thread-context.ts
@@ -47,6 +47,7 @@ export interface EmailThreadCommands {
isThreadMarkedRead: Accessor<boolean>;
markThreadUnread(): boolean;
markThreadRead(): boolean;
+ canActOnSender: Accessor<boolean>;
blockSender(): boolean;
markSenderSignal(): boolean;
markSenderNoise(): boolean;
diff --git a/apps/web/src/features/email-thread/core/thread-keyboard.ts b/apps/web/src/features/email-thread/core/thread-keyboard.ts
index 9fce776e51..6cf016cfee 100644
--- a/apps/web/src/features/email-thread/core/thread-keyboard.ts
+++ b/apps/web/src/features/email-thread/core/thread-keyboard.ts
@@ -4,6 +4,9 @@ export interface EmailThreadKeyboardHandlers {
replyToFocusedMessage: () => boolean;
replyAllToFocusedMessage?: () => boolean;
forwardFocusedMessage: () => boolean;
+ /** Gates the sender actions, which have no target when every message is
+ * from the viewer. */
+ canActOnSender: () => boolean;
blockSender: () => boolean;
markDone: () => boolean;
markNotDone: () => boolean;
diff --git a/apps/web/src/features/email-thread/core/thread-messages.ts b/apps/web/src/features/email-thread/core/thread-messages.ts
index 08cc1b8807..7521457b77 100644
--- a/apps/web/src/features/email-thread/core/thread-messages.ts
+++ b/apps/web/src/features/email-thread/core/thread-messages.ts
@@ -2,11 +2,22 @@ import type { EmailMessage } from '../../email-message/core/email-message';
import { isViewerAddress } from '../../email-message/core/email-user';
import type { EmailThread } from './email-thread';
-export function selectThreadSender(thread: EmailThread, viewerEmail?: string) {
+/**
+ * Sender actions target the earliest sender other than the viewer: the
+ * inbox's own address or any other address of theirs. With no inbox address
+ * the viewer is unknown, so no sender is.
+ */
+export function selectThreadSender(
+ thread: EmailThread,
+ viewerEmail?: string,
+ ...otherViewerEmails: (string | undefined)[]
+) {
if (!viewerEmail) return undefined;
+ const viewer = [viewerEmail, ...otherViewerEmails];
return selectThreadMessages(thread).messages.find(
(message) =>
- message.from?.email && !isViewerAddress(message.from.email, viewerEmail)
+ message.from?.email &&
+ !viewer.some((email) => isViewerAddress(message.from?.email, email))
)?.from?.email;
}
diff --git a/apps/web/src/features/email-thread/primitives/email-thread-state.ts b/apps/web/src/features/email-thread/primitives/email-thread-state.ts
index 847a416396..371aa1b790 100644
--- a/apps/web/src/features/email-thread/primitives/email-thread-state.ts
+++ b/apps/web/src/features/email-thread/primitives/email-thread-state.ts
@@ -110,6 +110,9 @@ export type EmailThreadState = {
markThreadUnread: () => boolean;
/** Re-marks the thread read after a mark-unread. */
markThreadRead: () => boolean;
+ /** True when a sender other than the viewer exists for the sender actions
+ * to target. False on a thread the viewer sent alone. */
+ canActOnSender: Accessor<boolean>;
blockSender: () => boolean;
markSenderSignal: () => boolean;
markSenderNoise: () => boolean;
diff --git a/apps/web/src/features/email-thread/primitives/thread-navigation.ts b/apps/web/src/features/email-thread/primitives/thread-navigation.ts
index 3f90e21735..526b654155 100644
--- a/apps/web/src/features/email-thread/primitives/thread-navigation.ts
+++ b/apps/web/src/features/email-thread/primitives/thread-navigation.ts
@@ -631,6 +631,7 @@ export function createThreadNavigation(
replyToFocusedMessage: () => openHotkeyTarget('reply-all'),
replyAllToFocusedMessage: () => openHotkeyTarget('reply-all'),
forwardFocusedMessage: () => openHotkeyTarget('forward'),
+ canActOnSender: context.canActOnSender,
blockSender: context.blockSender,
markDone,
markNotDone: context.markThreadNotDone,
diff --git a/apps/web/src/features/email-thread/tests/fixtures.ts b/apps/web/src/features/email-thread/tests/fixtures.ts
index 3a98e6890f..2efa6cda40 100644
--- a/apps/web/src/features/email-thread/tests/fixtures.ts
+++ b/apps/web/src/features/email-thread/tests/fixtures.ts
@@ -51,6 +51,7 @@ export function createThreadContext(
isThreadMarkedRead: () => false,
markThreadUnread: () => false,
markThreadRead: () => false,
+ canActOnSender: () => false,
blockSender: () => false,
markSenderSignal: () => false,
markSenderNoise: () => false,
diff --git a/apps/web/src/features/email-thread/thread-action-adapter.tsx b/apps/web/src/features/email-thread/thread-action-adapter.tsx
index 5ece4a4ead..ea715f93de 100644
--- a/apps/web/src/features/email-thread/thread-action-adapter.tsx
+++ b/apps/web/src/features/email-thread/thread-action-adapter.tsx
@@ -1,3 +1,4 @@
+import { useEmail } from '@core/context/user';
import { fireAndForget } from '@core/util/fireAndForget';
import { useInboxEmail } from '@queries/email/inbox-email';
import { useNonPrimaryEmailLinkIdHeader } from '@queries/email/link';
@@ -24,10 +25,16 @@ export function createThreadActionAdapter(
);
const read = createThreadReadAdapter(threadId, threadSource, toHeaderLinkId);
const viewerEmail = useInboxEmail(() => threadSource()?.link_id);
+ const loginEmail = useEmail();
+ // Mail sent from the Macro login is the viewer's own too, even in an inbox
+ // linked under another address. Until the inbox address loads, no sender
+ // is known.
const getSenderEmail = (): string | undefined => {
const thread = threadSource();
- return thread ? selectThreadSender(thread, viewerEmail()) : undefined;
+ return thread
+ ? selectThreadSender(thread, viewerEmail(), loginEmail())
+ : undefined;
};
const blockSender = () => {
@@ -72,6 +79,7 @@ export function createThreadActionAdapter(
return {
...completion,
...read,
+ canActOnSender: () => getSenderEmail() !== undefined,
blockSender,
markSenderSignal,
markSenderNoise,
diff --git a/apps/web/src/features/next-soup/actions/make-favorite-action.test.tsx b/apps/web/src/features/next-soup/actions/make-favorite-action.test.tsx
new file mode 100644
index 0000000000..2669550a6e
--- /dev/null
+++ b/apps/web/src/features/next-soup/actions/make-favorite-action.test.tsx
@@ -0,0 +1,109 @@
+import { toast } from '@core/component/Toast/Toast';
+import type { EntityData } from '@entity';
+import type { Client } from '@urql/core';
+import type { JSX } from 'solid-js';
+import { render } from 'solid-js/web';
+import { afterEach, beforeEach, expect, it, vi } from 'vitest';
+import { fromValue } from 'wonka';
+
+const getGraphqlSoupClient = vi.hoisted(() => vi.fn());
+
+vi.mock('@service-storage/graphql-soup', () => ({ getGraphqlSoupClient }));
+vi.mock('@core/context/user', () => ({ useIsAuthenticated: () => () => true }));
+vi.mock('@core/constant/featureFlags', () => ({
+ enableGraphqlSoup: {},
+ isFeatureEnabled: () => true,
+}));
+vi.mock('@service-storage/client', () => ({ storageServiceClient: {} }));
+vi.mock('@queries/client', () => ({ queryClient: {} }));
+vi.mock('@core/component/Toast/Toast', () => ({
+ toast: { success: vi.fn(), failure: vi.fn(), alert: vi.fn() },
+}));
+
+import { makeFavoriteAction } from './make-favorite-action';
+
+const doc = { type: 'document', id: 'document-3' } as EntityData;
+let mutation: ReturnType<typeof vi.fn>;
+let dispose: (() => void) | undefined;
+
+function setFavoriteResponse(extensions?: Record<string, unknown>) {
+ return {
+ data: {
+ setFavorite: {
+ __typename: 'SetFavoritePayload',
+ result: { __typename: 'GraphqlMutationSuccess' },
+ favorite: {
+ __typename: 'GraphqlFavorite',
+ id: 'document:document-3',
+ entityType: 'DOCUMENT',
+ entityId: 'document-3',
+ sortOrder: 0,
+ createdAt: '2026-01-01T00:00:00Z',
+ fileType: 'md',
+ documentSubType: null,
+ channelType: null,
+ channelId: null,
+ },
+ },
+ },
+ extensions,
+ };
+}
+
+function renderAction() {
+ let action!: ReturnType<typeof makeFavoriteAction>;
+ dispose = render(() => {
+ action = makeFavoriteAction();
+ return null as unknown as JSX.Element;
+ }, document.body);
+ return action;
+}
+
+beforeEach(() => {
+ mutation = vi.fn();
+ getGraphqlSoupClient.mockReturnValue({
+ executeQuery: vi.fn(() =>
+ fromValue({
+ data: { user: { id: 'macro|[email protected]', favorites: [] } },
+ })
+ ),
+ mutation,
+ } as unknown as Client);
+});
+
+afterEach(() => {
+ dispose?.();
+ dispose = undefined;
+ document.body.replaceChildren();
+ vi.clearAllMocks();
+});
+
+it('does not claim success for a favorite that is still queued', async () => {
+ mutation.mockReturnValue({
+ toPromise: async () =>
+ setFavoriteResponse({
+ normalizedCacheMutationDisposition: {
+ kind: 'queued',
+ transactionId: 'transaction-1',
+ },
+ }),
+ });
+
+ await renderAction().execute([doc]);
+
+ expect(mutation).toHaveBeenCalledOnce();
+ expect(toast.success).not.toHaveBeenCalled();
+ expect(toast.failure).not.toHaveBeenCalled();
+ expect(toast.alert).toHaveBeenCalledOnce();
+});
+
+it('confirms a favorite the server committed', async () => {
+ mutation.mockReturnValue({
+ toPromise: async () => setFavoriteResponse(),
+ });
+
+ await renderAction().execute([doc]);
+
+ expect(toast.success).toHaveBeenCalledOnce();
+ expect(toast.alert).not.toHaveBeenCalled();
+});
diff --git a/apps/web/src/features/next-soup/actions/make-favorite-action.ts b/apps/web/src/features/next-soup/actions/make-favorite-action.ts
index b27ea74e48..a118b8f12c 100644
--- a/apps/web/src/features/next-soup/actions/make-favorite-action.ts
+++ b/apps/web/src/features/next-soup/actions/make-favorite-action.ts
@@ -67,22 +67,27 @@ export const makeFavoriteAction = () => {
// Each mutation rolls its own optimistic change back on failure, so report
// what actually happened rather than an all-or-nothing result.
const failed = results.filter((r) => r.status === 'rejected').length;
+ const queued = results.filter(
+ (r) => r.status === 'fulfilled' && r.value.kind === 'queued'
+ ).length;
const succeeded = results.length - failed;
- if (failed === 0) {
- toast.success(
- succeeded > 1
- ? t(
- shouldRemove
- ? 'entityActions.toastRemovedCountFromFavorites'
- : 'entityActions.toastAddedCountToFavorites',
- { count: succeeded }
- )
- : t(
- shouldRemove
- ? 'entityActions.toastRemovedFromFavorites'
- : 'entityActions.toastAddedToFavorites'
- )
- );
+ const summary =
+ succeeded > 1
+ ? t(
+ shouldRemove
+ ? 'entityActions.toastRemovedCountFromFavorites'
+ : 'entityActions.toastAddedCountToFavorites',
+ { count: succeeded }
+ )
+ : t(
+ shouldRemove
+ ? 'entityActions.toastRemovedFromFavorites'
+ : 'entityActions.toastAddedToFavorites'
+ );
+ if (failed === 0 && queued === 0) {
+ toast.success(summary);
+ } else if (failed === 0) {
+ toast.alert(t('entityActions.toastWaitingToSync', { message: summary }));
} else if (succeeded === 0) {
toast.failure(t('entityActions.toastFavoritesUpdateFailed'));
} else {
diff --git a/apps/web/src/features/task-composer/primitives/task-composer.ts b/apps/web/src/features/task-composer/primitives/task-composer.ts
index 542f3f770c..6c89f5df78 100644
--- a/apps/web/src/features/task-composer/primitives/task-composer.ts
+++ b/apps/web/src/features/task-composer/primitives/task-composer.ts
@@ -28,11 +28,7 @@ import { initializeEditorEmpty } from '@core/component/LexicalMarkdown/utils';
import type { PortalScope } from '@core/component/ScopedPortal';
import { toast } from '@core/component/Toast/Toast';
import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';
-import { isTouchDevice } from '@core/mobile/isTouchDevice';
import { fireAndForget } from '@core/util/fireAndForget';
-import { buildSimpleEntityUrl } from '@core/util/url';
-import ArrowSquareOutIcon from '@icon/system/regular/arrow-square-out.svg';
-import SplitIcon from '@icon/system/regular/square-half.svg';
import { Telemetry } from '@macro-inc/observability';
import { SYSTEM_PROPERTY_IDS } from '@property/constants';
import type { PropertyApiValues } from '@property/types';
@@ -52,6 +48,7 @@ import {
import { reconcile, unwrap } from 'solid-js/store';
import { tabbable } from 'tabbable';
import type { ComposeTaskProps, ComposeTaskSuccess } from '../core/types';
+import { showTaskCreatedToast } from './taskCreatedToast';
type ComposerTagLayoutMode = 'bottom' | 'title';
@@ -339,46 +336,6 @@ export function createTaskComposer(
return true;
};
- const showTaskCreatedToast = async (
- documentId: string,
- optimisticSnapshot: Uint8Array | undefined
- ) => {
- // Auto-copy link to clipboard
- const url = buildSimpleEntityUrl({ type: 'task', id: documentId });
- let linkCopied = false;
- try {
- await navigator.clipboard.writeText(url);
- linkCopied = true;
- } catch {
- toast.failure('Failed to copy link to clipboard');
- }
-
- const task = { id: documentId, optimisticSnapshot };
- const openTask = (newSplit: boolean) => {
- if (toastId !== undefined) toast.dismiss(toastId);
- host.openTask(task, { newSplit, referredFrom: null });
- };
- const toastId = toast.success('Task created', {
- subtext: linkCopied ? 'Link copied' : undefined,
- actions: [
- {
- label: 'Open',
- icon: ArrowSquareOutIcon,
- onClick: () => openTask(false),
- },
- ...(!isTouchDevice()
- ? [
- {
- label: 'Open (New Split)',
- icon: SplitIcon,
- onClick: () => openTask(true),
- },
- ]
- : []),
- ],
- });
- };
-
const recoverDraft = (id: string) => {
if (currentUserId() !== draftOwner) return;
host.openComposer({
@@ -511,10 +468,7 @@ export function createTaskComposer(
} else if (props.onSuccess) {
props.onSuccess({ documentId, title: taskTitle, content: taskContent });
} else {
- fireAndForget(
- showTaskCreatedToast(documentId, initialSnapshot),
- 'compose-task'
- );
+ showTaskCreatedToast(documentId, initialSnapshot, host.openTask);
}
linkCreatedTask({ documentId, title: taskTitle, content: taskContent });
props.onCreateTask?.(taskTitle, taskContent);
diff --git a/apps/web/src/features/task-composer/primitives/taskCreatedToast.test.ts b/apps/web/src/features/task-composer/primitives/taskCreatedToast.test.ts
new file mode 100644
index 0000000000..4cb7e8fc0b
--- /dev/null
+++ b/apps/web/src/features/task-composer/primitives/taskCreatedToast.test.ts
@@ -0,0 +1,105 @@
+import { toast } from '@core/component/Toast/Toast';
+import { isTouchDevice } from '@core/mobile/isTouchDevice';
+import { afterEach, beforeEach, expect, it, vi } from 'vitest';
+import { showTaskCreatedToast } from './taskCreatedToast';
+
+vi.mock('@core/component/Toast/Toast', () => ({
+ toast: { success: vi.fn(), failure: vi.fn(), dismiss: vi.fn() },
+}));
+vi.mock('@core/mobile/isTouchDevice', () => ({ isTouchDevice: vi.fn() }));
+
+const writeText = vi.fn();
+const openTask = vi.fn();
+const originalClipboard = Object.getOwnPropertyDescriptor(
+ navigator,
+ 'clipboard'
+);
+beforeEach(() => {
+ Object.defineProperty(navigator, 'clipboard', {
+ configurable: true,
+ value: { writeText },
+ });
+});
+afterEach(() => {
+ vi.resetAllMocks();
+ if (originalClipboard)
+ Object.defineProperty(navigator, 'clipboard', originalClipboard);
+ else Reflect.deleteProperty(navigator, 'clipboard');
+});
+
+it('announces the task while the clipboard write is still pending', () => {
+ writeText.mockReturnValue(new Promise<void>(() => {}));
+
+ showTaskCreatedToast('task-1', undefined, openTask);
+
+ expect(toast.success).toHaveBeenCalledTimes(1);
+});
+
+it('opens the created task from the toast and copies its link', () => {
+ writeText.mockResolvedValue(undefined);
+ vi.mocked(toast.success).mockReturnValue(7);
+
+ showTaskCreatedToast('task-1', undefined, openTask);
+
+ expect(writeText).toHaveBeenCalledWith(
+ expect.stringMatching(/\/task\/task-1$/)
+ );
+ const [, options] = vi.mocked(toast.success).mock.calls[0];
+ options?.actions?.find((action) => action.label === 'Open')?.onClick();
+ expect(openTask).toHaveBeenCalledWith(
+ { id: 'task-1', optimisticSnapshot: undefined },
+ { newSplit: false, referredFrom: null }
+ );
+ expect(toast.dismiss).toHaveBeenCalledWith(7);
+ expect(vi.mocked(toast.dismiss).mock.invocationCallOrder[0]).toBeLessThan(
+ openTask.mock.invocationCallOrder[0]
+ );
+});
+
+it('offers a new split on desktop and dismisses the toast before opening it', () => {
+ writeText.mockResolvedValue(undefined);
+ vi.mocked(isTouchDevice).mockReturnValue(false);
+ vi.mocked(toast.success).mockReturnValue(7);
+
+ showTaskCreatedToast('task-1', undefined, openTask);
+
+ const [, options] = vi.mocked(toast.success).mock.calls[0];
+ expect(options?.actions?.map((action) => action.label)).toEqual([
+ 'Open',
+ 'Open (New Split)',
+ ]);
+ options?.actions
+ ?.find((action) => action.label === 'Open (New Split)')
+ ?.onClick();
+ expect(toast.dismiss).toHaveBeenCalledWith(7);
+ expect(openTask).toHaveBeenCalledWith(
+ { id: 'task-1', optimisticSnapshot: undefined },
+ { newSplit: true, referredFrom: null }
+ );
+ expect(vi.mocked(toast.dismiss).mock.invocationCallOrder[0]).toBeLessThan(
+ openTask.mock.invocationCallOrder[0]
+ );
+});
+
+it('leaves out the new split action on touch devices', () => {
+ writeText.mockResolvedValue(undefined);
+ vi.mocked(isTouchDevice).mockReturnValue(true);
+
+ showTaskCreatedToast('task-1', undefined, openTask);
+
+ const [, options] = vi.mocked(toast.success).mock.calls[0];
+ expect(options?.actions?.map((action) => action.label)).toEqual(['Open']);
+});
+
+it('keeps the task toast when the clipboard denies the write', async () => {
+ const denial = new DOMException('denied', 'NotAllowedError');
+ const deniedWrite = Promise.reject(denial);
+ writeText.mockReturnValue(deniedWrite);
+
+ showTaskCreatedToast('task-1', undefined, openTask);
+ // The helper awaited this promise first, so its rejection handling has run.
+ await expect(deniedWrite).rejects.toBe(denial);
+
+ expect(toast.success).toHaveBeenCalledTimes(1);
+ expect(toast.failure).not.toHaveBeenCalled();
+});
diff --git a/apps/web/src/features/task-composer/primitives/taskCreatedToast.ts b/apps/web/src/features/task-composer/primitives/taskCreatedToast.ts
new file mode 100644
index 0000000000..2f03ff6169
--- /dev/null
+++ b/apps/web/src/features/task-composer/primitives/taskCreatedToast.ts
@@ -0,0 +1,52 @@
+import { toast } from '@core/component/Toast/Toast';
+import { isTouchDevice } from '@core/mobile/isTouchDevice';
+import { fireAndForget } from '@core/util/fireAndForget';
+import { buildSimpleEntityUrl } from '@core/util/url';
+import ArrowSquareOutIcon from '@icon/system/regular/arrow-square-out.svg';
+import SplitIcon from '@icon/system/regular/square-half.svg';
+import type { TaskComposerHost } from './task-composer';
+
+export function showTaskCreatedToast(
+ documentId: string,
+ optimisticSnapshot: Uint8Array | undefined,
+ openTask: TaskComposerHost['openTask']
+) {
+ const task = { id: documentId, optimisticSnapshot };
+ const open = (newSplit: boolean) => {
+ if (toastId !== undefined) toast.dismiss(toastId);
+ openTask(task, { newSplit, referredFrom: null });
+ };
+ const toastId = toast.success('Task created', {
+ actions: [
+ {
+ label: 'Open',
+ icon: ArrowSquareOutIcon,
+ onClick: () => open(false),
+ },
+ ...(!isTouchDevice()
+ ? [
+ {
+ label: 'Open (New Split)',
+ icon: SplitIcon,
+ onClick: () => open(true),
+ },
+ ]
+ : []),
+ ],
+ });
+
+ // The write needs the click's user activation, which can lapse while the
+ // server creates the task. The browser then denies it or holds it behind a
+ // permission prompt, and the toast must not wait on either.
+ fireAndForget(copyTaskLink(documentId), 'compose-task');
+}
+
+async function copyTaskLink(documentId: string) {
+ try {
+ await navigator.clipboard.writeText(
+ buildSimpleEntityUrl({ type: 'task', id: documentId })
+ );
+ } catch {
+ // A denied write is expected, and the toast already confirmed the task.
+ }
+}
diff --git a/apps/web/src/lib/i18n/locales/en/entity-actions.ts b/apps/web/src/lib/i18n/locales/en/entity-actions.ts
index e7802185dd..5ded64857e 100644
--- a/apps/web/src/lib/i18n/locales/en/entity-actions.ts
+++ b/apps/web/src/lib/i18n/locales/en/entity-actions.ts
@@ -174,6 +174,7 @@ export default {
toastCountNotRestored: { other: '{{count}} could not be restored.' },
toastNotificationsNotRestored: 'Some notifications could not be restored.',
toastWithWarnings: '{{message}}. {{warnings}}',
+ toastWaitingToSync: '{{message}}, waiting to sync',
toastMarkedRead: 'Marked as read',
toastMarkedReadCount: {
one: 'Marked {{count}} item as read',
diff --git a/apps/web/src/lib/queries/favorites/favorites.test.tsx b/apps/web/src/lib/queries/favorites/favorites.test.tsx
index 2f0dac3894..0338e4287a 100644
--- a/apps/web/src/lib/queries/favorites/favorites.test.tsx
+++ b/apps/web/src/lib/queries/favorites/favorites.test.tsx
@@ -348,6 +348,38 @@ describe('favorites transport', () => {
mocks.getSoupEntity.mockReset();
});
+ it.each(['add', 'remove'] as const)(
+ 'settles an offline REST favorite %s instead of waiting for the network',
+ async (kind) => {
+ mocks.graphqlSoupEnabled.mockReturnValue(false);
+ onlineManager.setOnline(false);
+ const networkDown = new TypeError('Failed to fetch');
+ mocks.addFavoriteRest.mockRejectedValue(networkDown);
+ mocks.removeFavoriteRest.mockRejectedValue(networkDown);
+ const starred = { favorites: [favorite('document-1', 0)] };
+ testQueryClient.setQueryData<FavoritesList>(
+ favoriteKeys.list().queryKey,
+ kind === 'add' ? { favorites: [] } : starred
+ );
+ const mutations = renderHook(() => ({
+ add: useAddFavoriteMutation(),
+ remove: useRemoveFavoriteMutation(),
+ }));
+
+ await expect(
+ mutations[kind].mutateAsync({
+ entityType: 'document',
+ entityId: 'document-1',
+ })
+ ).rejects.toBe(networkDown);
+ expect(
+ testQueryClient
+ .getQueryData<FavoritesList>(favoriteKeys.list().queryKey)
+ ?.favorites.map((item) => item.entityId)
+ ).toEqual(kind === 'add' ? [] : ['document-1']);
+ }
+ );
+
it('keeps REST reorder optimism while GraphQL Soup is disabled', async () => {
mocks.graphqlSoupEnabled.mockReturnValue(false);
testQueryClient.setQueryData<FavoritesList>(favoriteKeys.list().queryKey, {
diff --git a/apps/web/src/lib/queries/favorites/favorites.ts b/apps/web/src/lib/queries/favorites/favorites.ts
index be43af273c..b69b277564 100644
--- a/apps/web/src/lib/queries/favorites/favorites.ts
+++ b/apps/web/src/lib/queries/favorites/favorites.ts
@@ -10,7 +10,7 @@ import type { AddFavoriteRequest } from '@service-storage/generated/schemas/addF
import type { Favorite } from '@service-storage/generated/schemas/favorite';
import type { FavoritesList } from '@service-storage/generated/schemas/favoritesList';
import type { ListFavoritesParams } from '@service-storage/generated/schemas/listFavoritesParams';
-import type { ReorderFavoritesResult } from '@service-storage/graphql-favorites';
+import type { FavoriteWriteResult } from '@service-storage/graphql-favorites';
import { queryOptions, useMutation, useQuery } from '@tanstack/solid-query';
import type { Accessor } from 'solid-js';
@@ -205,9 +205,13 @@ function updateSoupFavorite(entityId: string, favorite: boolean) {
type FavoriteMutationContext = { rollback: () => void } | undefined;
+// A paused REST toggle lives only in memory and replays in parallel on
+// reconnect, so an offline toggle must fail and roll back instead of waiting.
+const TOGGLE_NETWORK_MODE = 'always';
+
type AddFavoriteArgs = AddFavoriteRequest;
type AddFavoriteCallbacks = FavoriteMutationCallbacks<
- Favorite | undefined,
+ FavoriteWriteResult,
AddFavoriteArgs,
FavoriteMutationContext
>;
@@ -227,9 +231,17 @@ export function useAddFavoriteMutation(callbacks?: AddFavoriteCallbacks) {
}
return useMutation(() => ({
- mutationFn: async (args: AddFavoriteArgs) =>
- await throwOnErr(() => storageServiceClient.favorites.addFavorite(args)),
- ...withCallbacks<Favorite, Error, AddFavoriteArgs, FavoriteMutationContext>(
+ networkMode: TOGGLE_NETWORK_MODE,
+ mutationFn: async (args: AddFavoriteArgs): Promise<FavoriteWriteResult> => {
+ await throwOnErr(() => storageServiceClient.favorites.addFavorite(args));
+ return { kind: 'committed' };
+ },
+ ...withCallbacks<
+ FavoriteWriteResult,
+ Error,
+ AddFavoriteArgs,
+ FavoriteMutationContext
+ >(
{
onMutate: async (args: AddFavoriteArgs) => {
await queryClient.cancelQueries({
@@ -268,7 +280,7 @@ type RemoveFavoriteArgs = {
entityId: string;
};
type RemoveFavoriteCallbacks = FavoriteMutationCallbacks<
- void,
+ FavoriteWriteResult,
RemoveFavoriteArgs,
FavoriteMutationContext
>;
@@ -279,12 +291,21 @@ export function useRemoveFavoriteMutation(callbacks?: RemoveFavoriteCallbacks) {
}
return useMutation(() => ({
- mutationFn: async (args: RemoveFavoriteArgs) => {
+ networkMode: TOGGLE_NETWORK_MODE,
+ mutationFn: async (
+ args: RemoveFavoriteArgs
+ ): Promise<FavoriteWriteResult> => {
await throwOnErr(() =>
storageServiceClient.favorites.removeFavoriteByEntity(args)
);
+ return { kind: 'committed' };
},
- ...withCallbacks<void, Error, RemoveFavoriteArgs, FavoriteMutationContext>(
+ ...withCallbacks<
+ FavoriteWriteResult,
+ Error,
+ RemoveFavoriteArgs,
+ FavoriteMutationContext
+ >(
{
onMutate: async (args: RemoveFavoriteArgs) => {
await queryClient.cancelQueries({
@@ -323,7 +344,7 @@ type ReorderFavoritesArgs = {
favorites: { entityType: FavoriteEntityType; entityId: string }[];
};
type ReorderFavoritesCallbacks = FavoriteMutationCallbacks<
- ReorderFavoritesResult,
+ FavoriteWriteResult,
ReorderFavoritesArgs,
FavoriteMutationContext
>;
@@ -338,7 +359,7 @@ export function useReorderFavoritesMutation(
return useMutation(() => ({
mutationFn: async (
args: ReorderFavoritesArgs
- ): Promise<ReorderFavoritesResult> => {
+ ): Promise<FavoriteWriteResult> => {
// Entities the user has not favorited (e.g. an optimistic row whose add
// is still in flight) are ignored by the backend.
if (args.favorites.length === 0) return { kind: 'committed' };
@@ -350,7 +371,7 @@ export function useReorderFavoritesMutation(
return { kind: 'committed' };
},
...withCallbacks<
- ReorderFavoritesResult,
+ FavoriteWriteResult,
Error,
ReorderFavoritesArgs,
FavoriteMutationContext
diff --git a/apps/web/src/lib/queries/favorites/graphql.test.tsx b/apps/web/src/lib/queries/favorites/graphql.test.tsx
index 6c0b7f4b61..229db1b36b 100644
--- a/apps/web/src/lib/queries/favorites/graphql.test.tsx
+++ b/apps/web/src/lib/queries/favorites/graphql.test.tsx
@@ -222,7 +222,7 @@ describe('GraphQL favorites queries', () => {
]);
});
- it('returns the add payload consistently without any mounted query', async () => {
+ it('reports a committed add consistently without any mounted query', async () => {
const context = { rollback: vi.fn() };
const onSuccess = vi.fn();
const onSettled = vi.fn();
@@ -235,33 +235,12 @@ describe('GraphQL favorites queries', () => {
);
const input = { entityType: 'document' as const, entityId: 'document-1' };
const result = await mutation.mutateAsync(input);
- expect(result).toMatchObject({
- entityId: 'document-1',
- sortOrder: 1,
- fileType: 'md',
- createdAt: '2026-01-01T00:00:00Z',
- });
+ expect(result).toEqual({ kind: 'committed' });
expect(onSuccess).toHaveBeenCalledWith(result, input, context);
expect(onSettled).toHaveBeenCalledWith(result, null, input, context);
expect(executeQuery).not.toHaveBeenCalled();
});
- it('does not replace an add response with a stale mounted query record', async () => {
- executeQuery.mockImplementation(() =>
- fromValue(favoritesResult([graphqlFavorite('document-1', 99)]))
- );
- const hooks = renderHook(() => ({
- query: createGraphqlFavoritesQuery(),
- mutation: useAddFavoriteMutation(),
- }));
- const result = await hooks.mutation.mutateAsync({
- entityType: 'document',
- entityId: 'document-1',
- });
- expect(result?.sortOrder).toBe(1);
- expect(hooks.query.data?.favorites[0].sortOrder).toBe(99);
- });
-
it('accepts superseded toggles without an error or stale-data refetch', async () => {
executeMutation.mockReturnValue({
toPromise: async () => ({
@@ -281,9 +260,10 @@ describe('GraphQL favorites queries', () => {
mutation: createGraphqlAddFavoriteMutation({ onError, onSuccess }),
}));
const input = { entityType: 'document' as const, entityId: 'document-1' };
- await expect(hooks.mutation.mutateAsync(input)).resolves.toBeUndefined();
+ const queued = { kind: 'queued', transactionId: 'new' };
+ await expect(hooks.mutation.mutateAsync(input)).resolves.toEqual(queued);
expect(onError).not.toHaveBeenCalled();
- expect(onSuccess).toHaveBeenCalledWith(undefined, input, undefined);
+ expect(onSuccess).toHaveBeenCalledWith(queued, input, undefined);
expect(executeQuery).toHaveBeenCalledOnce();
});
@@ -506,10 +486,7 @@ describe('GraphQL favorites queries', () => {
requestPolicy: 'cache-and-network',
});
expect(onSuccess).toHaveBeenCalledWith(
- expect.objectContaining({
- entityType: 'document',
- entityId: 'document-1',
- }),
+ { kind: 'committed' },
{ entityType: 'document', entityId: 'document-1' },
undefined
);
@@ -544,7 +521,7 @@ describe('GraphQL favorites queries', () => {
entityId: 'document-3',
});
- expect(result?.entityId).toBe('document-3');
+ expect(result).toEqual({ kind: 'queued', transactionId: 'transaction-1' });
expect(executeQuery).toHaveBeenCalledOnce();
});
@@ -573,7 +550,7 @@ describe('GraphQL favorites queries', () => {
entityId: 'document-3',
});
- expect(result?.entityId).toBe('document-3');
+ expect(result).toEqual({ kind: 'queued', transactionId: 'transaction-1' });
expect(executeQuery).not.toHaveBeenCalled();
expect(executeMutation.mock.calls[0]?.[2]).toEqual({
normalizedCacheOptimistic: expect.objectContaining({
diff --git a/apps/web/src/lib/queries/favorites/graphql.ts b/apps/web/src/lib/queries/favorites/graphql.ts
index 7b2ec48b20..15ea10737d 100644
--- a/apps/web/src/lib/queries/favorites/graphql.ts
+++ b/apps/web/src/lib/queries/favorites/graphql.ts
@@ -6,7 +6,6 @@ import {
} from '@app/lib/urql-solid';
import { optimisticMutationDispositionOf } from '@graphql-cache/exchange/optimistic';
import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
-import type { Favorite } from '@service-storage/generated/schemas/favorite';
import type { FavoritesList } from '@service-storage/generated/schemas/favoritesList';
import type { ListFavoritesParams } from '@service-storage/generated/schemas/listFavoritesParams';
import {
@@ -20,10 +19,10 @@ import {
executeGraphqlReorderFavoritesMutation,
executeGraphqlSetFavoriteMutation,
type FavoritesCacheTarget,
+ type FavoriteWriteResult,
graphqlReorderFavoritesResult,
graphqlSetFavoriteResult,
mapGraphqlFavorite,
- type ReorderFavoritesResult,
type SetFavoriteArgs,
toGraphqlFavoriteEntityType,
UNFILTERED_FAVORITES_VARIABLES,
@@ -218,10 +217,10 @@ function createFavoriteMutation<
};
}
-/** Add a favorite, returning its persisted or queued optimistic payload. */
+/** Add a favorite, reporting whether it committed or queued offline. */
export function createGraphqlAddFavoriteMutation<Context = void>(
callbacks: FavoriteMutationCallbacks<
- Favorite | undefined,
+ FavoriteWriteResult,
SetFavoriteArgs,
Context
> = {}
@@ -243,7 +242,11 @@ export function createGraphqlAddFavoriteMutation<Context = void>(
/** Remove a favorite without requiring any mounted favorites query. */
export function createGraphqlRemoveFavoriteMutation<Context = void>(
- callbacks: FavoriteMutationCallbacks<void, SetFavoriteArgs, Context> = {}
+ callbacks: FavoriteMutationCallbacks<
+ FavoriteWriteResult,
+ SetFavoriteArgs,
+ Context
+ > = {}
) {
return createFavoriteMutation({
mutation: SetFavoriteDocument,
@@ -255,9 +258,7 @@ export function createGraphqlRemoveFavoriteMutation<Context = void>(
0,
activeFavoritesCacheTargets(input)
),
- select: (result) => {
- graphqlSetFavoriteResult(result);
- },
+ select: graphqlSetFavoriteResult,
callbacks,
});
}
@@ -265,7 +266,7 @@ export function createGraphqlRemoveFavoriteMutation<Context = void>(
/** Creates the durable urql-solid favorites reorder mutation. */
export function createGraphqlReorderFavoritesMutation<Context = void>(
callbacks: FavoriteMutationCallbacks<
- ReorderFavoritesResult,
+ FavoriteWriteResult,
GraphqlReorderFavoritesArgs,
Context
> = {}
diff --git a/apps/web/src/lib/queries/notification/tests/unsubscribes.test.tsx b/apps/web/src/lib/queries/notification/tests/unsubscribes.test.tsx
index 95a6263851..072b402dae 100644
--- a/apps/web/src/lib/queries/notification/tests/unsubscribes.test.tsx
+++ b/apps/web/src/lib/queries/notification/tests/unsubscribes.test.tsx
@@ -1,5 +1,9 @@
import { cleanup, render, waitFor } from '@solidjs/testing-library';
-import { focusManager, QueryClientProvider } from '@tanstack/solid-query';
+import {
+ focusManager,
+ onlineManager,
+ QueryClientProvider,
+} from '@tanstack/solid-query';
import { ok } from 'neverthrow';
import { afterEach, describe, expect, it, vi } from 'vitest';
import { queryClient } from '../../client';
@@ -145,3 +149,21 @@ describe('item snooze mutations', () => {
expect(queryClient.getQueryData(key)).toEqual([original]);
});
});
+
+describe('offline mute writes', () => {
+ afterEach(() => onlineManager.setOnline(true));
+
+ it.each(['mute', 'unmute'] as const)(
+ 'settles an offline %s instead of waiting for the network',
+ async (kind) => {
+ onlineManager.setOnline(false);
+ const networkDown = new TypeError('Failed to fetch');
+ client.unsubscribeItem.mockRejectedValue(networkDown);
+ client.removeUnsubscribeItem.mockRejectedValue(networkDown);
+ const mutations = setup();
+
+ await expect(mutations[kind].mutateAsync(item)).rejects.toBe(networkDown);
+ expect(queryClient.getQueryData(key)).toEqual([original]);
+ }
+ );
+});
diff --git a/apps/web/src/lib/queries/notification/unsubscribes.ts b/apps/web/src/lib/queries/notification/unsubscribes.ts
index 512eeb3d51..1a22154d98 100644
--- a/apps/web/src/lib/queries/notification/unsubscribes.ts
+++ b/apps/web/src/lib/queries/notification/unsubscribes.ts
@@ -56,6 +56,9 @@ function invalidateUnsubscribes() {
const MUTE_ITEM_MUTATION_KEY = ['notification', 'mute-item'] as const;
const UNMUTE_ITEM_MUTATION_KEY = ['notification', 'unmute-item'] as const;
+// A paused mutation lives only in memory and replays in parallel on reconnect,
+// so an offline mute must fail and roll back instead of waiting.
+const MUTE_NETWORK_MODE = 'always';
/**
* Edit the cached list in place. Per-item edits (rather than snapshot
@@ -103,6 +106,7 @@ function cancelUnsubscribesFetch() {
export function useMuteItemMutation() {
return useMutation(() => ({
mutationKey: MUTE_ITEM_MUTATION_KEY,
+ networkMode: MUTE_NETWORK_MODE,
mutationFn: async (item: UserUnsubscribe) => {
await throwOnErr(() => notificationServiceClient.unsubscribeItem(item));
},
@@ -130,6 +134,7 @@ export function useMuteItemMutation() {
export function useUnmuteItemMutation() {
return useMutation(() => ({
mutationKey: UNMUTE_ITEM_MUTATION_KEY,
+ networkMode: MUTE_NETWORK_MODE,
mutationFn: async (item: UserUnsubscribe) => {
await throwOnErr(() =>
notificationServiceClient.removeUnsubscribeItem(item)
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-favorites.test.ts b/apps/web/src/lib/service-clients/service-storage/graphql-favorites.test.ts
index 8e8c046b8c..f1ec73291c 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql-favorites.test.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-favorites.test.ts
@@ -259,18 +259,19 @@ describe('favorites GraphQL mutations', () => {
},
}),
});
- const result = await executeGraphqlReorderFavoritesMutation(client, args);
- expect(graphqlReorderFavoritesResult(result)).toEqual({
+ const queued = {
kind: 'queued',
transactionId: kind === 'queued' ? 'transaction-1' : 'transaction-2',
- });
+ };
+ const result = await executeGraphqlReorderFavoritesMutation(client, args);
+ expect(graphqlReorderFavoritesResult(result)).toEqual(queued);
const toggle = await executeGraphqlSetFavoriteMutation(
client,
input,
true,
2
);
- expect(graphqlSetFavoriteResult(toggle)).toBeUndefined();
+ expect(graphqlSetFavoriteResult(toggle)).toEqual(queued);
}
);
diff --git a/apps/web/src/lib/service-clients/service-storage/graphql-favorites.ts b/apps/web/src/lib/service-clients/service-storage/graphql-favorites.ts
index 846ed511f8..9c86471b86 100644
--- a/apps/web/src/lib/service-clients/service-storage/graphql-favorites.ts
+++ b/apps/web/src/lib/service-clients/service-storage/graphql-favorites.ts
@@ -251,16 +251,19 @@ export function executeGraphqlSetFavoriteMutation(
).toPromise();
}
-/** Read an accepted toggle's own payload, never a mounted query's snapshot. */
+/** Whether a favorites write committed remotely or was accepted by the offline queue. */
+export type FavoriteWriteResult =
+ | { kind: 'committed' }
+ | { kind: 'queued'; transactionId: string };
+
export function graphqlSetFavoriteResult(
result: OperationResult<SetFavoriteMutation, SetFavoriteMutationVariables>
-): Favorite | undefined {
+): FavoriteWriteResult {
const disposition = optimisticMutationDispositionOf(result);
// Superseded operations intentionally carry no data. They are accepted via
// their replacement, not missing-data errors. Also supports older queued work.
if (disposition?.kind === 'queued') {
- const favorite = result.data?.setFavorite.favorite;
- return favorite ? mapGraphqlFavorite(favorite) : undefined;
+ return { kind: 'queued', transactionId: disposition.transactionId };
}
if (disposition?.kind === 'permanently-failed') throw disposition.error;
if (result.error) throw result.error;
@@ -269,7 +272,7 @@ export function graphqlSetFavoriteResult(
if (payload.result.__typename === 'GraphqlMutationError') {
throw new Error(payload.result.message);
}
- return payload.favorite ? mapGraphqlFavorite(payload.favorite) : undefined;
+ return { kind: 'committed' };
}
/**
@@ -279,11 +282,6 @@ export function graphqlSetFavoriteResult(
const REORDER_FAVORITES_OPTIMISTIC_UUID =
'86cc4bfe-c45a-4e28-880a-6ba5ca921d35';
-/** Whether the reorder committed remotely or was accepted by the offline queue. */
-export type ReorderFavoritesResult =
- | { kind: 'committed' }
- | { kind: 'queued'; transactionId: string };
-
/** Submit a durable optimistic GraphQL favorites reorder. */
export function executeGraphqlReorderFavoritesMutation(
client: Client,
@@ -345,7 +343,7 @@ export function graphqlReorderFavoritesResult(
ReorderFavoritesMutation,
ReorderFavoritesMutationVariables
>
-): ReorderFavoritesResult {
+): FavoriteWriteResult {
const disposition = optimisticMutationDispositionOf(result);
if (disposition?.kind === 'queued') {
return {
diff --git a/docs/agent-guide/email.md b/docs/agent-guide/email.md
index 9fdb30809f..36ee925c90 100644
--- a/docs/agent-guide/email.md
+++ b/docs/agent-guide/email.md
@@ -73,6 +73,12 @@ draft exactly like its trash button, `Cmd+Shift+U` opens the attach picker, and
list and quote. Check discard from both a reply (the reply closes) and
standalone compose (the view goes back), with focus in the body.
+Star and mute feedback reports what happened to the write. With GraphQL Soup
+enabled, a star queued while offline toasts that it is waiting to sync (for
+example `Added to favorites, waiting to sync`) rather than confirming it. A REST
+star and a mute fail offline with an error toast and roll back instead of
+waiting for reconnect, so pressing them again works at once.
+
Recipient fields turn complete addresses into chips when the typed or pasted
text ends in a comma or semicolon, so `[email protected], [email protected],` adds both.
Enter or a click picks the highlighted suggestion. Type, paste, or Tab straight
@@ -519,6 +525,9 @@ controls. Verify these remain
available when returning to Drafts and reopening the draft.
**Delete** in the title menu moves the thread to Trash and returns to the same
filtered list. Its toast offers **Undo** to restore the email.
+**Sender → Signal**, **Sender → Noise** and **Block Sender**, and the sender
+commands in the command menu, appear only when the thread has a sender other
+than you. A thread you sent alone omits them.
**Download .eml** in the title menu saves the thread's newest sent or received
message (drafts and sends still in flight are skipped) exactly as Gmail or
Outlook holds it, named after its subject. Anyone who can view the thread can
diff --git a/docs/agent-guide/tasks.md b/docs/agent-guide/tasks.md
index add4724fe4..e10d15c4d5 100644
--- a/docs/agent-guide/tasks.md
+++ b/docs/agent-guide/tasks.md
@@ -619,9 +619,8 @@ the centered composer dialog. Both layouts are views in
`apps/web/src/features/task-composer/views` composing the shared
`TaskComposer` parts.
-After creation, the `Task created` toast shows `Link copied` when copying
-succeeds and an `Open` action. Touch devices omit `Open (New Split)`; desktop
-keeps both actions. Either action immediately dismisses the toast before opening
+After creation, the `Task created` toast shows an `Open` action. Touch devices
+omit `Open (New Split)`; desktop keeps both actions. Either action immediately dismisses the toast before opening
the task. Verify the toast at phone and tablet widths with touch
emulation: the message and action fit without clipping, and `Open` visits the
created task in place.
@@ -645,6 +644,10 @@ created task in place.
3. `type_text` the title, then press **Ctrl+Enter** to create, or tap `Create Task` on
touch (the button enables once there is a title). Dialog also offers `Continue editing in split` to open the
task as a full document.
+ Creating shows a `Task created` toast with `Open` (and `Open (New Split)` on
+ desktop) as soon as the server returns, then copies the task link in the
+ background. A denied or prompted clipboard write never delays or replaces
+ that toast.
The property row adapts when the launching pane supplies a task-composer preset.
The app shell's creation-context provider snapshots the focused pane's preset