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
style(core): update style of item action dialogs (#6610)
Seamusd8129fa9106b
diff --git a/apps/web/src/components/app/mobile/ConfirmDrawer.tsx b/apps/web/src/components/app/mobile/ConfirmDrawer.tsxindex 161ad5f36b..2bed2d2801 100644--- a/apps/web/src/components/app/mobile/ConfirmDrawer.tsx+++ b/apps/web/src/components/app/mobile/ConfirmDrawer.tsx@@ -1,5 +1,6 @@import SpinnerIcon from '@phosphor/spinner.svg';import CloseIcon from '@phosphor/x.svg';+import { ActionDialogShell } from '@ui/components/ActionDialogShell';import { Button } from '@ui/components/Button';import type { ConfirmDialogProps } from '@ui/components/ConfirmDialog';import { cn } from '@ui/utils/classname';@@ -30,7 +31,10 @@ export function ConfirmDrawer(props: ConfirmDialogProps) {><MobileDrawer.Handle class="pb-1" /><div class="flex shrink-0 items-center justify-between gap-3 px-6 pb-4">- <h2 id={titleId} class="text-lg font-semibold text-ink">+ <h2+ id={titleId}+ class="text-[18px] leading-6 font-semibold text-ink"+ >{props.title}</h2><Button@@ -47,41 +51,41 @@ export function ConfirmDrawer(props: ConfirmDialogProps) {<MobileDrawer.ScrollBody><divid={descriptionId}- class="px-6 pb-5 text-base leading-6 text-ink-muted"+ class="px-6 pb-6 text-sm leading-5 text-ink-muted">{props.body ?? props.children}</div>- <div class="flex gap-3 px-6 pb-2">- <Button- variant="ghost"- size="xl"- class="min-w-0 flex-1 rounded-full bg-ink/6"- disabled={props.pending}- onClick={close}- >- {props.cancelLabel ?? 'Cancel'}- </Button>- <Button- variant="ghost"- size="xl"- class={cn(- 'min-w-0 flex-1 rounded-full',- props.tone === 'danger'- ? 'bg-failure-bg text-failure'- : props.tone === 'success'- ? 'bg-success-bg text-success'- : 'bg-accent-bg text-accent'- )}- disabled={props.pending}- onClick={() => !props.pending && props.onConfirm()}- >- <Show when={props.pending}>- <SpinnerIcon class="size-4 animate-spin" />- </Show>- {props.confirmLabel ?? 'Confirm'}- </Button>- </div></MobileDrawer.ScrollBody>+ <ActionDialogShell.Footer class="gap-3">+ <Button+ variant="ghost"+ size="xl"+ class="min-w-0 flex-1 rounded-full bg-ink/6"+ disabled={props.pending}+ onClick={close}+ >+ {props.cancelLabel ?? 'Cancel'}+ </Button>+ <Button+ variant="ghost"+ size="xl"+ class={cn(+ 'min-w-0 flex-1 rounded-full',+ props.tone === 'danger'+ ? 'bg-failure-bg text-failure'+ : props.tone === 'success'+ ? 'bg-success-bg text-success'+ : 'bg-accent-bg text-accent'+ )}+ disabled={props.pending}+ onClick={() => !props.pending && props.onConfirm()}+ >+ <Show when={props.pending}>+ <SpinnerIcon class="size-4 animate-spin" />+ </Show>+ {props.confirmLabel ?? 'Confirm'}+ </Button>+ </ActionDialogShell.Footer></MobileDrawer.Content></MobileDrawer.Portal></MobileDrawer>diff --git a/apps/web/src/components/ui/components/ActionDialogShell.tsx b/apps/web/src/components/ui/components/ActionDialogShell.tsxnew file mode 100644index 0000000000..7fd40f00ea--- /dev/null+++ b/apps/web/src/components/ui/components/ActionDialogShell.tsx@@ -0,0 +1,76 @@+import { type ParentProps, splitProps } from 'solid-js';+import { cn } from '../utils/classname';+import { Dialog } from './Dialog';+import { Surface, type SurfaceProps } from './Surface';++type SlotProps = ParentProps<{ class?: string }>;++/** Presentation-only slots for small, focused actions. Hosts own dialog state and forms. */+function ActionDialogShellRoot(props: SurfaceProps) {+ const [local, rest] = splitProps(props, ['class']);+ return (+ <Surface+ depth={2}+ {...rest}+ class={cn('flex max-h-[75dvh] flex-col rounded-xl text-ink', local.class)}+ />+ );+}++function Body(props: SlotProps) {+ return (+ <div+ class={cn(+ 'min-h-0 space-y-6 overflow-y-auto p-5',+ '[&_[data-slot=text-field]]:gap-2 [&_[data-slot=text-field-label]]:text-[13px] [&_[data-slot=text-field-label]]:leading-[18px] [&_[data-slot=text-field-label]]:font-medium',+ '[&_input[data-slot]]:h-11 [&_input[data-slot]]:text-sm [&_input[data-slot]]:shadow-none [&_input[data-slot]]:focus-visible:ring-2 [&_input[data-slot]]:focus-visible:ring-edge-muted [&_input[data-slot]]:focus-visible:outline-none',+ props.class+ )}+ >+ {props.children}+ </div>+ );+}++function Header(props: SlotProps) {+ return <div class={cn('space-y-2', props.class)}>{props.children}</div>;+}++const Title: typeof Dialog.Title = (props) => (+ <Dialog.Title+ {...props}+ class={cn(+ 'text-[18px] leading-6 font-semibold tracking-tight',+ props.class+ )}+ />+);++const Description: typeof Dialog.Description = (props) => (+ <Dialog.Description+ {...props}+ class={cn('text-sm leading-5 text-ink-muted', props.class)}+ />+);++function Footer(props: SlotProps) {+ return (+ <div+ class={cn(+ 'flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-edge-muted px-5 py-3',+ '[&_[data-slot=button]]:rounded-lg [&_[data-slot=button][data-disabled]]:opacity-100 [&_[data-slot=button][data-disabled]]:text-ink-muted [&_[data-slot=button][data-disabled]:not([data-variant=ghost])]:bg-ink/10',+ props.class+ )}+ >+ {props.children}+ </div>+ );+}++export const ActionDialogShell = Object.assign(ActionDialogShellRoot, {+ Body,+ Header,+ Title,+ Description,+ Footer,+});diff --git a/apps/web/src/components/ui/components/ConfirmDialog.tsx b/apps/web/src/components/ui/components/ConfirmDialog.tsxindex f0c88ea69c..ee52cfa5e6 100644--- a/apps/web/src/components/ui/components/ConfirmDialog.tsx+++ b/apps/web/src/components/ui/components/ConfirmDialog.tsx@@ -2,6 +2,7 @@ import { ConfirmDrawer } from '@components/app/mobile/ConfirmDrawer';import { isMobile } from '@core/mobile/isMobile';import { createSignal, type JSX, onCleanup, Show } from 'solid-js';import { cn } from '../utils/classname';+import { ActionDialogShell } from './ActionDialogShell';import { Button } from './Button';import { Dialog, type DialogProps } from './Dialog';import {@@ -10,7 +11,6 @@ import {openDialog,type PropsSource,} from './ImperativeDialog';-import { Surface } from './Surface';/** Presentation options for the shared confirmation dialog. */export type ConfirmDialogDisplayProps = {@@ -48,23 +48,20 @@ export function ConfirmDialog(props: ConfirmDialogProps) {<Dialogopen={props.open}onOpenChange={(open) => !props.pending && props.onOpenChange(open)}- position={props.position}- class={cn('w-[90%] max-w-120', props.class)}+ position={props.position ?? 'center'}+ class={cn('w-110', props.class)}visibleScrim>- <Surface depth={2} class="rounded-xl text-ink">- <div class="flex flex-col gap-1 px-5 py-4">- <Dialog.Title class="text-base font-semibold">- {props.title}- </Dialog.Title>- <Dialog.Description- as="div"- class="text-sm leading-5 text-ink-muted"- >- {props.body ?? props.children}- </Dialog.Description>- </div>- <div class="flex items-center justify-end gap-2 px-5 py-3">+ <ActionDialogShell>+ <ActionDialogShell.Body>+ <ActionDialogShell.Header>+ <ActionDialogShell.Title>{props.title}</ActionDialogShell.Title>+ <ActionDialogShell.Description as="div">+ {props.body ?? props.children}+ </ActionDialogShell.Description>+ </ActionDialogShell.Header>+ </ActionDialogShell.Body>+ <ActionDialogShell.Footer><Buttontype="button"variant="ghost"@@ -85,8 +82,8 @@ export function ConfirmDialog(props: ConfirmDialogProps) {>{props.confirmLabel ?? 'Confirm'}</Button>- </div>- </Surface>+ </ActionDialogShell.Footer>+ </ActionDialogShell></Dialog>}>diff --git a/apps/web/src/components/ui/components/DeleteDialog.tsx b/apps/web/src/components/ui/components/DeleteDialog.tsxindex 6cca7b7542..2ac1350dcd 100644--- a/apps/web/src/components/ui/components/DeleteDialog.tsx+++ b/apps/web/src/components/ui/components/DeleteDialog.tsx@@ -2,10 +2,11 @@ import SpinnerIcon from '@phosphor/spinner.svg';import type { JSX } from 'solid-js';import { createSignal, createUniqueId, Show } from 'solid-js';import { cn } from '../utils/classname';+import { ActionDialogShell } from './ActionDialogShell';import { Button } from './Button';import { Dialog, type DialogProps } from './Dialog';import type { ManagedDialogProps } from './ImperativeDialog';-import { Surface } from './Surface';+import { Input } from './Input';/** Presentation and behavior options for the shared deletion dialog. */export type DeleteDialogProps = ManagedDialogProps & {@@ -48,23 +49,18 @@ export function DeleteDialog(props: DeleteDialogProps) {onOpenChange={(open) => {if (!open) close();}}- position={props.position}- class={cn('w-[90%] max-w-120', props.class)}+ position={props.position ?? 'center'}+ class={cn('w-110', props.class)}visibleScrim>- <Surface depth={2} class="rounded-xl text-ink">- <div class="flex flex-col gap-3 px-5 py-4">- <div class="flex flex-col gap-1">- <Dialog.Title class="text-base font-semibold">- {props.title}- </Dialog.Title>- <Dialog.Description- as="div"- class="text-sm leading-5 text-ink-muted"- >+ <ActionDialogShell>+ <ActionDialogShell.Body>+ <ActionDialogShell.Header>+ <ActionDialogShell.Title>{props.title}</ActionDialogShell.Title>+ <ActionDialogShell.Description as="div">{props.body ?? props.children}- </Dialog.Description>- </div>+ </ActionDialogShell.Description>+ </ActionDialogShell.Header><Show when={props.confirmationPhrase}>{(phrase) => (@@ -76,24 +72,22 @@ export function DeleteDialog(props: DeleteDialogProps) {Type <span class="font-medium text-ink">{phrase()}</span> toconfirm.</label>- <input+ <Inputid={confirmationInputId}type="text"value={confirmation()}placeholder={phrase()}disabled={props.pending}- autofocusonInput={(event) =>setConfirmation(event.currentTarget.value)}- class="h-9 w-full rounded-lg border border-edge-muted bg-transparent px-3 text-sm text-ink outline-none transition-colors placeholder:text-ink-placeholder hover:border-edge focus:border-accent disabled:opacity-70"/></div>)}</Show>- </div>+ </ActionDialogShell.Body>- <div class="flex items-center justify-end gap-2 px-5 py-3">+ <ActionDialogShell.Footer><Buttontype="button"variant="ghost"@@ -117,8 +111,8 @@ export function DeleteDialog(props: DeleteDialogProps) {<span class="sr-only">{props.deleteLabel ?? 'Delete'}</span></Show></Button>- </div>- </Surface>+ </ActionDialogShell.Footer>+ </ActionDialogShell></Dialog>);}diff --git a/apps/web/src/components/ui/index.ts b/apps/web/src/components/ui/index.tsindex db6e1f5535..955d5cfd20 100644--- a/apps/web/src/components/ui/index.ts+++ b/apps/web/src/components/ui/index.ts@@ -1,3 +1,4 @@+export { ActionDialogShell } from './components/ActionDialogShell';export type {AvatarGroupProps,AvatarGroupSize,diff --git a/apps/web/src/features/command/CommandMenu.tsx b/apps/web/src/features/command/CommandMenu.tsxindex 9fc698ee70..f829165dad 100644--- a/apps/web/src/features/command/CommandMenu.tsx+++ b/apps/web/src/features/command/CommandMenu.tsx@@ -18,10 +18,12 @@ import type { HotkeyCommand, RegisterHotkeyReturn } from '@core/hotkey/types';import { runCommand } from '@core/hotkey/utils';import { debouncedDependent } from '@core/util/debounce';import { openExternalUrl } from '@core/util/url';-import { type EntityData, InlineEntity, isGithubPrEntity } from '@entity';+import { type EntityData, isGithubPrEntity } from '@entity';+import { EntitySelectionBadge } from '@entity/components/EntitySelectionBadge';import Macro from '@icon/macro-logo.svg';import ArrowLeft from '@phosphor/arrow-left.svg';import {+ Badge,CommandMenuEmptyState,CommandMenuHotkeyHint,CommandMenuSearchInput,@@ -710,25 +712,10 @@ function EntityActionPreview(props: { entities: EntityData[] }) {return (<><For each={displayEntities()}>- {(entity) => {- return (- <div- class={cn(- 'bg-active border border-edge-muted px-2 py-1 truncate text-xs rounded',- {- 'max-w-[50%]': props.entities.length === 2,- }- )}- >- <InlineEntity entity={entity} />- </div>- );- }}+ {(entity) => <EntitySelectionBadge entity={entity} />}</For><Show when={remainingCount() > 0}>- <div class="text-ink-muted text-xs px-2 py-1">- +{remainingCount()} more- </div>+ <Badge size="sm">+{remainingCount()} more</Badge></Show></>);diff --git a/apps/web/src/features/entity/bulk-edit/BulkDeleteView.test.tsx b/apps/web/src/features/entity/bulk-edit/BulkDeleteView.test.tsxindex 3bf384fbbe..cc42d4744b 100644--- a/apps/web/src/features/entity/bulk-edit/BulkDeleteView.test.tsx+++ b/apps/web/src/features/entity/bulk-edit/BulkDeleteView.test.tsx@@ -1,25 +1,37 @@import { Dialog } from '@kobalte/core/dialog';import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';-import type { JSX } from 'solid-js';+import { For, type JSX, type ParentProps } from 'solid-js';import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';import { BulkDeleteFailure } from '../queries/bulk-delete-result';import type { EntityData } from '../types/entity';import { BulkDeleteView } from './BulkDeleteView';const mutateAsync = vi.hoisted(() => vi.fn());-vi.mock('@entity', () => ({+vi.mock('../queries/dss', () => ({createBulkDeleteDssItemsMutation: () => ({ mutateAsync }),- InlineEntity: (props: { entity: EntityData }) => (- <span data-testid={props.entity.id}>{props.entity.name}</span>- ),}));-vi.mock('@ui', () => ({- Button: (props: JSX.ButtonHTMLAttributes<HTMLButtonElement>) => (- <button {...props} />+vi.mock('./components/EntityActionSelection', () => ({+ EntityActionSelection: (props: { entities: EntityData[] }) => (+ <For each={props.entities}>+ {(entity) => <span data-testid={entity.id}>{entity.name}</span>}+ </For>),- cn: (...values: unknown[]) =>- values.filter((value) => typeof value === 'string').join(' '),}));+vi.mock('@ui', () => {+ const Slot = (props: ParentProps) => <div>{props.children}</div>;+ return {+ Button: (props: JSX.ButtonHTMLAttributes<HTMLButtonElement>) => (+ <button {...props} />+ ),+ ActionDialogShell: Object.assign(Slot, {+ Body: Slot,+ Header: Slot,+ Title: Slot,+ Description: Slot,+ Footer: Slot,+ }),+ };+});const failed = {id: 'failed',@@ -78,7 +90,9 @@ describe('BulkDeleteView partial failure', () => {).mockResolvedValueOnce([true]);const { onFinish, onError, onPartialDelete } = mount();- fireEvent.click(screen.getByRole('button', { name: 'Delete' }));+ fireEvent.click(+ screen.getByRole('button', { name: /^Delete (item|\d+ items)$/ })+ );await vi.waitFor(() =>expect(screen.getByRole('status').textContent).toContain('Deleted 1 of 2 items; 1 failed'@@ -88,7 +102,9 @@ describe('BulkDeleteView partial failure', () => {expect(screen.queryByTestId('deleted')).toBeNull();expect(onFinish).not.toHaveBeenCalled();expect(onError).not.toHaveBeenCalled(); // no second, misleading full-failure callback- fireEvent.click(screen.getByRole('button', { name: 'Delete' }));+ fireEvent.click(+ screen.getByRole('button', { name: /^Delete (item|\d+ items)$/ })+ );await vi.waitFor(() => expect(onFinish).toHaveBeenCalledOnce());expect(mutateAsync).toHaveBeenNthCalledWith(1, [failed, deleted]);expect(mutateAsync).toHaveBeenNthCalledWith(2, [failed]);@@ -103,7 +119,9 @@ describe('BulkDeleteView partial failure', () => {new BulkDeleteFailure([failed, deleted], [false, true]));const { onFinish, onError, onCancel, onPartialDelete } = mount();- fireEvent.click(screen.getByRole('button', { name: 'Delete' }));+ fireEvent.click(+ screen.getByRole('button', { name: /^Delete (item|\d+ items)$/ })+ );await vi.waitFor(() =>expect(onPartialDelete).toHaveBeenCalledExactlyOnceWith([deleted],@@ -129,10 +147,14 @@ describe('BulkDeleteView partial failure', () => {onPartialDelete.mockImplementation(() => {throw new Error('cleanup failed');});- fireEvent.click(screen.getByRole('button', { name: 'Delete' }));+ fireEvent.click(+ screen.getByRole('button', { name: /^Delete (item|\d+ items)$/ })+ );await vi.waitFor(() => expect(onPartialDelete).toHaveBeenCalledOnce());expect(screen.queryByTestId('deleted')).toBeNull();- fireEvent.click(screen.getByRole('button', { name: 'Delete' }));+ fireEvent.click(+ screen.getByRole('button', { name: /^Delete (item|\d+ items)$/ })+ );await vi.waitFor(() => expect(onFinish).toHaveBeenCalledOnce());expect(mutateAsync).toHaveBeenNthCalledWith(2, [failed]);expect(onError).not.toHaveBeenCalled();@@ -143,7 +165,9 @@ describe('BulkDeleteView partial failure', () => {const error = new Error('all failed');mutateAsync.mockRejectedValueOnce(error);const { onFinish, onError } = mount();- fireEvent.click(screen.getByRole('button', { name: 'Delete' }));+ fireEvent.click(+ screen.getByRole('button', { name: /^Delete (item|\d+ items)$/ })+ );await vi.waitFor(() => expect(onError).toHaveBeenCalledWith(error));expect(onFinish).not.toHaveBeenCalled();expect(screen.getByTestId('failed')).toBeTruthy();diff --git a/apps/web/src/features/entity/bulk-edit/BulkDeleteView.tsx b/apps/web/src/features/entity/bulk-edit/BulkDeleteView.tsxindex 58455ac9f3..04f95a8283 100644--- a/apps/web/src/features/entity/bulk-edit/BulkDeleteView.tsx+++ b/apps/web/src/features/entity/bulk-edit/BulkDeleteView.tsx@@ -1,13 +1,9 @@-import {- createBulkDeleteDssItemsMutation,- type EntityData,- InlineEntity,-} from '@entity';-import { Dialog } from '@kobalte/core/dialog';-import CloseIcon from '@phosphor-icons/core/regular/x.svg?component-solid';-import { Button, cn } from '@ui';-import { createSignal, For, onMount, Show } from 'solid-js';+import { ActionDialogShell, Button } from '@ui';+import { createSignal, Show } from 'solid-js';import { BulkDeleteFailure } from '../queries/bulk-delete-result';+import { createBulkDeleteDssItemsMutation } from '../queries/dss';+import type { EntityData } from '../types/entity';+import { EntityActionSelection } from './components/EntityActionSelection';/** Confirmed progress without closing a partially failed deletion dialog. */export type PartialDeleteHandler = (@@ -22,28 +18,19 @@ export const BulkDeleteView = (props: {onError?: (error: unknown) => void;onPartialDelete?: PartialDeleteHandler;}) => {- const bulkDelete = createBulkDeleteDssItemsMutation();+ const mutation = createBulkDeleteDssItemsMutation();const [remainingEntities, setRemainingEntities] =createSignal<EntityData[]>();const [partialMessage, setPartialMessage] = createSignal<string>();const entities = () => remainingEntities() ?? props.entities;- let deleteButton: HTMLButtonElement | undefined;-- const focusDeleteButton = () => {- requestAnimationFrame(() =>- requestAnimationFrame(() => deleteButton?.focus())- );- };-- onMount(focusDeleteButton);-+ const multi = () => entities().length > 1;const handleDelete = async () => {// Keep the completion attached to the caller that submitted this attempt,// even if another modal replaces this one while the request is in flight.const onPartialDelete = props.onPartialDelete;setPartialMessage(undefined);try {- await bulkDelete.mutateAsync(entities());+ await mutation.mutateAsync(entities());props.onFinish();} catch (error) {if (@@ -69,47 +56,20 @@ export const BulkDeleteView = (props: {}};- const handleCancel = () => {- props.onCancel();- };-return (<>- <div class="shrink-0 flex flex-row items-center px-2 gap-1 border-b border-b-edge-muted h-10">- <Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">- <CloseIcon />- </Dialog.CloseButton>- <Dialog.Title as="span" class="text-sm font-medium p-0 m-0">- Delete{' '}- {entities().length === 1 ? 'Item' : `${entities().length} Items`}- </Dialog.Title>- </div>-- <div class="p-2 border-b border-edge-muted">- <div class="flex items-center gap-2">- <For each={entities().slice(0, 2)}>- {(entity) => (- <div- class={cn(- 'bg-hover border border-edge-muted px-2 py-1 truncate text-xs rounded-xs',- {- 'max-w-[50%]': entities().length === 2,- }- )}- >- <InlineEntity entity={entity} />- </div>- )}- </For>- <Show when={entities().length > 2}>- <div class="text-ink-muted text-xs px-2 py-1">- +{entities().length - 2} more- </div>- </Show>- </div>- </div>-- <div class="p-3 flex flex-col gap-3">+ <ActionDialogShell.Body>+ <ActionDialogShell.Header>+ <ActionDialogShell.Title>+ {multi() ? `Delete ${entities().length} items?` : 'Delete item?'}+ </ActionDialogShell.Title>+ <ActionDialogShell.Description>+ {multi()+ ? 'These items will be permanently deleted. This cannot be undone.'+ : 'This item will be permanently deleted. This cannot be undone.'}+ </ActionDialogShell.Description>+ </ActionDialogShell.Header>+ <EntityActionSelection entities={entities()} /><Show when={partialMessage()}>{(message) => (<p role="status" class="text-sm text-ink-muted">@@ -117,29 +77,15 @@ export const BulkDeleteView = (props: {</p>)}</Show>- <p class="text-sm text-ink-muted">- {entities().length === 1- ? 'You are about to delete this item. This action cannot be undone.'- : `You are about to delete ${entities().length} items. This action cannot be undone.`}- </p>-- <div class="flex justify-end gap-2">- <Button variant="ghost" onClick={handleCancel}>- Cancel- </Button>- <Button- ref={(el: HTMLButtonElement) => {- deleteButton = el;- focusDeleteButton();- }}- type="button"- variant="danger"- onClick={handleDelete}- >- Delete- </Button>- </div>- </div>+ </ActionDialogShell.Body>+ <ActionDialogShell.Footer>+ <Button variant="ghost" onClick={props.onCancel}>+ Cancel+ </Button>+ <Button variant="danger" onClick={() => void handleDelete()}>+ {multi() ? `Delete ${entities().length} items` : 'Delete item'}+ </Button>+ </ActionDialogShell.Footer></>);};diff --git a/apps/web/src/features/entity/bulk-edit/BulkEditEntityModal.test.tsx b/apps/web/src/features/entity/bulk-edit/BulkEditEntityModal.test.tsxindex 07e2610058..07c5f27d7a 100644--- a/apps/web/src/features/entity/bulk-edit/BulkEditEntityModal.test.tsx+++ b/apps/web/src/features/entity/bulk-edit/BulkEditEntityModal.test.tsx@@ -25,7 +25,7 @@ vi.mock('@ui', () => ({</div></Show>),- Surface: (props: ParentProps) => <div>{props.children}</div>,+ ActionDialogShell: (props: ParentProps) => <div>{props.children}</div>,}));vi.mock('./BulkMoveToProjectView', () => ({BulkMoveToProjectView: () => null,diff --git a/apps/web/src/features/entity/bulk-edit/BulkEditEntityModal.tsx b/apps/web/src/features/entity/bulk-edit/BulkEditEntityModal.tsxindex f6087ef9e1..5bedc6e1b6 100644--- a/apps/web/src/features/entity/bulk-edit/BulkEditEntityModal.tsx+++ b/apps/web/src/features/entity/bulk-edit/BulkEditEntityModal.tsx@@ -1,6 +1,6 @@import { createControlledOpenSignal } from '@core/util/createControlledOpenSignal';import type { EntityData } from '@entity';-import { Dialog, Surface } from '@ui';+import { ActionDialogShell, Dialog } from '@ui';import {type Accessor,createSignal,@@ -37,6 +37,8 @@ const BulkEditEntityModalContent = (props: {return (<Dialogopen={props.isOpen()}+ position="center"+ class={props.view === 'moveToProject' ? 'w-120' : 'w-110'}onOpenChange={(open) => {if (!open) {handleCancel();@@ -44,37 +46,33 @@ const BulkEditEntityModalContent = (props: {props.setIsOpen(open);}}>- <Surface depth={2} class="rounded-xl">- <div class="*:max-h-[75vh]">- <div class="flex flex-col text-ink">- <Show when={props.view === 'rename'}>- <BulkRenameEntitiesView- entities={props.entities}- onFinish={handleFinish}- onCancel={handleCancel}- onError={handleError}- />- </Show>- <Show when={props.view === 'moveToProject'}>- <BulkMoveToProjectView- entities={props.entities}- onFinish={handleFinish}- onCancel={handleCancel}- onError={handleError}- />- </Show>- <Show when={props.view === 'delete'}>- <BulkDeleteView- entities={props.entities}- onFinish={handleFinish}- onCancel={handleCancel}- onError={handleError}- onPartialDelete={props.onPartialDelete}- />- </Show>- </div>- </div>- </Surface>+ <ActionDialogShell>+ <Show when={props.view === 'rename'}>+ <BulkRenameEntitiesView+ entities={props.entities}+ onFinish={handleFinish}+ onCancel={handleCancel}+ onError={handleError}+ />+ </Show>+ <Show when={props.view === 'moveToProject'}>+ <BulkMoveToProjectView+ entities={props.entities}+ onFinish={handleFinish}+ onCancel={handleCancel}+ onError={handleError}+ />+ </Show>+ <Show when={props.view === 'delete'}>+ <BulkDeleteView+ onPartialDelete={props.onPartialDelete}+ entities={props.entities}+ onFinish={handleFinish}+ onCancel={handleCancel}+ onError={handleError}+ />+ </Show>+ </ActionDialogShell></Dialog>);};diff --git a/apps/web/src/features/entity/bulk-edit/BulkMoveToProjectView.tsx b/apps/web/src/features/entity/bulk-edit/BulkMoveToProjectView.tsxindex 89c61ddded..7b9855272c 100644--- a/apps/web/src/features/entity/bulk-edit/BulkMoveToProjectView.tsx+++ b/apps/web/src/features/entity/bulk-edit/BulkMoveToProjectView.tsx@@ -1,19 +1,18 @@+import { ViewSidebar } from '@app/components/view-shell';import { analytics } from '@app/lib/analytics';-import { EntityIcon } from '@core/component/EntityIcon';import { toast } from '@core/component/Toast/Toast';import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';import { scrollToKeepGap } from '@core/util/scrollToKeepGap';import {createBulkMoveToProjectDssEntityMutation,type EntityData,- InlineEntity,} from '@entity';-import { Dialog } from '@kobalte/core/dialog';+import FolderIcon from '@phosphor/folder.svg';import FolderPlusIcon from '@phosphor-icons/core/regular/folder-plus.svg?component-solid';import CloseIcon from '@phosphor-icons/core/regular/x.svg?component-solid';import { createProject, useProjectsQuery } from '@queries/storage/projects';import type { Project } from '@service-storage/generated/schemas';-import { Button, cn } from '@ui';+import { ActionDialogShell, Button, Input } from '@ui';import {createEffect,createMemo,@@ -23,6 +22,7 @@ import {Show,untrack,} from 'solid-js';+import { EntityActionSelection } from './components/EntityActionSelection';type ProjectWithDepth = Project & { depth?: number; path?: string };@@ -36,7 +36,7 @@ export const BulkMoveToProjectView = (props: {let searchInputRef: HTMLInputElement | undefined;const bulkMoveToProjectMutation = createBulkMoveToProjectDssEntityMutation();const projectsQuery = useProjectsQuery();- const projects = () => projectsQuery.data ?? [];+ const projects = () => (projectsQuery.isSuccess ? projectsQuery.data : []);const [searchQuery, setSearchQuery] = createSignal('');const [selectedProject, setSelectedProject] =createSignal<ProjectWithDepth | null>(null);@@ -438,49 +438,22 @@ export const BulkMoveToProjectView = (props: {const entityText = () => (entityCount() === 1 ? 'item' : 'items');return (- <div ref={rootScopeId}>- <div class="shrink-0 flex flex-row items-center px-2 gap-1 border-b border-b-edge-muted h-10">- <Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">- <CloseIcon />- </Dialog.CloseButton>- <Dialog.Title as="span" class="text-sm font-medium p-0 m-0">- Move {entityCount()} {entityText()} to folder- </Dialog.Title>- </div>-- <div class="p-2 border-b border-edge-muted">- <div class="flex items-center gap-2">- <For each={props.entities.slice(0, 2)}>- {(entity) => (- <div- class={cn(- 'bg-hover border border-edge-muted px-2 py-1 truncate text-xs rounded-xs',- {- 'max-w-[50%]': props.entities.length === 2,- }- )}- >- <InlineEntity entity={entity} />- </div>- )}- </For>- <Show when={props.entities.length > 2}>- <div class="text-ink-muted text-xs px-2 py-1">- +{props.entities.length - 2} more- </div>- </Show>- </div>- </div>-- <div class="p-3 flex flex-col gap-3">- <div class="border border-edge-muted rounded-sm overflow-hidden">- <input- ref={(el) => {- searchInputRef = el;- requestAnimationFrame(() =>- requestAnimationFrame(() => el.focus())- );- }}+ <div ref={rootScopeId} class="flex min-h-0 flex-col">+ <ActionDialogShell.Body>+ <ActionDialogShell.Header>+ <ActionDialogShell.Title>+ Move {entityCount()} {entityText()} to folder+ </ActionDialogShell.Title>+ <ActionDialogShell.Description>+ Choose a destination for{' '}+ {entityCount() === 1 ? 'this item' : 'these items'}.+ </ActionDialogShell.Description>+ </ActionDialogShell.Header>+ <EntityActionSelection entities={props.entities} />+ <div class="min-w-0">+ <Input+ ref={searchInputRef}+ aria-label="Search folders"type="text"placeholder="Search folders..."value={searchQuery()}@@ -506,10 +479,10 @@ export const BulkMoveToProjectView = (props: {});} else if (e.key === 'Enter') {e.preventDefault();- finishEditing();+ void finishEditing();}}}- class="w-full px-3 py-2 text-sm bg-surface text-ink focus:outline-none border-b border-edge-muted"+ class="mb-2"/><div class="h-64 overflow-auto" ref={listRef}><For each={items()}>@@ -527,62 +500,75 @@ export const BulkMoveToProjectView = (props: {return (<div- class={cn(- 'flex items-center px-2 py-1 hover:bg-accent/10',- isFocused() && 'focused bg-accent/20',- isSelected() && 'bg-accent/10'- )}+ class={+ isFocused()+ ? 'focused relative min-w-0'+ : 'relative min-w-0'+ }style={{- 'padding-left': `${(project.depth || 0) * 16 + 8}px`,- }}- onClick={() => {- setSelectedProject(project);- setFocusedIndex(index());- scrollToKeepGap({- container: listRef,- target: listRef.querySelector(- '.focused'- ) as HTMLElement,- align: 'top',- });+ 'padding-left': `calc(${project.depth || 0} * var(--sidebar-icon-slot))`,}}>- <div- class={cn(- 'mr-2 size-4 flex items-center justify-center text-xs',- !hasChildren() && 'opacity-20'+ <For+ each={Array.from(+ { length: project.depth || 0 },+ (_, depth) => depth+ )}+ >+ {(depth) => (+ <span+ aria-hidden="true"+ class="pointer-events-none absolute inset-y-0 w-px bg-edge-muted"+ style={{+ left: `calc(${depth} * var(--sidebar-icon-slot) + var(--sidebar-local-rail))`,+ }}+ />)}- onClick={(e) => {- e.stopPropagation();- if (hasChildren()) {- toggleExpanded(project.id);- }+ </For>+ <ViewSidebar.TreeItem+ active={isSelected()}+ expanded={+ hasChildren() ? Boolean(isExpanded()) : undefined+ }+ label={project.name}+ onToggle={() => toggleExpanded(project.id)}+ onClick={() => {+ setSelectedProject(project);+ setFocusedIndex(index());+ scrollToKeepGap({+ container: listRef,+ target: listRef.querySelector(+ '.focused'+ ) as HTMLElement,+ align: 'top',+ });}}>- {hasChildren() ? (isExpanded() ? '▼' : '▶') : ''}- </div>- <div class="mr-2">- {<EntityIcon targetType="project" />}- </div>- <div class="flex-1 text-sm truncate">{project.name}</div>- <Show when={searchQuery()}>- <div class="text-xs text-ink-placeholder ml-2 truncate max-w-48">- {getProjectPath(project.id)}- </div>- </Show>+ <ViewSidebar.Icon>+ <FolderIcon class="size-4" />+ </ViewSidebar.Icon>+ <span class="min-w-0 flex-1 truncate">+ {project.name}+ </span>+ <Show when={searchQuery()}>+ <span class="max-w-48 truncate text-xs text-ink-placeholder">+ {getProjectPath(project.id)}+ </span>+ </Show>+ </ViewSidebar.TreeItem></div>);}}</For></div>- <div class="border-t border-edge-muted">+ <div class="mt-2 border-t border-edge-muted pt-2"><Showwhen={isCreatingFolder()}fallback={<buttontype="button"- class="flex w-full items-center gap-2 px-2 py-1.5 text-sm text-ink-muted hover:bg-hover hover:text-ink"+ class="flex h-8 w-full items-center gap-2 rounded-lg px-2 text-sm text-ink-muted hover:bg-hover hover:text-ink"onClick={startCreatingFolder}><FolderPlusIcon class="size-4 shrink-0" />@@ -635,22 +621,20 @@ export const BulkMoveToProjectView = (props: {</Show></div></div>-- <div class="flex justify-end gap-2">- <Button variant="ghost" class="rounded-xs" onClick={props.onCancel}>- Cancel- </Button>- <Button- type="button"- variant="outline"- class="rounded-xs"- onClick={finishEditing}- disabled={!selectedProject()}- >- Move- </Button>- </div>- </div>+ </ActionDialogShell.Body>+ <ActionDialogShell.Footer>+ <Button variant="ghost" onClick={props.onCancel}>+ Cancel+ </Button>+ <Button+ type="button"+ variant="strong"+ onClick={() => void finishEditing()}+ disabled={!selectedProject()}+ >+ Move+ </Button>+ </ActionDialogShell.Footer></div>);};diff --git a/apps/web/src/features/entity/bulk-edit/BulkRenameEntitiesView.tsx b/apps/web/src/features/entity/bulk-edit/BulkRenameEntitiesView.tsxindex 7702900e16..a5329fabef 100644--- a/apps/web/src/features/entity/bulk-edit/BulkRenameEntitiesView.tsx+++ b/apps/web/src/features/entity/bulk-edit/BulkRenameEntitiesView.tsx@@ -1,14 +1,11 @@-import {- createBulkRenameDssEntityMutation,- type EntityData,- InlineEntity,-} from '@entity';-import { Dialog } from '@kobalte/core/dialog';-import CloseIcon from '@phosphor-icons/core/regular/x.svg?component-solid';-import { Button, cn, SegmentedControl } from '@ui';-import { createMemo, createSignal, For, onMount, Show } from 'solid-js';--type RenameMode = 'total' | 'prepend' | 'append' | 'replace';+import ArrowRight from '@phosphor/arrow-right.svg';+import { ActionDialogShell, Button, Tabs, TextField, Tooltip } from '@ui';+import { createSignal, Show } from 'solid-js';+import { match } from 'ts-pattern';+import { createBulkRenameDssEntityMutation } from '../queries/rename';+import type { EntityData } from '../types/entity';+import { EntityActionSelection } from './components/EntityActionSelection';+import { type RenameMode, renamedEntityName } from './core/rename';export const BulkRenameEntitiesView = (props: {entities: EntityData[];@@ -16,84 +13,40 @@ export const BulkRenameEntitiesView = (props: {onCancel: () => void;onError?: (error: unknown) => void;}) => {- const renameMutation = createBulkRenameDssEntityMutation();-- let inputRef: HTMLInputElement | undefined;-- const primaryEntity = () => props.entities[0];+ const mutation = createBulkRenameDssEntityMutation();const multi = () => props.entities.length > 1;-- const [editValue, setEditValue] = createSignal(primaryEntity()?.name ?? '');- const [replaceFind, setReplaceFind] = createSignal('');- const [replaceWith, setReplaceWith] = createSignal('');-- // Mode defaults+ const [value, setValue] = createSignal(props.entities[0]?.name ?? '');+ const [find, setFind] = createSignal('');+ const [replacement, setReplacement] = createSignal('');const [mode, setMode] = createSignal<RenameMode>(multi() ? 'append' : 'total');-- const modeOptions: { value: RenameMode; label: string }[] = [- { value: 'prepend', label: 'Prepend' },- { value: 'append', label: 'Append' },- { value: 'replace', label: 'Replace' },- { value: 'total', label: 'Total' },- ];-- const handleKeyDown = (e: KeyboardEvent) => {- if (e.key === 'Enter') {- e.preventDefault();- finishEditing();- } else if (e.key === 'Escape') {- e.preventDefault();- props.onCancel();- }- };-- const previewName = createMemo(() => {- const base = primaryEntity()?.name ?? '';- const v = editValue().trim();-- switch (mode()) {- case 'total':- return v;-- case 'prepend':- return v + base;-- case 'append':- return base + v;-- case 'replace':- if (!replaceFind()) return base;- return base.replaceAll(replaceFind(), replaceWith());-- default:- return base;- }- });-+ const updates = () =>+ props.entities.map((entity) => ({+ entity,+ newName: renamedEntityName(+ entity.name ?? '',+ mode(),+ value(),+ find(),+ replacement()+ ),+ }));+ const changes = () =>+ updates().filter(({ entity, newName }) => newName !== (entity.name ?? ''));+ const preview = () => updates()[0];+ const label = () =>+ !multi()+ ? 'Name'+ : match(mode())+ .with('append', () => 'Text to append')+ .with('prepend', () => 'Text to prepend')+ .with('replace', () => 'Find')+ .with('total', () => 'New name for all items')+ .exhaustive();const finishEditing = async () => {- const newValue = editValue();-- let renameFn: (old?: string) => string = () => newValue;- switch (mode()) {- case 'prepend':- renameFn = (old) => newValue + (old ?? '');- break;- case 'append':- renameFn = (old) => (old ?? '') + newValue;- break;- case 'replace':- renameFn = (old) =>- (old ?? '').replaceAll(replaceFind(), replaceWith());- break;- default:- }-try {- const results = await renameMutation.mutateAsync(- props.entities.map((e) => ({ entity: e, newName: renameFn(e.name) }))- );+ const results = await mutation.mutateAsync(updates());if (results.some((result) => !result.success)) {props.onError?.(new Error('Some entities could not be renamed'));return;@@ -104,114 +57,118 @@ export const BulkRenameEntitiesView = (props: {props.onError?.(error);}};-return (- <>- <div class="shrink-0 flex flex-row items-center px-2 gap-1 border-b border-b-edge-muted h-10">- <Dialog.CloseButton as={Button} variant="ghost" size="icon-sm">- <CloseIcon />- </Dialog.CloseButton>- <Dialog.Title as="span" class="text-sm font-medium p-0 m-0">- Rename- </Dialog.Title>- </div>-- <div class="p-2 border-b border-edge-muted">- <div class="flex items-center gap-2">- <For each={props.entities.slice(0, 2)}>- {(entity) => (- <div- class={cn(- 'bg-hover border border-edge-muted px-2 py-1 truncate text-xs rounded-xs',- {- 'max-w-[50%]': props.entities.length === 2,- }- )}- >- <InlineEntity entity={entity} />- </div>- )}- </For>- <Show when={props.entities.length > 2}>- <div class="text-ink-muted text-xs px-2 py-1">- +{props.entities.length - 2} more- </div>- </Show>- </div>- </div>-- <div class="p-3 flex flex-col gap-3">+ <form+ class="flex min-h-0 flex-col"+ onSubmit={(event) => {+ event.preventDefault();+ void finishEditing();+ }}+ >+ <ActionDialogShell.Body>+ <ActionDialogShell.Header>+ <ActionDialogShell.Title>+ {multi() ? `Rename ${props.entities.length} items` : 'Rename item'}+ </ActionDialogShell.Title>+ <ActionDialogShell.Description>+ {multi()+ ? 'Choose how to update the selected names.'+ : 'Give this item a name that’s easy to find.'}+ </ActionDialogShell.Description>+ </ActionDialogShell.Header>+ <EntityActionSelection entities={props.entities} /><Show when={multi()}>- <SegmentedControl- aria-label="Mode"+ <Tabs+ aria-label="Rename mode"value={mode()}- options={modeOptions}- onChange={(value) => setMode(value)}- size="sm"- />- </Show>-- <div class="w-full">- <input- ref={(el) => {- inputRef = el;- onMount(() => {- setTimeout(() => {- inputRef?.focus();- inputRef?.select();- });- });+ fullWidth+ onChange={(next) => {+ if (+ next === 'prepend' ||+ next === 'append' ||+ next === 'replace' ||+ next === 'total'+ )+ setMode(next);}}- value={editValue()}- onInput={(e) => setEditValue(e.currentTarget.value)}- onKeyDown={handleKeyDown}- class="w-full p-2 text-sm border border-edge bg-surface text-ink- placeholder:text-ink-placeholder focus:outline-none focus:bg-active- selection:bg-ink selection:text-surface"- placeholder="Enter new text..."+ list={[+ { value: 'prepend', label: 'Prepend' },+ { value: 'append', label: 'Append' },+ { value: 'replace', label: 'Replace' },+ { value: 'total', label: 'Total' },+ ]}/>- </div>-- <Show when={multi() && mode() === 'replace'}>- <div class="flex flex-col gap-2">- <input- class="p-1 text-sm border border-edge bg-surface"- placeholder="Find…"- value={replaceFind()}- onInput={(e) => setReplaceFind(e.currentTarget.value)}- />- <input- class="p-1 text-sm border border-edge bg-surface"- placeholder="Replace with…"- value={replaceWith()}- onInput={(e) => setReplaceWith(e.currentTarget.value)}- />+ </Show>+ <Show+ when={mode() === 'replace'}+ fallback={+ <TextField value={value()} onChange={setValue}>+ <TextField.Label>{label()}</TextField.Label>+ <TextField.Input+ placeholder="Enter text…"+ onFocus={(event) => event.currentTarget.select()}+ />+ </TextField>+ }+ >+ <div class="grid grid-cols-2 gap-3">+ <TextField value={find()} onChange={setFind}>+ <TextField.Label>Find</TextField.Label>+ <TextField.Input placeholder="Text to replace" />+ </TextField>+ <TextField value={replacement()} onChange={setReplacement}>+ <TextField.Label>Replace with</TextField.Label>+ <TextField.Input placeholder="New text" />+ </TextField></div></Show>-- <Show when={multi() && mode() !== 'total'}>- <div class="text-xs opacity-70">- Preview (first item):- <div class="mt-1 p-2 bg-surface border border-edge rounded">- {previewName()}+ <Show when={multi() && preview()}>+ {(_preview) => (+ <div>+ <div class="mb-2 flex justify-between gap-2 text-xs text-ink-muted">+ <span>Preview · first item</span>+ <span aria-live="polite">+ {changes().length} of {props.entities.length} names change+ </span>+ </div>+ <div class="grid grid-cols-[minmax(0,1fr)_16px_minmax(0,1fr)] items-center gap-2 rounded-lg border border-edge-muted bg-input/50 p-3 text-xs">+ <Tooltip+ label={preview()?.entity.name ?? 'Untitled'}+ class="min-w-0 max-w-full"+ >+ <span class="truncate text-ink-muted">+ {preview()?.entity.name ?? 'Untitled'}+ </span>+ </Tooltip>+ <ArrowRight class="size-3 text-ink-muted" />+ <Tooltip+ label={preview()?.newName || 'Empty name'}+ class="min-w-0 max-w-full"+ >+ <span class="truncate">+ {preview()?.newName || 'Empty name'}+ </span>+ </Tooltip>+ </div>+ <Show when={mode() === 'total'}>+ <p class="mt-2 text-xs text-ink-muted">+ All selected items will have the same name.+ </p>+ </Show></div>- </div>+ )}</Show>-- <div class="flex justify-end gap-2">- <Button variant="ghost" class="rounded-xs" onClick={props.onCancel}>- Cancel- </Button>- <Button- type="button"- variant="outline"- class="rounded-xs"- onClick={finishEditing}- >- Rename- </Button>- </div>- </div>- </>+ </ActionDialogShell.Body>+ <ActionDialogShell.Footer>+ <Button type="button" variant="ghost" onClick={props.onCancel}>+ Cancel+ </Button>+ <Button type="submit" variant="strong">+ {multi()+ ? `Rename ${props.entities.length} ${props.entities.length === 1 ? 'item' : 'items'}`+ : 'Save name'}+ </Button>+ </ActionDialogShell.Footer>+ </form>);};diff --git a/apps/web/src/features/entity/bulk-edit/components/EntityActionSelection.tsx b/apps/web/src/features/entity/bulk-edit/components/EntityActionSelection.tsxnew file mode 100644index 0000000000..b9bc399b9a--- /dev/null+++ b/apps/web/src/features/entity/bulk-edit/components/EntityActionSelection.tsx@@ -0,0 +1,68 @@+import { EntityIcon, getEntityIconType } from '@core/component/EntityIcon';+import { Button, Tooltip } from '@ui';+import { createSignal, createUniqueId, For, Show } from 'solid-js';+import { EntitySelectionBadge } from '../../components/EntitySelectionBadge';+import { EntityTitle } from '../../extractors/entity-title';+import type { EntityData } from '../../types/entity';++export function EntityActionSelection(props: {+ entities: EntityData[];+ disabled?: boolean;+}) {+ const [expanded, setExpanded] = createSignal(false);+ const listId = createUniqueId();+ return (+ <Show when={props.entities.length > 0}>+ <div class="min-w-0">+ <div class="flex min-w-0 items-center gap-1.5">+ <For each={props.entities.slice(0, 2)}>+ {(entity) => <EntitySelectionBadge entity={entity} />}+ </For>+ <Show when={props.entities.length > 2}>+ <Button+ type="button"+ size="sm"+ disabled={props.disabled}+ aria-label={+ expanded()+ ? 'Hide selected items'+ : `View all ${props.entities.length} selected items`+ }+ aria-expanded={expanded()}+ aria-controls={listId}+ onClick={() => setExpanded(!expanded())}+ >+ {expanded() ? 'Less' : `+${props.entities.length - 2}`}+ </Button>+ </Show>+ </div>+ <Show when={expanded()}>+ <ul+ id={listId}+ aria-label="Selected items"+ class="mt-2 max-h-40 overflow-y-auto border-t border-edge-muted pt-1"+ >+ <For each={props.entities}>+ {(entity) => (+ <li class="flex h-7 min-w-0 items-center gap-2 px-2 text-xs">+ <span class="size-3.5 shrink-0">+ <EntityIcon+ targetType={getEntityIconType(entity)}+ size="fill"+ />+ </span>+ <Tooltip+ label={entity.name ?? 'Untitled'}+ class="min-w-0 max-w-full"+ >+ <EntityTitle entity={entity} />+ </Tooltip>+ </li>+ )}+ </For>+ </ul>+ </Show>+ </div>+ </Show>+ );+}diff --git a/apps/web/src/features/entity/bulk-edit/core/rename.test.ts b/apps/web/src/features/entity/bulk-edit/core/rename.test.tsnew file mode 100644index 0000000000..a8d5f8c562--- /dev/null+++ b/apps/web/src/features/entity/bulk-edit/core/rename.test.ts@@ -0,0 +1,38 @@+import { describe, expect, it } from 'vitest';+import { renamedEntityName } from './rename';++describe('bulk rename names used for preview and submission', () => {+ it('preserves intentional spaces in prefixes and suffixes', () => {+ expect(+ renamedEntityName('Launch notes', 'prepend', 'Draft — ', '', '')+ ).toBe('Draft — Launch notes');+ expect(+ renamedEntityName('Launch notes', 'append', ' — final', '', '')+ ).toBe('Launch notes — final');+ });+ it('replaces every literal match, leaving non-matches unchanged', () => {+ expect(renamedEntityName('a.b.a.b', 'replace', '', 'a.b', 'draft')).toBe(+ 'draft.draft'+ );+ expect(+ renamedEntityName('Launch notes', 'replace', '', 'spec', 'plan')+ ).toBe('Launch notes');+ });+ it('preserves existing replaceAll behavior when Find is empty', () => {+ expect(renamedEntityName('ab', 'replace', '', '', '-')).toBe('-a-b-');+ });+ it('supports removing matched text and replacing the entire name', () => {+ expect(+ renamedEntityName('Draft: Launch', 'replace', '', 'Draft: ', '')+ ).toBe('Launch');+ expect(+ renamedEntityName(+ 'Launch notes',+ 'total',+ 'New title',+ 'ignored',+ 'ignored'+ )+ ).toBe('New title');+ });+});diff --git a/apps/web/src/features/entity/bulk-edit/core/rename.ts b/apps/web/src/features/entity/bulk-edit/core/rename.tsnew file mode 100644index 0000000000..9173c90abf--- /dev/null+++ b/apps/web/src/features/entity/bulk-edit/core/rename.ts@@ -0,0 +1,18 @@+import { match } from 'ts-pattern';++export type RenameMode = 'total' | 'prepend' | 'append' | 'replace';++export function renamedEntityName(+ name: string,+ mode: RenameMode,+ value: string,+ find: string,+ replacement: string+): string {+ return match(mode)+ .with('total', () => value)+ .with('prepend', () => value + name)+ .with('append', () => name + value)+ .with('replace', () => name.replaceAll(find, replacement))+ .exhaustive();+}diff --git a/apps/web/src/features/entity/components/EntitySelectionBadge.tsx b/apps/web/src/features/entity/components/EntitySelectionBadge.tsxnew file mode 100644index 0000000000..50154e48d2--- /dev/null+++ b/apps/web/src/features/entity/components/EntitySelectionBadge.tsx@@ -0,0 +1,21 @@+import { EntityIcon, getEntityIconType } from '@core/component/EntityIcon';+import { Badge, Tooltip } from '@ui';+import { EntityTitle } from '../extractors/entity-title';+import type { EntityData } from '../types/entity';++/** Compact selected-item identity shared by action menus and dialogs. */+export function EntitySelectionBadge(props: { entity: EntityData }) {+ return (+ <Tooltip label={props.entity.name ?? 'Untitled'} class="min-w-0 max-w-48">+ <Badge variant="outline" size="sm" class="min-w-0 max-w-full shrink">+ <span class="size-3.5 shrink-0">+ <EntityIcon+ targetType={getEntityIconType(props.entity)}+ size="fill"+ />+ </span>+ <EntityTitle entity={props.entity} />+ </Badge>+ </Tooltip>+ );+}diff --git a/apps/web/src/features/reminders/ReminderComposerModal.test.tsx b/apps/web/src/features/reminders/ReminderComposerModal.test.tsxnew file mode 100644index 0000000000..974905c471--- /dev/null+++ b/apps/web/src/features/reminders/ReminderComposerModal.test.tsx@@ -0,0 +1,103 @@+import {+ cleanup,+ fireEvent,+ render,+ screen,+ waitFor,+} from '@solidjs/testing-library';+import type { ParentProps } from 'solid-js';+import { afterEach, beforeEach, expect, it, vi } from 'vitest';+import { ReminderComposerModal } from './ReminderComposerModal';+import {+ closeReminderComposer,+ openStandaloneReminderComposer,+ reminderComposerOpen,+} from './reminder-composer';++const mocks = vi.hoisted(() => ({+ save: vi.fn(),+ pending: false,+ failure: vi.fn(),+}));+vi.mock('@queries/reminders/reminders', () => ({+ reminderTarget: vi.fn(),+ useCreateReminderMutation: () => ({+ mutateAsync: mocks.save,+ get isPending() {+ return mocks.pending;+ },+ }),+}));+vi.mock('@queries/soup/cache', () => ({ refetchSoupEntity: vi.fn() }));+vi.mock('@core/component/Toast/Toast', () => ({+ toast: { success: vi.fn(), failure: mocks.failure },+}));+vi.mock('@entity/components/EntitySelectionBadge', () => ({+ EntitySelectionBadge: () => null,+}));+vi.mock('@ui', () => {+ const Slot = (props: ParentProps) => props.children;+ return {+ Dialog: Object.assign(Slot, { Title: Slot, Description: Slot }),+ ActionDialogShell: Object.assign(Slot, {+ Header: Slot,+ Title: Slot,+ Description: Slot,+ }),+ };+});+vi.mock('./ReminderForm', () => ({+ ReminderForm: (props: { onSubmit: (values: unknown) => void }) => (+ <div>+ <button+ type="button"+ onClick={() =>+ props.onSubmit({+ description: 'Follow up',+ schedule: { type: 'once', remind_at: '2099-01-01T09:00:00Z' },+ })+ }+ >+ Submit+ </button>+ </div>+ ),+}));+beforeEach(() => {+ mocks.save.mockReset();+ mocks.pending = false;+ mocks.failure.mockClear();+ closeReminderComposer();+});+afterEach(() => {+ cleanup();+ closeReminderComposer();+});+it('dismisses before saving and calls the captured handler after success', async () => {+ let resolve!: (value: object) => void;+ mocks.save.mockReturnValueOnce(+ new Promise((done) => {+ resolve = done;+ })+ );+ const onCreated = vi.fn();+ openStandaloneReminderComposer({ onCreated });+ render(() => <ReminderComposerModal />);+ fireEvent.click(screen.getByRole('button', { name: 'Submit' }));+ expect(reminderComposerOpen()).toBe(false);+ expect(onCreated).not.toHaveBeenCalled();+ resolve({});+ await waitFor(() => expect(onCreated).toHaveBeenCalledOnce());+});+it('reports a failed save by toast without reopening or calling the handler', async () => {+ mocks.save.mockRejectedValueOnce(new Error('offline'));+ const onCreated = vi.fn();+ openStandaloneReminderComposer({ onCreated });+ render(() => <ReminderComposerModal />);+ fireEvent.click(screen.getByRole('button', { name: 'Submit' }));+ await waitFor(() =>+ expect(mocks.failure).toHaveBeenCalledWith('Failed to create reminder')+ );+ expect(reminderComposerOpen()).toBe(false);+ expect(onCreated).not.toHaveBeenCalled();+});diff --git a/apps/web/src/features/reminders/ReminderComposerModal.tsx b/apps/web/src/features/reminders/ReminderComposerModal.tsxindex 54d26eba85..c6ff6d6598 100644--- a/apps/web/src/features/reminders/ReminderComposerModal.tsx+++ b/apps/web/src/features/reminders/ReminderComposerModal.tsx@@ -1,13 +1,13 @@import { toast } from '@core/component/Toast/Toast';-import { type EntityData, InlineEntity } from '@entity';-import BellIcon from '@phosphor/bell-simple.svg';+import type { EntityData } from '@entity';+import { EntitySelectionBadge } from '@entity/components/EntitySelectionBadge';import {reminderTarget,useCreateReminderMutation,} from '@queries/reminders/reminders';import { refetchSoupEntity } from '@queries/soup/cache';import type { ReminderSchedule } from '@service-storage/generated/schemas/reminderSchedule';-import { Dialog, Panel } from '@ui';+import { ActionDialogShell, Dialog } from '@ui';import { Show } from 'solid-js';import { ReminderForm } from './ReminderForm';import {@@ -107,10 +107,11 @@ export function ReminderComposerModal() {}) => {const target = entity();if (target) {- submitCreate(values.schedule, target, values.description);+ void submitCreate(values.schedule, target, values.description);return;}- if (standalone()) submitStandalone(values.schedule, values.description);+ if (standalone())+ void submitStandalone(values.schedule, values.description);};// Both targets are cleared on close, so this unmounts the form while the@@ -124,49 +125,42 @@ export function ReminderComposerModal() {onOpenChange={(open) => {if (!open) closeReminderComposer();}}- // The form autofocuses its title; keep Kobalte from stealing focus onto- // the referenced-entity chip, which is the first tabbable otherwise.- onOpenAutoFocus={(event) => event.preventDefault()}position="center"- class="w-[28rem]"+ class="w-110">- <Panel depth={2} class="rounded-xl">- <Panel.Header class="px-4">- <Dialog.Title class="flex items-center gap-2 text-sm font-semibold text-ink">- <BellIcon class="size-3.5 text-ink-muted" />- New reminder- </Dialog.Title>- </Panel.Header>+ <ActionDialogShell><Show when={hasTarget()}>- <Panel.Body class="p-4 font-sans">- <ReminderForm- autofocus- placeholder={- // Not optional for a standalone reminder: there is no entity to- // name it after, so this is all it will ever say.- standalone()- ? "What's the reminder?"- : "What's the reminder? (optional)"- }- descriptionRequired={standalone()}- submitLabel="Set reminder"- reference={- <Show when={entity()}>- {(target) => (- <div class="flex">- <div class="max-w-full truncate rounded border border-edge-muted bg-active px-2 py-1 text-xs">- <InlineEntity entity={target()} />- </div>- </div>- )}- </Show>- }- onCancel={closeReminderComposer}- onSubmit={handleSubmit}- />- </Panel.Body>+ <ReminderForm+ layout="dialog"+ header={+ <ActionDialogShell.Header>+ <ActionDialogShell.Title>New reminder</ActionDialogShell.Title>+ <ActionDialogShell.Description>+ Choose when you’d like to be reminded.+ </ActionDialogShell.Description>+ </ActionDialogShell.Header>+ }+ placeholder={+ standalone()+ ? "What's the reminder?"+ : "What's the reminder? (optional)"+ }+ descriptionRequired={standalone()}+ submitLabel="Set reminder"+ reference={+ <Show when={entity()}>+ {(target) => (+ <div class="flex min-w-0">+ <EntitySelectionBadge entity={target()} />+ </div>+ )}+ </Show>+ }+ onCancel={closeReminderComposer}+ onSubmit={(values) => void handleSubmit(values)}+ /></Show>- </Panel>+ </ActionDialogShell></Dialog>);}diff --git a/apps/web/src/features/reminders/ReminderForm.tsx b/apps/web/src/features/reminders/ReminderForm.tsxindex 8f66a116db..4d6d2061be 100644--- a/apps/web/src/features/reminders/ReminderForm.tsx+++ b/apps/web/src/features/reminders/ReminderForm.tsx@@ -9,10 +9,11 @@ import {} from '@core/util/cron';import { TZDateMini } from '@date-fns/tz';import type { ReminderSchedule } from '@service-storage/generated/schemas/reminderSchedule';-import { Button, cn } from '@ui';+import { ActionDialogShell, Button, Input, Tabs } from '@ui';import {createEffect,createSignal,+ createUniqueId,For,type JSX,Match,@@ -20,6 +21,7 @@ import {Show,Switch,} from 'solid-js';+import { Dynamic } from 'solid-js/web';import {isRecurring,onceSchedule,@@ -67,6 +69,9 @@ export interface ReminderFormProps {reference?: JSX.Element;submitLabel: string;pending?: boolean;+ /** Dialog hosts provide their heading and use a padded body with a fixed footer. */+ header?: JSX.Element;+ layout?: 'dialog' | 'inline';autofocus?: boolean;/*** Cancel reverts the fields to what they were seeded with rather than only@@ -244,6 +249,7 @@ export function ReminderForm(props: ReminderFormProps) {const initialParts = seed.parts;const initialTimezone = seed.recurringTimezone ?? localZone;+ const formId = createUniqueId();let titleRef: HTMLInputElement | undefined;onMount(() => {if (props.autofocus) titleRef?.focus();@@ -383,183 +389,188 @@ export function ReminderForm(props: ReminderFormProps) {};return (- <div class="flex flex-col gap-4 text-sm">- {/* Outside the <form> on purpose: the reference card carries its own+ <div class="flex min-h-0 flex-col text-sm">+ <Dynamic+ component={props.layout === 'dialog' ? ActionDialogShell.Body : 'div'}+ class={+ props.layout === 'dialog'+ ? undefined+ : 'min-h-0 space-y-5 overflow-y-auto'+ }+ >+ {props.header}+ {/* Outside the <form> on purpose: the reference card carries its ownbuttons (Copy Link, etc.), and a button inside a form submits it —which here would save-and-close the panel on a stray click. */}- <Show when={props.reference}>{(node) => node()}</Show>-- <form- class="flex flex-col gap-4"- onSubmit={(event) => {- event.preventDefault();- submit();- }}- >- <input- ref={titleRef}- type="text"- value={description()}- onInput={(event) => setDescription(event.currentTarget.value)}- placeholder={props.placeholder}- aria-label="Reminder description"- // Counts UTF-16 code units where the service counts characters, so this- // only ever stops short of the real limit, never past it. The- // description resolvers apply the exact cap.- maxLength={REMINDER_DESCRIPTION_MAX_LENGTH}- class="w-full rounded-md border border-edge-muted bg-surface px-2 py-2 text-sm text-ink outline-none placeholder:text-ink-placeholder focus:border-accent"- />-- <div class="flex flex-col gap-2">- <span class="text-xs font-medium text-ink-muted">Repeat</span>- <div class="flex gap-1">- <For- each={- [+ <Show when={props.reference}>{(node) => node()}</Show>++ <form+ id={formId}+ class="flex flex-col gap-4"+ onSubmit={(event) => {+ event.preventDefault();+ submit();+ }}+ >+ <fieldset class="flex min-w-0 flex-col gap-4">+ <Input+ ref={titleRef}+ type="text"+ value={description()}+ onInput={(event) => setDescription(event.currentTarget.value)}+ placeholder={props.placeholder}+ aria-label="Reminder description"+ // Counts UTF-16 code units where the service counts characters, so this+ // only ever stops short of the real limit, never past it. The+ // description resolvers apply the exact cap.+ maxLength={REMINDER_DESCRIPTION_MAX_LENGTH}+ size="lg"+ />++ <div class="flex flex-col gap-2">+ <span class="text-xs font-medium text-ink-muted">Repeat</span>+ <Tabs+ aria-label="Repeat"+ labelClass="whitespace-nowrap px-2"+ value={repeat()}+ fullWidth+ onChange={(value) => {+ if (value === 'once' || value === 'week' || value === 'month')+ setRepeatKind(value);+ }}+ list={[{ value: 'once', label: 'Does not repeat' },{ value: 'week', label: 'Weekly' },{ value: 'month', label: 'Monthly' },- ] as const- }- >- {(option) => (- <button- type="button"- class={cn(- 'flex-1 rounded border px-2 py-1.5 text-xs',- repeat() === option.value- ? 'border-edge bg-active text-ink'- : 'border-edge-muted text-ink-muted hover:text-ink'- )}- onClick={() => setRepeatKind(option.value)}- >- {option.label}- </button>- )}- </For>- </div>- </div>-- <Switch>- <Match when={repeat() === 'once'}>- <div class="flex flex-col gap-2">- <div class="flex items-center gap-2">- <input- type="date"- aria-label="Date"- value={onceDate()}- onInput={(event) => setOnceDate(event.currentTarget.value)}- class="rounded-sm border border-edge-muted bg-surface px-2 py-1.5 text-sm text-ink outline-none focus:border-accent"- />- <input- type="time"- aria-label="Time"- value={onceTime()}- onInput={(event) => setOnceTime(event.currentTarget.value)}- class="rounded-sm border border-edge-muted bg-surface px-2 py-1.5 text-sm text-ink outline-none focus:border-accent"- />- </div>- <span class="text-xs text-ink-muted">- {localZone.replace(/_/g, ' ')} ({shortZone(localZone)})- </span>+ ]}+ /></div>- </Match>- <Match when={repeat() === 'week'}>- <div class="flex flex-col gap-3">- <div class="flex gap-1">- <For each={WEEKDAY_OPTIONS}>- {(day) => (- <button- type="button"- class={cn(- 'flex-1 rounded border px-1 py-1.5 text-xs',- repeatParts().daysOfWeek.includes(day.value)- ? 'border-edge bg-active text-ink'- : 'border-edge-muted text-ink-muted hover:text-ink'- )}- aria-pressed={repeatParts().daysOfWeek.includes(- day.value++ <Switch>+ <Match when={repeat() === 'once'}>+ <div class="flex flex-col gap-2">+ <div class="flex items-center gap-2">+ <Input+ type="date"+ aria-label="Date"+ value={onceDate()}+ onInput={(event) =>+ setOnceDate(event.currentTarget.value)+ }+ class="min-w-0 flex-1 text-sm"+ />+ <Input+ type="time"+ aria-label="Time"+ value={onceTime()}+ onInput={(event) =>+ setOnceTime(event.currentTarget.value)+ }+ class="min-w-0 flex-1 text-sm"+ />+ </div>+ <span class="text-xs text-ink-muted">+ {localZone.replace(/_/g, ' ')} ({shortZone(localZone)})+ </span>+ </div>+ </Match>+ <Match when={repeat() === 'week'}>+ <div class="flex flex-col gap-3">+ <div class="flex gap-1">+ <For each={WEEKDAY_OPTIONS}>+ {(day) => (+ <Button+ type="button"+ size="sm"+ class="min-w-0 flex-1 px-1"+ variant={+ repeatParts().daysOfWeek.includes(day.value)+ ? 'accent'+ : 'outline'+ }+ aria-pressed={repeatParts().daysOfWeek.includes(+ day.value+ )}+ onClick={() => toggleDay(day.value)}+ >+ {day.label}+ </Button>)}- onClick={() => toggleDay(day.value)}- >- {day.label}- </button>- )}- </For>+ </For>+ </div>+ <TimeField+ value={repeatParts().time}+ onChange={(time) => updateParts({ time })}+ />+ </div>+ </Match>+ <Match when={repeat() === 'month'}>+ <div class="flex items-center gap-3">+ <label class="flex items-center gap-2 text-sm text-ink-muted">+ Day+ <Input+ type="number"+ min="1"+ max="31"+ value={repeatParts().dayOfMonth}+ onInput={(event) =>+ updateParts({ dayOfMonth: event.currentTarget.value })+ }+ class="w-16 text-sm"+ />+ </label>+ <TimeField+ value={repeatParts().time}+ onChange={(time) => updateParts({ time })}+ />+ </div>+ </Match>+ </Switch>++ <Show when={repeat() !== 'once'}>+ <div class="flex flex-col gap-2">+ <label class="flex items-center gap-2 text-xs text-ink-muted">+ <span class="font-medium">Timezone</span>+ <TimezoneSelect+ value={timezone()}+ onChange={setTimezone}+ options={TIMEZONE_OPTIONS}+ />+ </label>+ <span class="truncate text-xs text-ink-muted">+ {describeCron(repeatParts())} · {shortZone(timezone())}+ </span></div>- <TimeField- value={repeatParts().time}- onChange={(time) => updateParts({ time })}- />- </div>- </Match>- <Match when={repeat() === 'month'}>- <div class="flex items-center gap-3">- <label class="flex items-center gap-2 text-sm text-ink-muted">- Day- <input- type="number"- min="1"- max="31"- value={repeatParts().dayOfMonth}- onInput={(event) =>- updateParts({ dayOfMonth: event.currentTarget.value })- }- class="w-16 rounded-sm border border-edge-muted bg-surface px-2 py-1.5 text-sm text-ink outline-none focus:border-accent"- />- </label>- <TimeField- value={repeatParts().time}- onChange={(time) => updateParts({ time })}- />- </div>- </Match>- </Switch>-- <Show when={repeat() !== 'once'}>- <div class="flex flex-col gap-2">- <label class="flex items-center gap-2 text-xs text-ink-muted">- <span class="font-medium">Timezone</span>- <TimezoneSelect- value={timezone()}- onChange={setTimezone}- options={TIMEZONE_OPTIONS}- />- </label>- <span class="truncate text-xs text-ink-muted">- {describeCron(repeatParts())} · {shortZone(timezone())}- </span>- </div>+ </Show>+ </fieldset>+ </form>+ </Dynamic>+ <Dynamic+ component={props.layout === 'dialog' ? ActionDialogShell.Footer : 'div'}+ class={+ props.layout === 'dialog'+ ? undefined+ : 'mt-4 flex shrink-0 flex-wrap items-center justify-end gap-2 border-t border-edge-muted pt-3'+ }+ >+ <Show when={isEdit && isDirty()}>+ <span class="flex items-center gap-1.5 text-xs text-ink-muted">+ <span class="size-1.5 rounded-full bg-warning" />+ Unsaved changes+ </span></Show>-- <div class="flex items-center gap-3 pt-2">- <Show when={isEdit && isDirty()}>- <span class="flex items-center gap-1.5 text-xs text-ink-muted">- <span class="size-1.5 rounded-full bg-warning" />- Unsaved changes- </span>- </Show>- <Button- type="button"- variant="ghost"- size="sm"- class="ml-auto rounded-lg"- onClick={cancel}- >- Cancel- </Button>- <Button- type="submit"- variant="accent"- size="sm"- depth={3}- class="rounded-lg border-0"- disabled={!canSubmit() || (isEdit && !isDirty())}- >- {props.submitLabel}- </Button>- </div>- </form>+ <Button type="button" variant="ghost" class="ml-auto" onClick={cancel}>+ Cancel+ </Button>+ <Button+ type="submit"+ form={formId}+ variant="strong"+ disabled={!canSubmit() || (isEdit && !isDirty())}+ >+ {props.submitLabel}+ </Button>+ </Dynamic></div>);}@@ -572,11 +583,11 @@ function TimeField(props: {return (<label class="flex items-center gap-2 text-sm text-ink-muted">At- <input+ <Inputtype="time"value={props.value}onInput={(event) => props.onChange(event.currentTarget.value)}- class="rounded-sm border border-edge-muted bg-surface px-2 py-1.5 text-sm text-ink outline-none focus:border-accent"+ class="min-w-0 flex-1 text-sm"/></label>);diff --git a/apps/web/src/features/reminders/TimezoneSelect.tsx b/apps/web/src/features/reminders/TimezoneSelect.tsxindex b7a030b38b..b901d6334e 100644--- a/apps/web/src/features/reminders/TimezoneSelect.tsx+++ b/apps/web/src/features/reminders/TimezoneSelect.tsx@@ -116,12 +116,12 @@ export function TimezoneSelect(props: {placement="bottom-start"gutter={4}>- <Combobox.Control>+ <Combobox.Control class="min-w-0 flex-1"><Combobox.Triggertype="button"aria-label="Timezone"class={cn(- 'flex flex-1 items-center justify-between gap-2 rounded-sm border border-edge-muted bg-surface px-2 py-1.5 text-sm text-ink outline-none focus:border-accent',+ 'flex w-full min-w-0 items-center justify-between gap-2 rounded-md border border-edge-muted bg-input px-2 py-1.5 text-sm text-ink outline-none focus:border-accent',props.class)}>diff --git a/docs/AGENT_GUIDE/navigation.md b/docs/AGENT_GUIDE/navigation.mdindex 70e34b0a04..a6effc5af2 100644--- a/docs/AGENT_GUIDE/navigation.md+++ b/docs/AGENT_GUIDE/navigation.md@@ -361,3 +361,32 @@ from the owning view before opening it elsewhere. The same rule applies to mouseselection, keyboard preview navigation, and detail breadcrumbs. Touch layoutsnever render inline previews or detail views: a tap opens the entity in thesplit, so the toast only appears when the content is genuinely open elsewhere.++## Entity action dialogs++Rename, Delete, and Move to folder use compact centered dialogs on desktop and+the shared drawer on mobile, with actions in a separated footer. One selected+item shows a compact name chip; multiple items show two chips and+`+N`, which expands single-line names for review.+Selected-item chips in action command menus and dialogs use the shared Badge,+cap each name at 192px, and reveal truncated names on hover. Overflow counts+remain on one line.++Bulk Rename uses bubble tabs for Prepend, Append, Replace, and Total. It starts+with the first item’s name and shows one before/after example. Replace+shows only Find and Replace with fields; Total applies one name to all items.+The preview counts changed names.+Partial deletes keep the dialog open, report confirmed successes, and leave only+failed items selected for retry.+Cancel and Escape dismiss the dialog. Use Cancel when+reviewing dialogs against hosted data; confirmation performs real mutations.++The New reminder dialog uses the same compact panel and fixed action footer.+Its referenced item is a capped Badge; repeat options use bubble tabs (Does not+repeat / Weekly / Monthly). Date, time, weekdays, and timezone retain their+scheduling behavior. Creating a reminder dismisses the composer before saving,+with success or failure reported by toast.++Action dialogs share `ActionDialogShell` presentation slots: the same capped selection badges for single and multiple items, compact heading and copy, prominent fields, and an attached footer. Rename, delete, move, reminder creation, and shared confirmations use this layout. Bulk rename keeps bubble tabs and one first-item preview.++The Move to folder picker uses the Drive sidebar’s folder rows: neutral icons, trailing expand/collapse buttons, and indented branch guides. Click a folder to select it; use the chevron to expand it. Search and arrow-key navigation remain available.