Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
feat(ui): Motion Wave 1 — exit animations, Collapsible, Tabs slider, easing & CopyCheckIcon (MUL-9951) (#11291)
Jiayuan Zhangfa71dc9861ee
diff --git a/apps/desktop/src/renderer/src/App.tsx b/apps/desktop/src/renderer/src/App.tsxindex 83bc1f9ef9..7c326edbe1 100644--- a/apps/desktop/src/renderer/src/App.tsx+++ b/apps/desktop/src/renderer/src/App.tsx@@ -31,6 +31,7 @@ import { syncDaemonOnLogin } from "./platform/daemon-login-sync";import { createDesktopLocaleAdapter } from "./platform/i18n-adapter";import { captureEvent } from "@multica/core/analytics";import { AppearanceSync } from "@multica/views/common/appearance-sync";+import { MotionProvider } from "@multica/views/common/motion-provider";import { RESOURCES } from "@multica/views/locales";import { DesktopClientUsageReporter } from "./platform/client-usage-reporter";import { DiagnosticRouteReporter } from "./platform/diagnostic-route-reporter";@@ -484,53 +485,55 @@ export default function App() {}, [localeAdapter, locale]);return (- <ThemeProvider>- <AppearanceSync />- {runtimeConfigResult.ok ? (- <CoreProvider- apiBaseUrl={runtimeConfigResult.config.apiUrl}- wsUrl={runtimeConfigResult.config.wsUrl}- onLogout={- windowContext.kind === "main" ? handleDaemonLogout : undefined- }- onSessionExpired={- windowContext.kind === "main" ? handleSessionExpired : undefined- }- identity={identity}- locale={locale}- resources={resources}- localeAdapter={localeAdapter}- >- <DesktopAuthSessionBridge />- <NativeContextMenu />- {windowContext.kind === "main" && <DiagnosticRouteReporter />}- {windowContext.kind === "main" && <WorkspaceWindowBridge />}- {windowContext.kind === "main" && <IssueDeepLinkBridge />}- {windowContext.kind === "main" && (- <DesktopClientUsageReporter- apiUrl={runtimeConfigResult.config.apiUrl}- />- )}- {windowContext.kind === "issue" ? (- <IssueWindowContent />- ) : (- <AppContent />- )}- {/* Opt-in dev status bar; see "Dev Toolbar" in CONTRIBUTING.md. */}- {import.meta.env.DEV &&- import.meta.env.VITE_DEV_TOOLBAR &&- windowContext.kind === "main" && (- <DesktopDevToolbar apiUrl={runtimeConfigResult.config.apiUrl} />+ <MotionProvider>+ <ThemeProvider>+ <AppearanceSync />+ {runtimeConfigResult.ok ? (+ <CoreProvider+ apiBaseUrl={runtimeConfigResult.config.apiUrl}+ wsUrl={runtimeConfigResult.config.wsUrl}+ onLogout={+ windowContext.kind === "main" ? handleDaemonLogout : undefined+ }+ onSessionExpired={+ windowContext.kind === "main" ? handleSessionExpired : undefined+ }+ identity={identity}+ locale={locale}+ resources={resources}+ localeAdapter={localeAdapter}+ >+ <DesktopAuthSessionBridge />+ <NativeContextMenu />+ {windowContext.kind === "main" && <DiagnosticRouteReporter />}+ {windowContext.kind === "main" && <WorkspaceWindowBridge />}+ {windowContext.kind === "main" && <IssueDeepLinkBridge />}+ {windowContext.kind === "main" && (+ <DesktopClientUsageReporter+ apiUrl={runtimeConfigResult.config.apiUrl}+ />+ )}+ {windowContext.kind === "issue" ? (+ <IssueWindowContent />+ ) : (+ <AppContent />)}- </CoreProvider>- ) : (- <BlockingRuntimeConfigError- locale={locale}- message={runtimeConfigResult.error.message}- />- )}- <Toaster />- {windowContext.kind === "main" && <UpdateNotification />}- </ThemeProvider>+ {/* Opt-in dev status bar; see "Dev Toolbar" in CONTRIBUTING.md. */}+ {import.meta.env.DEV &&+ import.meta.env.VITE_DEV_TOOLBAR &&+ windowContext.kind === "main" && (+ <DesktopDevToolbar apiUrl={runtimeConfigResult.config.apiUrl} />+ )}+ </CoreProvider>+ ) : (+ <BlockingRuntimeConfigError+ locale={locale}+ message={runtimeConfigResult.error.message}+ />+ )}+ <Toaster />+ {windowContext.kind === "main" && <UpdateNotification />}+ </ThemeProvider>+ </MotionProvider>);}diff --git a/apps/desktop/src/renderer/src/components/update-notification.tsx b/apps/desktop/src/renderer/src/components/update-notification.tsxindex 38e1d5e322..003519ae04 100644--- a/apps/desktop/src/renderer/src/components/update-notification.tsx+++ b/apps/desktop/src/renderer/src/components/update-notification.tsx@@ -1,5 +1,8 @@import { useEffect, useState } from "react";+import { AnimatePresence, motion } from "motion/react";+import { useReducedMotion } from "@multica/core/appearance";import { RefreshCw, X } from "@multica/ui/icons";+import { UI_EASE_OUT, UI_MOTION_DURATION } from "@multica/ui/lib/motion";import { useT } from "@multica/views/i18n";// Downloads run silently in the background (main process has@@ -15,6 +18,7 @@ function changelogUrl(version: string): string {export function UpdateNotification() {const { t } = useT("settings");+ const prefersReducedMotion = useReducedMotion();const [state, setState] = useState<UpdateState>({ status: "idle" });const [dismissed, setDismissed] = useState(false);@@ -26,51 +30,64 @@ export function UpdateNotification() {return cleanup;}, []);- if (state.status === "idle") return null;- if (dismissed) return null;+ const visible = state.status === "ready" && !dismissed;return (- <div className="fixed bottom-4 right-4 z-50 w-80 rounded-lg border border-border bg-background p-4 shadow-lg animate-in slide-in-from-bottom-2 fade-in duration-300">- <button- type="button"- onClick={() => setDismissed(true)}- className="absolute top-2 right-2 rounded-md p-1 text-muted-foreground hover:text-foreground transition-colors"- aria-label={t(($) => $.desktop.updates.banner_dismiss)}- >- <X className="size-3.5" />- </button>+ <AnimatePresence>+ {visible && (+ <motion.div+ key="update-notification"+ initial={{ opacity: 0, y: prefersReducedMotion ? 0 : 8 }}+ animate={{ opacity: 1, y: 0 }}+ exit={{ opacity: 0, y: prefersReducedMotion ? 0 : 8 }}+ transition={{+ duration: prefersReducedMotion ? 0 : UI_MOTION_DURATION.standard,+ ease: UI_EASE_OUT,+ }}+ className="fixed bottom-4 right-4 z-50 w-80 rounded-lg border border-border bg-background p-4 shadow-lg"+ >+ <button+ type="button"+ onClick={() => setDismissed(true)}+ className="absolute top-2 right-2 rounded-md p-1 text-muted-foreground hover:text-foreground transition-colors"+ aria-label={t(($) => $.desktop.updates.banner_dismiss)}+ >+ <X className="size-3.5" />+ </button>- <div className="flex items-start gap-3">- <div className="mt-0.5 rounded-md bg-success/10 p-1.5">- <RefreshCw className="size-4 text-success" />- </div>- <div className="flex-1 min-w-0">- <p className="text-body font-medium">- {t(($) => $.desktop.updates.banner_title)}- </p>- <p className="text-caption text-muted-foreground mt-0.5">- {t(($) => $.desktop.updates.banner_body, { version: state.version })}- </p>- <div className="mt-2 flex items-center gap-1.5">- <button- type="button"- onClick={() =>- window.desktopAPI.openExternal(changelogUrl(state.version))- }- className="inline-flex items-center rounded-md border border-border bg-background px-3 py-1.5 text-caption font-medium text-foreground hover:bg-accent transition-colors"- >- {t(($) => $.desktop.updates.banner_changelog)}- </button>- <button- type="button"- onClick={() => window.updater.installUpdate()}- className="inline-flex items-center rounded-md bg-primary px-3 py-1.5 text-caption font-medium text-primary-foreground hover:bg-primary/90 transition-colors"- >- {t(($) => $.desktop.updates.banner_restart)}- </button>+ <div className="flex items-start gap-3">+ <div className="mt-0.5 rounded-md bg-success/10 p-1.5">+ <RefreshCw className="size-4 text-success" />+ </div>+ <div className="flex-1 min-w-0">+ <p className="text-body font-medium">+ {t(($) => $.desktop.updates.banner_title)}+ </p>+ <p className="text-caption text-muted-foreground mt-0.5">+ {t(($) => $.desktop.updates.banner_body, { version: state.version })}+ </p>+ <div className="mt-2 flex items-center gap-1.5">+ <button+ type="button"+ onClick={() =>+ window.desktopAPI.openExternal(changelogUrl(state.version))+ }+ className="inline-flex items-center rounded-md border border-border bg-background px-3 py-1.5 text-caption font-medium text-foreground hover:bg-accent transition-colors"+ >+ {t(($) => $.desktop.updates.banner_changelog)}+ </button>+ <button+ type="button"+ onClick={() => window.updater.installUpdate()}+ className="inline-flex items-center rounded-md bg-primary px-3 py-1.5 text-caption font-medium text-primary-foreground hover:bg-primary/90 transition-colors"+ >+ {t(($) => $.desktop.updates.banner_restart)}+ </button>+ </div>+ </div></div>- </div>- </div>- </div>+ </motion.div>+ )}+ </AnimatePresence>);}diff --git a/apps/web/components/web-providers.tsx b/apps/web/components/web-providers.tsxindex 34785d40fa..aebb4e2020 100644--- a/apps/web/components/web-providers.tsx+++ b/apps/web/components/web-providers.tsx@@ -17,6 +17,7 @@ import {} from "@/features/auth/auth-cookie";import { detectWebOS } from "@/platform/client-os";import { useUserLocaleSyncEnabled } from "@/platform/user-locale-sync";+import { MotionProvider } from "@multica/views/common/motion-provider";// Client-only: every reading is a live client measurement the server cannot// render, so server HTML would only ever mismatch on hydration.@@ -86,28 +87,30 @@ export function WebProviders({if (process.env.NODE_ENV === "development") installUserTimingCap();}, []);return (- <LocaleBundle locale={locale}>- {(resources) => (- <CoreProvider- apiBaseUrl={apiBaseUrl}- wsUrl={wsUrl || deriveWsUrl()}- cookieAuth={cookieAuth}- onLogin={setLoggedInCookie}- onLogout={clearLoggedInCookie}- identity={identity}- locale={locale}- resources={resources}- localeAdapter={localeAdapter}- syncUserLocale={syncUserLocale}- >- <WebNavigationProvider>- <WebScrollRestorationProvider>{children}</WebScrollRestorationProvider>- {process.env.NODE_ENV === "development" && devToolbarApiUrl && (- <WebDevToolbar apiUrl={devToolbarApiUrl} />- )}- </WebNavigationProvider>- </CoreProvider>- )}- </LocaleBundle>+ <MotionProvider>+ <LocaleBundle locale={locale}>+ {(resources) => (+ <CoreProvider+ apiBaseUrl={apiBaseUrl}+ wsUrl={wsUrl || deriveWsUrl()}+ cookieAuth={cookieAuth}+ onLogin={setLoggedInCookie}+ onLogout={clearLoggedInCookie}+ identity={identity}+ locale={locale}+ resources={resources}+ localeAdapter={localeAdapter}+ syncUserLocale={syncUserLocale}+ >+ <WebNavigationProvider>+ <WebScrollRestorationProvider>{children}</WebScrollRestorationProvider>+ {process.env.NODE_ENV === "development" && devToolbarApiUrl && (+ <WebDevToolbar apiUrl={devToolbarApiUrl} />+ )}+ </WebNavigationProvider>+ </CoreProvider>+ )}+ </LocaleBundle>+ </MotionProvider>);}diff --git a/apps/web/features/landing/components/download/cli-section.tsx b/apps/web/features/landing/components/download/cli-section.tsxindex a3a2d6a7a2..f43200a2e3 100644--- a/apps/web/features/landing/components/download/cli-section.tsx+++ b/apps/web/features/landing/components/download/cli-section.tsx@@ -1,7 +1,7 @@"use client";import { useState } from "react";-import { Check, Copy } from "@multica/ui/icons";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { CliInstallCommand } from "@multica/views/common/cli-install-command";import { copyText } from "@multica/ui/lib/clipboard";import { cn } from "@multica/ui/lib/utils";@@ -15,9 +15,9 @@ const SETUP_CMD = "multica setup";* switch takes its list and trigger colours from here.*/const PLATFORM_TABS = {- list: "border border-white/10 bg-white/5",+ list: "border border-white/10 bg-white/5 *:data-[slot=tabs-indicator]:bg-white/10 *:data-[slot=tabs-indicator]:shadow-none",trigger:- "text-site-inverse-muted hover:text-site-inverse-ink data-active:bg-white/10 data-active:text-site-inverse-ink",+ "text-site-inverse-muted hover:text-site-inverse-ink data-active:text-site-inverse-ink",};/**@@ -80,7 +80,7 @@ function CommandRow({ label, cmd }: { label: string; cmd: string }) {"focus-visible:outline-site-inverse-ink",)}>- {copied ? <Check className="size-3.5" /> : <Copy className="size-3.5" />}+ <CopyCheckIcon copied={copied} checkClassName="text-current" /></button></div></div>diff --git a/packages/ui/components/common/__tests__/copy-check-icon.test.tsx b/packages/ui/components/common/__tests__/copy-check-icon.test.tsxnew file mode 100644index 0000000000..c7a3965cb8--- /dev/null+++ b/packages/ui/components/common/__tests__/copy-check-icon.test.tsx@@ -0,0 +1,33 @@+import { cleanup, render } from "@testing-library/react";+import { afterEach, describe, expect, it } from "vitest";+import { CopyCheckIcon } from "../copy-check-icon";++afterEach(cleanup);++describe("CopyCheckIcon", () => {+ it("swaps from Copy to Check with text-success and motion-reduce animation guard", () => {+ const { container, rerender } = render(<CopyCheckIcon copied={false} />);+ const root = container.querySelector('[data-slot="copy-check-icon"]');+ expect(root).not.toBeNull();+ expect(root).not.toHaveAttribute("data-copied");+ expect(container.querySelector(".icon-copy")).not.toBeNull();+ expect(container.querySelector(".icon-check")).toBeNull();++ rerender(<CopyCheckIcon copied />);+ expect(root).toHaveAttribute("data-copied", "");+ expect(container.querySelector(".icon-copy")).toBeNull();+ const check = container.querySelector(".icon-check");+ expect(check).not.toBeNull();+ expect(check!.getAttribute("class")).toContain("text-success");+ expect(check!.getAttribute("class")).toContain("zoom-in-50");+ expect(check!.getAttribute("class")).toContain("motion-reduce:animate-none!");++ rerender(<CopyCheckIcon copied={false} />);+ expect(root).not.toHaveAttribute("data-copied");+ expect(container.querySelector(".icon-check")).toBeNull();+ const copy = container.querySelector(".icon-copy");+ expect(copy).not.toBeNull();+ expect(copy!.getAttribute("class")).toContain("zoom-in-50");+ expect(copy!.getAttribute("class")).toContain("motion-reduce:animate-none!");+ });+});diff --git a/packages/ui/components/common/copy-check-icon.tsx b/packages/ui/components/common/copy-check-icon.tsxnew file mode 100644index 0000000000..47a8325077--- /dev/null+++ b/packages/ui/components/common/copy-check-icon.tsx@@ -0,0 +1,58 @@+"use client";++import { useState } from "react";+import { Check, Copy } from "@multica/ui/icons";+import { cn } from "@multica/ui/lib/utils";++/**+ * Shared Copy ↔ Check micro-feedback icon. Cross-scales between the two glyphs+ * over 140ms using the shared ease-out curve and tints the check with `text-success`.+ * Only the active icon is mounted so DOM assertions on `.icon-check` stay accurate,+ * and initial mount stays static until `copied` actually flips.+ */+export function CopyCheckIcon({+ copied,+ className,+ copyClassName,+ checkClassName,+}: {+ copied: boolean;+ className?: string;+ copyClassName?: string;+ checkClassName?: string;+}) {+ const [prevCopied, setPrevCopied] = useState(copied);+ const [hasFlipped, setHasFlipped] = useState(false);++ if (prevCopied !== copied) {+ setPrevCopied(copied);+ if (!hasFlipped) setHasFlipped(true);+ }++ const enterAnimation = hasFlipped+ ? "animate-in fade-in-0 zoom-in-50 duration-[140ms] ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:animate-none!"+ : undefined;++ return (+ <span+ aria-hidden="true"+ data-slot="copy-check-icon"+ data-copied={copied ? "" : undefined}+ className={cn("relative inline-flex size-3.5 shrink-0 items-center justify-center", className)}+ >+ {copied ? (+ <Check+ key="check"+ aria-hidden="true"+ className={cn("size-full text-success", enterAnimation, checkClassName)}+ />+ ) : (+ <Copy+ key="copy"+ aria-hidden="true"+ className={cn("size-full", enterAnimation, copyClassName)}+ />+ )}+ </span>+ );+}diff --git a/packages/ui/components/ui/alert-dialog.tsx b/packages/ui/components/ui/alert-dialog.tsxindex f6da736b39..24fec6de67 100644--- a/packages/ui/components/ui/alert-dialog.tsx+++ b/packages/ui/components/ui/alert-dialog.tsx@@ -35,7 +35,7 @@ function AlertDialogOverlay({<AlertDialogPrimitive.Backdropdata-slot="alert-dialog-overlay"className={cn(- "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",+ "fixed inset-0 isolate z-50 bg-black/10 data-open:duration-[var(--dialog-enter-duration)] data-closed:duration-[var(--dialog-exit-duration)] data-open:ease-[var(--dialog-enter-easing)] data-closed:ease-[var(--dialog-exit-easing)] motion-reduce:animate-none! supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",className)}{...props}@@ -58,7 +58,7 @@ function AlertDialogContent({data-slot="alert-dialog-content"data-size={size}className={cn(- "group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-2rem)] grid-cols-1 -translate-x-1/2 -translate-y-1/2 gap-4 rounded-dialog bg-surface-raised p-4 text-popover-foreground shadow-[var(--floating-shadow)] ring-1 ring-surface-border duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",+ "group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-[calc(100%-2rem)] grid-cols-1 -translate-x-1/2 -translate-y-1/2 gap-4 rounded-dialog bg-surface-raised p-4 text-popover-foreground shadow-[var(--floating-shadow)] ring-1 ring-surface-border data-open:duration-[var(--dialog-enter-duration)] data-closed:duration-[var(--dialog-exit-duration)] data-open:ease-[var(--dialog-enter-easing)] data-closed:ease-[var(--dialog-exit-easing)] motion-reduce:animate-none! outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",className)}{...props}diff --git a/packages/ui/components/ui/collapsible.tsx b/packages/ui/components/ui/collapsible.tsxindex ca074e7d78..38894c08ee 100644--- a/packages/ui/components/ui/collapsible.tsx+++ b/packages/ui/components/ui/collapsible.tsx@@ -2,6 +2,8 @@import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible"+import { cn } from "@multica/ui/lib/utils"+function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props) {return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />}@@ -16,9 +18,19 @@ function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {)}-function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props) {+function CollapsibleContent({+ className,+ ...props+}: CollapsiblePrimitive.Panel.Props) {return (- <CollapsiblePrimitive.Panel data-slot="collapsible-content" {...props} />+ <CollapsiblePrimitive.Panel+ data-slot="collapsible-content"+ className={cn(+ "h-(--collapsible-panel-height) overflow-hidden transition-[height,opacity] duration-[180ms] ease-[cubic-bezier(0.23,1,0.32,1)] data-starting-style:h-0 data-starting-style:opacity-0 data-ending-style:h-0 data-ending-style:opacity-0 motion-reduce:transition-none",+ className+ )}+ {...props}+ />)}diff --git a/packages/ui/components/ui/context-menu.tsx b/packages/ui/components/ui/context-menu.tsxindex c243343f6b..d24958033d 100644--- a/packages/ui/components/ui/context-menu.tsx+++ b/packages/ui/components/ui/context-menu.tsx@@ -54,7 +54,7 @@ function ContextMenuContent({><ContextMenuPrimitive.Popupdata-slot="context-menu-content"- className={cn("z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-menu bg-surface-raised p-1.5 text-popover-foreground shadow-[var(--menu-shadow)] ring-1 ring-floating-border duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}+ className={cn("z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-menu bg-surface-raised p-1.5 text-popover-foreground shadow-[var(--menu-shadow)] ring-1 ring-floating-border duration-100 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:animate-none! outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}{...props}/></ContextMenuPrimitive.Positioner>diff --git a/packages/ui/components/ui/dropdown-menu.tsx b/packages/ui/components/ui/dropdown-menu.tsxindex 3c3b3dcea9..6229d954a8 100644--- a/packages/ui/components/ui/dropdown-menu.tsx+++ b/packages/ui/components/ui/dropdown-menu.tsx@@ -75,7 +75,7 @@ function DropdownMenuContent({e.stopPropagation()onClick?.(e)}}- className={cn("z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-menu bg-surface-raised p-1.5 text-popover-foreground shadow-[var(--menu-shadow)] ring-1 ring-floating-border duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95", className )}+ className={cn("z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-menu bg-surface-raised p-1.5 text-popover-foreground shadow-[var(--menu-shadow)] ring-1 ring-floating-border duration-100 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:animate-none! outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95", className )}{...props}/></MenuPrimitive.Positioner>@@ -181,7 +181,7 @@ function DropdownMenuSubContent({return (<DropdownMenuContentdata-slot="dropdown-menu-sub-content"- className={cn("w-auto min-w-[96px] rounded-menu bg-surface-raised p-1.5 text-popover-foreground shadow-[var(--menu-shadow)] ring-1 ring-floating-border duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}+ className={cn("w-auto min-w-[96px] rounded-menu bg-surface-raised p-1.5 text-popover-foreground shadow-[var(--menu-shadow)] ring-1 ring-floating-border duration-100 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:animate-none! data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}align={align}alignOffset={alignOffset}side={side}diff --git a/packages/ui/components/ui/hover-card.tsx b/packages/ui/components/ui/hover-card.tsxindex a946b24903..c801ab77f0 100644--- a/packages/ui/components/ui/hover-card.tsx+++ b/packages/ui/components/ui/hover-card.tsx@@ -68,7 +68,7 @@ function HoverCardContent({onAuxClick={stop(onAuxClick)}onDoubleClick={stop(onDoubleClick)}className={cn(- "z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-2.5 text-body text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",+ "z-50 w-64 origin-(--transform-origin) rounded-lg bg-popover p-2.5 text-body text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:animate-none! data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",className)}{...props}diff --git a/packages/ui/components/ui/popover.tsx b/packages/ui/components/ui/popover.tsxindex 45ddb064f5..506273e307 100644--- a/packages/ui/components/ui/popover.tsx+++ b/packages/ui/components/ui/popover.tsx@@ -67,7 +67,7 @@ function PopoverContent({<PopoverPrimitive.Popupdata-slot="popover-content"className={cn(- "z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-popover bg-surface-raised p-2.5 text-body text-popover-foreground shadow-[var(--menu-shadow)] ring-1 ring-floating-border outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",+ "z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-popover bg-surface-raised p-2.5 text-body text-popover-foreground shadow-[var(--menu-shadow)] ring-1 ring-floating-border outline-hidden duration-100 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:animate-none! data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",className)}{...props}diff --git a/packages/ui/components/ui/select.tsx b/packages/ui/components/ui/select.tsxindex dc0435fbfe..815b9cad6b 100644--- a/packages/ui/components/ui/select.tsx+++ b/packages/ui/components/ui/select.tsx@@ -98,7 +98,7 @@ function SelectContent({<SelectPrimitive.Popupdata-slot="select-content"data-align-trigger={alignItemWithTrigger}- className={cn("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-menu bg-surface-raised text-popover-foreground shadow-[var(--menu-shadow)] ring-1 ring-floating-border duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}+ className={cn("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-menu bg-surface-raised text-popover-foreground shadow-[var(--menu-shadow)] ring-1 ring-floating-border duration-100 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:animate-none! data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}{...props}><SelectScrollUpButton />diff --git a/packages/ui/components/ui/sheet.tsx b/packages/ui/components/ui/sheet.tsxindex 83adf1d5df..1868bea6a2 100644--- a/packages/ui/components/ui/sheet.tsx+++ b/packages/ui/components/ui/sheet.tsx@@ -34,7 +34,7 @@ function SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {<SheetPrimitive.Backdropdata-slot="sheet-overlay"className={cn(- "fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",+ "fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",className)}{...props}@@ -62,7 +62,7 @@ function SheetContent({data-slot="sheet-content"data-side={side}className={cn(- "fixed z-50 flex flex-col gap-4 border-surface-border bg-surface-raised bg-clip-padding text-body text-popover-foreground shadow-[var(--floating-shadow)] transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:right-[env(safe-area-inset-right)] data-[side=bottom]:left-[env(safe-area-inset-left)] data-[side=bottom]:bottom-[env(safe-area-inset-bottom)] data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:top-[env(safe-area-inset-top)] data-[side=left]:bottom-[env(safe-area-inset-bottom)] data-[side=left]:left-[env(safe-area-inset-left)] data-[side=left]:h-auto data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:top-[env(safe-area-inset-top)] data-[side=right]:bottom-[env(safe-area-inset-bottom)] data-[side=right]:right-[env(safe-area-inset-right)] data-[side=right]:h-auto data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:right-[env(safe-area-inset-right)] data-[side=top]:left-[env(safe-area-inset-left)] data-[side=top]:top-[env(safe-area-inset-top)] data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",+ "fixed z-50 flex flex-col gap-4 border-surface-border bg-surface-raised bg-clip-padding text-body text-popover-foreground shadow-[var(--floating-shadow)] transition-[translate,opacity] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:right-[env(safe-area-inset-right)] data-[side=bottom]:left-[env(safe-area-inset-left)] data-[side=bottom]:bottom-[env(safe-area-inset-bottom)] data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:top-[env(safe-area-inset-top)] data-[side=left]:bottom-[env(safe-area-inset-bottom)] data-[side=left]:left-[env(safe-area-inset-left)] data-[side=left]:h-auto data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:top-[env(safe-area-inset-top)] data-[side=right]:bottom-[env(safe-area-inset-bottom)] data-[side=right]:right-[env(safe-area-inset-right)] data-[side=right]:h-auto data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:right-[env(safe-area-inset-right)] data-[side=top]:left-[env(safe-area-inset-left)] data-[side=top]:top-[env(safe-area-inset-top)] data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",className)}{...props}diff --git a/packages/ui/components/ui/tabs.tsx b/packages/ui/components/ui/tabs.tsxindex 9cdd3ae0a0..ce40243b55 100644--- a/packages/ui/components/ui/tabs.tsx+++ b/packages/ui/components/ui/tabs.tsx@@ -24,7 +24,7 @@ function Tabs({}const tabsListVariants = cva(- "group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",+ "group/tabs-list relative z-0 inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants: {variant: {@@ -41,6 +41,7 @@ const tabsListVariants = cva(function TabsList({className,variant = "default",+ children,...props}: TabsPrimitive.List.Props & VariantProps<typeof tabsListVariants>) {return (@@ -49,7 +50,18 @@ function TabsList({data-variant={variant}className={cn(tabsListVariants({ variant }), className)}{...props}- />+ >+ {children}+ <TabsPrimitive.Indicator+ data-slot="tabs-indicator"+ className={cn(+ "pointer-events-none absolute z-0 transition-[translate,width,height] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none",+ variant === "line"+ ? "bg-foreground group-data-horizontal/tabs:bottom-0 group-data-horizontal/tabs:left-0 group-data-horizontal/tabs:h-0.5 group-data-horizontal/tabs:w-(--active-tab-width) group-data-horizontal/tabs:translate-x-(--active-tab-left) group-data-vertical/tabs:top-0 group-data-vertical/tabs:-right-1 group-data-vertical/tabs:h-(--active-tab-height) group-data-vertical/tabs:w-0.5 group-data-vertical/tabs:translate-y-(--active-tab-top)"+ : "top-0 left-0 h-(--active-tab-height) w-(--active-tab-width) translate-x-(--active-tab-left) translate-y-(--active-tab-top) rounded-[calc(var(--radius)-3px)] bg-background shadow-sm dark:bg-input/60",+ )}+ />+ </TabsPrimitive.List>)}@@ -58,10 +70,8 @@ function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props) {<TabsPrimitive.Tabdata-slot="tabs-trigger"className={cn(- "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-[calc(var(--radius)-3px)] border border-transparent px-1.5 py-0.5 text-body font-medium whitespace-nowrap text-muted-foreground transition-[color,background-color,border-color,box-shadow] group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",- "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",- "data-active:bg-background data-active:text-foreground dark:data-active:bg-input/60 dark:data-active:text-foreground",- "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",+ "relative z-10 inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-[calc(var(--radius)-3px)] border border-transparent px-1.5 py-0.5 text-body font-medium whitespace-nowrap text-muted-foreground transition-colors group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",+ "data-active:text-foreground dark:data-active:text-foreground",className)}{...props}diff --git a/packages/ui/components/ui/tooltip.tsx b/packages/ui/components/ui/tooltip.tsxindex e38dfb6aed..6b6b8d19a0 100644--- a/packages/ui/components/ui/tooltip.tsx+++ b/packages/ui/components/ui/tooltip.tsx@@ -101,7 +101,7 @@ function TooltipContent({<TooltipPrimitive.Popupdata-slot="tooltip-content"className={cn(- "dark z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-tooltip bg-(--tooltip-fill) px-2.5 py-1 text-caption text-tooltip-foreground shadow-(--tooltip-elevation) has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",+ "dark z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-tooltip bg-(--tooltip-fill) px-2.5 py-1 text-caption text-tooltip-foreground shadow-(--tooltip-elevation) duration-100 ease-[cubic-bezier(0.23,1,0.32,1)] has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[instant]:animate-none! motion-reduce:animate-none!",className)}{...props}diff --git a/packages/ui/docs/dialog.md b/packages/ui/docs/dialog.mdindex c755aa1435..adaa470248 100644--- a/packages/ui/docs/dialog.md+++ b/packages/ui/docs/dialog.md@@ -48,9 +48,9 @@ A role alone does not supply an accessible name, focus management or dismissal b## Motion-Popup and backdrop consume `--dialog-enter-duration`, `--dialog-exit-duration`, `--dialog-enter-easing` and `--dialog-exit-easing` from `packages/ui/styles/tokens.css`. The defaults preserve the existing 100ms/ease animation. The popup also fades and scales between 95% and 100%.+Popup and backdrop consume `--dialog-enter-duration`, `--dialog-exit-duration`, `--dialog-enter-easing` and `--dialog-exit-easing` from `packages/ui/styles/tokens.css`. The defaults use 100ms with the shared ease-out enter curve (`cubic-bezier(0.23, 1, 0.32, 1)`). The popup also fades and scales between 95% and 100%.-Changes affect shared Dialog instances on web and desktop, including compositions that use DialogContent, unless callers override the animation. They do not change Popover, Tooltip, AlertDialog or JavaScript motion constants.+Changes affect shared Dialog and AlertDialog instances on web and desktop, including compositions that use DialogContent, unless callers override the animation. They do not change Popover, Tooltip, or JavaScript motion constants.Respect `prefers-reduced-motion`: popup and backdrop animations are disabled. Open, close and replay the real component; also interrupt it with rapid open/close actions.diff --git a/packages/ui/docs/dialog.zh.md b/packages/ui/docs/dialog.zh.mdindex 909547e146..db1690804e 100644--- a/packages/ui/docs/dialog.zh.md+++ b/packages/ui/docs/dialog.zh.md@@ -46,9 +46,9 @@ Dialog 用于需要模态界面的独立操作。上下文选项使用 Popover## 动效-弹窗和遮罩读取 `packages/ui/styles/tokens.css` 中的 `--dialog-enter-duration`、`--dialog-exit-duration`、`--dialog-enter-easing` 和 `--dialog-exit-easing`。默认保持现有的 100ms/ease 动画,弹窗同时淡入淡出并在 95% 和 100% 之间缩放。+弹窗和遮罩读取 `packages/ui/styles/tokens.css` 中的 `--dialog-enter-duration`、`--dialog-exit-duration`、`--dialog-enter-easing` 和 `--dialog-exit-easing`。默认采用 100ms 与共享的 ease-out 进场曲线(`cubic-bezier(0.23, 1, 0.32, 1)`),弹窗同时淡入淡出并在 95% 和 100% 之间缩放。-参数影响网页端和桌面端的共享 Dialog,以及使用 DialogContent 的组合;调用方自行覆盖动画时除外。不影响 Popover、Tooltip、AlertDialog 和 JavaScript 动效常量。+参数影响网页端和桌面端的共享 Dialog 与 AlertDialog,以及使用 DialogContent 的组合;调用方自行覆盖动画时除外。不影响 Popover、Tooltip 和 JavaScript 动效常量。遵循系统减少动态效果设置,禁用弹窗和遮罩动画。打开、关闭和重播真实组件,也要快速交替打开与关闭,检查中断效果。diff --git a/packages/ui/lib/motion.ts b/packages/ui/lib/motion.tsindex 07f7d78c47..2ab3d9d337 100644--- a/packages/ui/lib/motion.ts+++ b/packages/ui/lib/motion.ts@@ -2,6 +2,12 @@ export const UI_EASE_OUT = [0.23, 1, 0.32, 1] as const;export const UI_EASE_IN = [0.4, 0, 1, 1] as const;export const UI_EASE_OUT_CSS = "cubic-bezier(0.23, 1, 0.32, 1)";+export const UI_INDICATOR_SPRING = {+ type: "spring",+ stiffness: 500,+ damping: 38,+} as const;+export const UI_MOTION_DURATION = {micro: 0.1,fast: 0.15,diff --git a/packages/ui/markdown/CodeBlock.tsx b/packages/ui/markdown/CodeBlock.tsxindex 6372387281..248d03bcd5 100644--- a/packages/ui/markdown/CodeBlock.tsx+++ b/packages/ui/markdown/CodeBlock.tsx@@ -1,7 +1,7 @@import * as React from 'react'import { codeToHtml, bundledLanguages, type BundledLanguage } from 'shiki'-import { Copy, Check } from "@multica/ui/icons"import { useTranslation } from "react-i18next"+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon"import { Button } from "@multica/ui/components/ui/button"import { Tooltip, TooltipTrigger, TooltipContent } from "@multica/ui/components/ui/tooltip"import { cn } from '@multica/ui/lib/utils'@@ -196,11 +196,7 @@ export function CodeBlock({className="opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground"aria-label={t(($) => $.copy_code)}>- {copied ? (- <Check className="size-3.5 text-success" />- ) : (- <Copy className="size-3.5" />- )}+ <CopyCheckIcon copied={copied} /></Button>}/>diff --git a/packages/ui/styles/tokens.css b/packages/ui/styles/tokens.cssindex dc82d7b6dc..3f056a16b0 100644--- a/packages/ui/styles/tokens.css+++ b/packages/ui/styles/tokens.css@@ -134,7 +134,7 @@/* Dialog motion, shared by popup and backdrop. */--dialog-enter-duration: 100ms;--dialog-exit-duration: 100ms;- --dialog-enter-easing: ease;+ --dialog-enter-easing: cubic-bezier(0.23, 1, 0.32, 1);--dialog-exit-easing: ease;/* Nav panel collapse, shared by the space panel and list columns. Thefirst frame also pays for the toggle's render and the page relayout, sodiff --git a/packages/views/autopilots/components/autopilot-dialog.tsx b/packages/views/autopilots/components/autopilot-dialog.tsxindex ba500ab41c..846e5d1cf4 100644--- a/packages/views/autopilots/components/autopilot-dialog.tsx+++ b/packages/views/autopilots/components/autopilot-dialog.tsx@@ -91,6 +91,7 @@ export type AutopilotDialogProps =mode: "create";open: boolean;onOpenChange: (v: boolean) => void;+ onOpenChangeComplete?: (open: boolean) => void;initial?: Partial<AutopilotInitial>;initialSchedule?: Pick<ScheduleConfig, "time" | "days">;}@@ -98,6 +99,7 @@ export type AutopilotDialogProps =mode: "edit";open: boolean;onOpenChange: (v: boolean) => void;+ onOpenChangeComplete?: (open: boolean) => void;autopilotId: string;initial: AutopilotInitial;triggers: AutopilotTrigger[];@@ -418,12 +420,16 @@ export function AutopilotDialog(props: AutopilotDialogProps) {const contentKey = isCreate ? "create" : props.autopilotId;return (- <Dialog open={open} onOpenChange={onOpenChange}>+ <Dialog+ open={open}+ onOpenChange={onOpenChange}+ onOpenChangeComplete={props.onOpenChangeComplete}+ ><DialogContentshowCloseButton={false}className={cn("p-0 gap-0 flex flex-col overflow-hidden",- "!transition-all !duration-300 !ease-out !-translate-y-1/2",+ "[transition-property:width,max-width,height] [transition-duration:200ms] [transition-timing-function:cubic-bezier(0.23,1,0.32,1)] motion-reduce:[transition-duration:0ms] !-translate-y-1/2","!w-[calc(100%-2rem)]",isExpanded? "!max-w-6xl !h-[calc(100%-4rem)]"diff --git a/packages/views/autopilots/components/webhook-deliveries-section.tsx b/packages/views/autopilots/components/webhook-deliveries-section.tsxindex 05f0f88128..045fb9cc47 100644--- a/packages/views/autopilots/components/webhook-deliveries-section.tsx+++ b/packages/views/autopilots/components/webhook-deliveries-section.tsx@@ -9,10 +9,9 @@ import {AlertTriangle,ShieldOff,RotateCw,- Copy,- Check,Webhook,} from "@multica/ui/icons";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { useQuery } from "@tanstack/react-query";import {autopilotDeliveriesOptions,@@ -540,11 +539,7 @@ function CodeBlock({ label, value }: { label: string; value: string }) {onClick={handleCopy}className="flex items-center gap-1 rounded-xs px-2 py-0.5 hover:bg-accent transition-colors">- {copied ? (- <Check className="h-3 w-3 text-emerald-500" />- ) : (- <Copy className="h-3 w-3" />- )}+ <CopyCheckIcon copied={copied} className="size-3" />{copied? t(($) => $.webhook_payload.copied_short): t(($) => $.webhook_payload.copy)}diff --git a/packages/views/autopilots/components/webhook-payload-preview.tsx b/packages/views/autopilots/components/webhook-payload-preview.tsxindex 01b9df18ba..feb78cac91 100644--- a/packages/views/autopilots/components/webhook-payload-preview.tsx+++ b/packages/views/autopilots/components/webhook-payload-preview.tsx@@ -1,7 +1,8 @@"use client";import { useState, useMemo } from "react";-import { Webhook, ChevronDown, ChevronRight, Copy, Check } from "@multica/ui/icons";+import { Webhook, ChevronDown, ChevronRight } from "@multica/ui/icons";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { toast } from "sonner";import { cn } from "@multica/ui/lib/utils";import { copyText } from "@multica/ui/lib/clipboard";@@ -116,11 +117,7 @@ export function WebhookPayloadPreview({"flex items-center gap-1 rounded-xs px-2 py-0.5 hover:bg-accent transition-colors",)}>- {copied ? (- <Check className="h-3 w-3 text-emerald-500" />- ) : (- <Copy className="h-3 w-3" />- )}+ <CopyCheckIcon copied={copied} className="size-3" />{copied? t(($) => $.webhook_payload.copied_short): t(($) => $.webhook_payload.copy)}diff --git a/packages/views/autopilots/components/webhook-url-field.tsx b/packages/views/autopilots/components/webhook-url-field.tsxindex e1f94340ba..4bf21db4df 100644--- a/packages/views/autopilots/components/webhook-url-field.tsx+++ b/packages/views/autopilots/components/webhook-url-field.tsx@@ -1,9 +1,10 @@"use client";import { useState, type ReactNode } from "react";-import { Check, Copy, Eye, EyeOff } from "@multica/ui/icons";+import { Eye, EyeOff } from "@multica/ui/icons";import { toast } from "sonner";import { maskAutopilotWebhookUrl } from "@multica/core/autopilots";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { IconButton } from "@multica/ui/components/common/icon-button";import { cn } from "@multica/ui/lib/utils";import { copyText } from "@multica/ui/lib/clipboard";@@ -113,11 +114,7 @@ export function WebhookUrlField({ url, size = "sm", actions }: WebhookUrlFieldPronClick={handleCopy}label={t(($) => $.trigger_row.copy_url)}>- {copied ? (- <Check className={cn(s.icon, "text-emerald-500")} />- ) : (- <Copy className={cn(s.icon, "text-muted-foreground")} />- )}+ <CopyCheckIcon copied={copied} className={s.icon} copyClassName="text-muted-foreground" /></IconButton>{actions}</div>diff --git a/packages/views/chat/components/chat-message-list.tsx b/packages/views/chat/components/chat-message-list.tsxindex 980b24b7dd..59e25951f6 100644--- a/packages/views/chat/components/chat-message-list.tsx+++ b/packages/views/chat/components/chat-message-list.tsx@@ -19,14 +19,13 @@ import {} from "@multica/ui/components/ui/tooltip";import {ChevronRight,- ChevronDown,Brain,AlertCircle,AlertTriangle,ArrowUpRight,- Copy,RotateCw,} from "@multica/ui/icons";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { useScrollFade } from "@multica/ui/hooks/use-scroll-fade";import { useReducedMotion } from "@multica/core/appearance";import { isTaskMessageTaskId, taskMessagesOptions } from "@multica/core/chat/queries";@@ -1034,8 +1033,20 @@ function MessageCopyButton({content: string;}) {const { t } = useT("chat");+ const [copied, setCopied] = useState(false);+ const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);++ useEffect(() => {+ return () => {+ if (timerRef.current) clearTimeout(timerRef.current);+ };+ }, []);+const handleCopy = async () => {if (await copyText(content)) {+ setCopied(true);+ if (timerRef.current) clearTimeout(timerRef.current);+ timerRef.current = setTimeout(() => setCopied(false), 2000);toast.success(t(($) => $.message_list.copied_toast));} else {toast.error(t(($) => $.message_list.copy_failed_toast));@@ -1054,7 +1065,7 @@ function MessageCopyButton({/>}>- <Copy />+ <CopyCheckIcon copied={copied} /></TooltipTrigger><TooltipContent side="top">{t(($) => $.message_list.copy_action)}@@ -1177,11 +1188,12 @@ function FailureBubble({{rawError.trim() && (<Collapsible open={open} onOpenChange={setOpen}><CollapsibleTrigger className="mt-0.5 flex items-center gap-1 text-caption text-muted-foreground hover:text-foreground transition-colors">- {open ? (- <ChevronDown className="size-3" />- ) : (- <ChevronRight className="size-3" />- )}+ <ChevronRight+ className={cn(+ "size-3 shrink-0 transition-transform duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none",+ open && "rotate-90",+ )}+ /><span>{t(($) => $.message_list.show_details)}</span></CollapsibleTrigger><CollapsibleContent>@@ -1330,7 +1342,12 @@ function OuterProcessFold({return (<Collapsible open={open} onOpenChange={setOpen}><CollapsibleTrigger className="flex items-center gap-1 text-caption text-muted-foreground hover:text-foreground transition-colors">- {open ? <ChevronDown className="size-3" /> : <ChevronRight className="size-3" />}+ <ChevronRight+ className={cn(+ "size-3 shrink-0 transition-transform duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none",+ open && "rotate-90",+ )}+ /><span>{t(($) => $.message_list.process_steps, { count: displayedStepCount })}</span></CollapsibleTrigger><CollapsibleContent>@@ -1412,7 +1429,7 @@ function ToolCallRow({ item }: { item: ChatTimelineItem }) {<CollapsibleTrigger className="flex w-full items-center gap-1.5 rounded-xs px-1 -mx-1 py-0.5 text-caption hover:bg-accent/30 transition-colors"><ChevronRightclassName={cn(- "h-3 w-3 shrink-0 text-muted-foreground transition-transform",+ "h-3 w-3 shrink-0 text-muted-foreground transition-transform duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none",open && "rotate-90",!hasInput && "invisible",)}@@ -1456,7 +1473,10 @@ function ToolResultRow({ item }: { item: ChatTimelineItem }) {<Collapsible open={open} onOpenChange={setOpen}><CollapsibleTrigger className="flex w-full items-start gap-1.5 rounded-xs px-1 -mx-1 py-0.5 text-caption hover:bg-accent/30 transition-colors"><ChevronRight- className={cn("h-3 w-3 shrink-0 text-muted-foreground transition-transform mt-0.5", open && "rotate-90")}+ className={cn(+ "h-3 w-3 shrink-0 text-muted-foreground transition-transform duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none mt-0.5",+ open && "rotate-90",+ )}/><span className="text-muted-foreground truncate">{labelPrefix}{preview}diff --git a/packages/views/chat/components/chat-queue.tsx b/packages/views/chat/components/chat-queue.tsxindex 7172b6786a..32bb982cb9 100644--- a/packages/views/chat/components/chat-queue.tsx+++ b/packages/views/chat/components/chat-queue.tsx@@ -1,6 +1,7 @@"use client";import { useState } from "react";+import { AnimatePresence, motion } from "motion/react";import {CornerDownRight,Ellipsis,@@ -9,6 +10,7 @@ import {Pencil,Trash2,} from "@multica/ui/icons";+import { useReducedMotion } from "@multica/core/appearance";import type { ChatQueuedTask, ChatWakeup } from "@multica/core/types";import { Button } from "@multica/ui/components/ui/button";import { IconButton } from "@multica/ui/components/common/icon-button";@@ -19,6 +21,7 @@ import {DropdownMenuSeparator,DropdownMenuTrigger,} from "@multica/ui/components/ui/dropdown-menu";+import { UI_EASE_OUT, UI_MOTION_DURATION } from "@multica/ui/lib/motion";import { cn } from "@multica/ui/lib/utils";import { useT } from "../../i18n";import { CHAT_COLUMN, CHAT_GUTTER } from "./chat-column";@@ -49,6 +52,7 @@ export function ChatQueue({onClear,}: ChatQueueProps) {const { t } = useT("chat");+ const prefersReducedMotion = useReducedMotion();const [busyAction, setBusyAction] = useState<string | null>(null);const dispatchableHead =headStatus === "dispatched" ||@@ -66,8 +70,6 @@ export function ChatQueue({: $.queue.steer_unavailable,);- if (tasks.length === 0) return null;-const queuedLabel = (task: ChatQueuedTask) => {if (task.wakeup_id) {const title = wakeups?.find((w) => w.id === task.wakeup_id)?.title;@@ -87,140 +89,154 @@ export function ChatQueue({}};+ const shellTransition = prefersReducedMotion+ ? { duration: 0 }+ : { duration: UI_MOTION_DURATION.standard, ease: UI_EASE_OUT };+return (- <div- data-slot="chat-queue-shell"- // Tucked under the composer: the negative margin slides this card's- // bottom edge behind the (opaque, always z-10) composer surface, so the- // queue reads as emerging from behind the input. z-0 keeps it there even- // while the entrance animation's opacity/transform spawns a stacking- // context. The composer's own chrome never changes.- className={cn(CHAT_GUTTER, "relative z-0 -mb-3")}- aria-live="polite"- aria-busy={busyAction !== null}- >- <div className={CHAT_COLUMN}>- <section- data-slot="chat-queue"- aria-label={t(($) => $.queue.title, { count: tasks.length })}- className={cn(- // Quiet secondary surface: border only, no shadow, so the composer- // below stays the visually dominant card. pb-4 = the 12px hidden- // behind the composer plus a visible 4px breathing room above it.- // mx-3 pulls the rear card in from the composer's edges so the- // stack reads as two distinct layers.- "mx-3 overflow-hidden rounded-lg border border-surface-border bg-surface pb-4",- "animate-in fade-in slide-in-from-bottom-2 duration-300",- )}+ <AnimatePresence>+ {tasks.length > 0 && (+ <motion.div+ key="chat-queue-shell"+ data-slot="chat-queue-shell"+ // Tucked under the composer: the negative margin slides this card's+ // bottom edge behind the (opaque, always z-10) composer surface, so the+ // queue reads as emerging from behind the input. z-0 keeps it there even+ // while the entrance animation's opacity/transform spawns a stacking+ // context. The composer's own chrome never changes.+ initial={{ opacity: 0, y: prefersReducedMotion ? 0 : 8 }}+ animate={{ opacity: 1, y: 0 }}+ exit={{ opacity: 0, y: prefersReducedMotion ? 0 : 8 }}+ transition={shellTransition}+ className={cn(CHAT_GUTTER, "relative z-0 -mb-3")}+ aria-live="polite"+ aria-busy={busyAction !== null}>- <div- data-slot="chat-queue-list"- className="max-h-40 overflow-y-auto px-2 py-1"- >- {tasks.map((task) => {- const sendNowKey = `send-now:${task.task_id}`;- const editKey = `edit:${task.task_id}`;- const removeKey = `remove:${task.task_id}`;- const clearKey = `clear:${task.task_id}`;- return (- <div- key={task.task_id}- data-slot="chat-queue-row"- className="flex min-h-7 min-w-0 items-center gap-2 rounded-md px-1.5 py-0.5 text-caption animate-in fade-in duration-200"- >- <ListEnd- data-slot="chat-queue-item-icon"- className="size-3.5 shrink-0 text-faint-foreground"- aria-hidden="true"- />- <span className="min-w-0 flex-1 truncate text-muted-foreground">- {queuedLabel(task)}- </span>- <div className="flex shrink-0 items-center gap-0.5">- <span- className="shrink-0"- title={sendNowLabel}- >- <Button- variant="ghost"- size="xs"- className="px-1.5 font-normal text-muted-foreground"- disabled={busyAction !== null || !canSendNow}- aria-label={sendNowLabel}- onClick={() => void run(sendNowKey, () => onSendNow(task.task_id))}+ <div className={CHAT_COLUMN}>+ <section+ data-slot="chat-queue"+ aria-label={t(($) => $.queue.title, { count: tasks.length })}+ className="mx-3 overflow-hidden rounded-lg border border-surface-border bg-surface pb-4"+ >+ <div+ data-slot="chat-queue-list"+ className="max-h-40 overflow-y-auto px-2 py-1"+ >+ <AnimatePresence initial={false}>+ {tasks.map((task) => {+ const sendNowKey = `send-now:${task.task_id}`;+ const editKey = `edit:${task.task_id}`;+ const removeKey = `remove:${task.task_id}`;+ const clearKey = `clear:${task.task_id}`;+ return (+ <motion.div+ key={task.task_id}+ data-slot="chat-queue-row"+ initial={{ opacity: 0 }}+ animate={{ opacity: 1 }}+ exit={{ opacity: 0 }}+ transition={{+ duration: prefersReducedMotion ? 0 : UI_MOTION_DURATION.fast,+ ease: UI_EASE_OUT,+ }}+ className="flex min-h-7 min-w-0 items-center gap-2 rounded-md px-1.5 py-0.5 text-caption">- {busyAction === sendNowKey ? (- <Loader2 className="animate-spin" aria-hidden="true" />- ) : (- <CornerDownRight aria-hidden="true" />- )}- {t(($) => $.queue.steer)}- </Button>- </span>- <IconButton- variant="ghost"- size="icon-xs"- className="shrink-0 text-muted-foreground"- disabled={busyAction !== null}- label={t(($) => $.queue.remove)}- onClick={() => void run(removeKey, () => onRemove(task.task_id))}- >- {busyAction === removeKey ? (- <Loader2 className="animate-spin" aria-hidden="true" />- ) : (- <Trash2 aria-hidden="true" />- )}- </IconButton>- <DropdownMenu>- <DropdownMenuTrigger- render={+ <ListEnd+ data-slot="chat-queue-item-icon"+ className="size-3.5 shrink-0 text-faint-foreground"+ aria-hidden="true"+ />+ <span className="min-w-0 flex-1 truncate text-muted-foreground">+ {queuedLabel(task)}+ </span>+ <div className="flex shrink-0 items-center gap-0.5">+ <span+ className="shrink-0"+ title={sendNowLabel}+ >+ <Button+ variant="ghost"+ size="xs"+ className="px-1.5 font-normal text-muted-foreground"+ disabled={busyAction !== null || !canSendNow}+ aria-label={sendNowLabel}+ onClick={() => void run(sendNowKey, () => onSendNow(task.task_id))}+ >+ {busyAction === sendNowKey ? (+ <Loader2 className="animate-spin" aria-hidden="true" />+ ) : (+ <CornerDownRight aria-hidden="true" />+ )}+ {t(($) => $.queue.steer)}+ </Button>+ </span><IconButton- type="button"variant="ghost"size="icon-xs"className="shrink-0 text-muted-foreground"disabled={busyAction !== null}- label={t(($) => $.queue.more)}- />- }- >- {busyAction === editKey || busyAction === clearKey ? (- <Loader2 className="animate-spin" aria-hidden="true" />- ) : (- <Ellipsis aria-hidden="true" />- )}- </DropdownMenuTrigger>- <DropdownMenuContent- align="end"- side="top"- sideOffset={6}- className="w-auto"- >- <DropdownMenuItem- disabled={busyAction !== null}- onClick={() => void run(editKey, () => onEdit(task.task_id))}- >- <Pencil aria-hidden="true" />- {t(($) => $.queue.edit)}- </DropdownMenuItem>- <DropdownMenuSeparator />- <DropdownMenuItem- variant="destructive"- disabled={busyAction !== null}- onClick={() => void run(clearKey, onClear)}- >- <Trash2 aria-hidden="true" />- {t(($) => $.queue.clear)}- </DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>- </div>- </div>- );- })}+ label={t(($) => $.queue.remove)}+ onClick={() => void run(removeKey, () => onRemove(task.task_id))}+ >+ {busyAction === removeKey ? (+ <Loader2 className="animate-spin" aria-hidden="true" />+ ) : (+ <Trash2 aria-hidden="true" />+ )}+ </IconButton>+ <DropdownMenu>+ <DropdownMenuTrigger+ render={+ <IconButton+ type="button"+ variant="ghost"+ size="icon-xs"+ className="shrink-0 text-muted-foreground"+ disabled={busyAction !== null}+ label={t(($) => $.queue.more)}+ />+ }+ >+ {busyAction === editKey || busyAction === clearKey ? (+ <Loader2 className="animate-spin" aria-hidden="true" />+ ) : (+ <Ellipsis aria-hidden="true" />+ )}+ </DropdownMenuTrigger>+ <DropdownMenuContent+ align="end"+ side="top"+ sideOffset={6}+ className="w-auto"+ >+ <DropdownMenuItem+ disabled={busyAction !== null}+ onClick={() => void run(editKey, () => onEdit(task.task_id))}+ >+ <Pencil aria-hidden="true" />+ {t(($) => $.queue.edit)}+ </DropdownMenuItem>+ <DropdownMenuSeparator />+ <DropdownMenuItem+ variant="destructive"+ disabled={busyAction !== null}+ onClick={() => void run(clearKey, onClear)}+ >+ <Trash2 aria-hidden="true" />+ {t(($) => $.queue.clear)}+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ </div>+ </motion.div>+ );+ })}+ </AnimatePresence>+ </div>+ </section></div>- </section>- </div>- </div>+ </motion.div>+ )}+ </AnimatePresence>);}diff --git a/packages/views/chat/components/chat-window-messages.tsx b/packages/views/chat/components/chat-window-messages.tsxindex e8b16bc0ee..720709f01d 100644--- a/packages/views/chat/components/chat-window-messages.tsx+++ b/packages/views/chat/components/chat-window-messages.tsx@@ -3,6 +3,7 @@import { useEffect, type ComponentProps, type ReactNode } from "react";import { useInfiniteQuery } from "@tanstack/react-query";import { motion, useIsPresent } from "motion/react";+import { useReducedMotion } from "@multica/core/appearance";import type { AgentAvailability } from "@multica/core/agents";import type { ChatPendingTask, ChatQuickAction } from "@multica/core/types";import { chatMessagesPageOptions } from "@multica/core/chat/queries";@@ -39,6 +40,7 @@ export function ChatWindowMessages({children: ReactNode;}) {const isPresent = useIsPresent();+ const prefersReducedMotion = useReducedMotion();const wakeups = useChatWakeups(sessionId);const regenerateQuickActions = useRegenerateChatQuickActions();const {@@ -73,7 +75,7 @@ export function ChatWindowMessages({initial={false}animate={{ opacity: 1 }}exit={{ opacity: 0 }}- transition={{ duration: 0.15 }}+ transition={{ duration: prefersReducedMotion ? 0 : 0.15 }}>{showSkeleton ? (<ChatMessageSkeleton />diff --git a/packages/views/common/motion-provider.tsx b/packages/views/common/motion-provider.tsxnew file mode 100644index 0000000000..d7262ccc40--- /dev/null+++ b/packages/views/common/motion-provider.tsx@@ -0,0 +1,19 @@+"use client";++import type { ReactNode } from "react";+import { MotionConfig } from "motion/react";+import { useAppearanceStore } from "@multica/core/appearance";++/**+ * Root motion configuration for Web and Desktop apps.+ * Ensures all `motion/react` animations honor both OS `prefers-reduced-motion`+ * and the in-app Appearance "Reduce motion" toggle.+ */+export function MotionProvider({ children }: { children: ReactNode }) {+ const reduceMotion = useAppearanceStore((s) => s.reduceMotion);+ return (+ <MotionConfig reducedMotion={reduceMotion ? "always" : "user"}>+ {children}+ </MotionConfig>+ );+}diff --git a/packages/views/common/segmented-toggle.tsx b/packages/views/common/segmented-toggle.tsxindex c473a6fee4..8a933a40ce 100644--- a/packages/views/common/segmented-toggle.tsx+++ b/packages/views/common/segmented-toggle.tsx@@ -1,6 +1,9 @@"use client";-import type { ReactNode } from "react";+import { useId, type ReactNode } from "react";+import { motion } from "motion/react";+import { useReducedMotion } from "@multica/core/appearance";+import { UI_INDICATOR_SPRING } from "@multica/ui/lib/motion";import { cn } from "@multica/ui/lib/utils";/** A pill-button group for picking between mutually exclusive modes: the active@@ -19,27 +22,45 @@ export function SegmentedToggle<T extends string>({/** Overrides the compact default sizing (text-caption px-2 py-1). */buttonClassName?: string;}) {+ const indicatorId = useId();+ const prefersReducedMotion = useReducedMotion();+ const transition = prefersReducedMotion ? { duration: 0 } : UI_INDICATOR_SPRING;+return (<div className="grid auto-cols-fr grid-flow-col gap-1 rounded-md bg-muted p-1">- {options.map(([key, label]) => (- <button- key={key}- type="button"- aria-pressed={value === key}- onClick={() => {- if (key !== value) onChange(key);- }}- className={cn(- "rounded-sm font-medium transition-colors",- buttonClassName ?? "px-2 py-1 text-caption",- value === key- ? "bg-background text-foreground shadow-sm"- : "text-muted-foreground hover:text-foreground",- )}- >- {label}- </button>- ))}+ {options.map(([key, label]) => {+ const active = value === key;+ return (+ <button+ key={key}+ type="button"+ aria-pressed={active}+ onClick={() => {+ if (key !== value) onChange(key);+ }}+ className={cn(+ "relative rounded-sm font-medium transition-colors",+ buttonClassName ?? "px-2 py-1 text-caption",+ active+ ? "text-foreground"+ : "text-muted-foreground hover:text-foreground",+ )}+ >+ {active && (+ <motion.span+ layoutId={indicatorId}+ transition={transition}+ aria-hidden="true"+ data-slot="segmented-toggle-indicator"+ className="pointer-events-none absolute inset-0 rounded-sm bg-background shadow-sm"+ />+ )}+ <span className="relative z-10 inline-flex items-center justify-center gap-1.5">+ {label}+ </span>+ </button>+ );+ })}</div>);}diff --git a/packages/views/common/task-transcript/agent-transcript-dialog.tsx b/packages/views/common/task-transcript/agent-transcript-dialog.tsxindex 94707f2e35..4bc9b1ff0c 100644--- a/packages/views/common/task-transcript/agent-transcript-dialog.tsx+++ b/packages/views/common/task-transcript/agent-transcript-dialog.tsx@@ -12,8 +12,6 @@ import {XCircle,X,Loader2,- Copy,- Check,ChevronRight,Filter,FilePen,@@ -31,6 +29,7 @@ import {import { cn } from "@multica/ui/lib/utils";import { copyText } from "@multica/ui/lib/clipboard";import { Button } from "@multica/ui/components/ui/button";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { IconButton } from "@multica/ui/components/common/icon-button";import { Dialog, DialogContent, DialogTitle } from "@multica/ui/components/ui/dialog";import { Popover, PopoverContent, PopoverTrigger } from "@multica/ui/components/ui/popover";@@ -256,11 +255,11 @@ function RunDetailRow({<span className="text-muted-foreground">{label}</span><span className="flex min-w-0 items-start gap-1.5"><span className={cn(valueClass, "flex-1")}>{value}</span>- {copied ? (- <Check className="mt-0.5 h-3 w-3 shrink-0 text-success" />- ) : (- <Copy className="mt-0.5 h-3 w-3 shrink-0 opacity-0 transition-opacity group-hover:opacity-100" />- )}+ <CopyCheckIcon+ copied={Boolean(copied)}+ className="mt-0.5 h-3 w-3 shrink-0"+ copyClassName="opacity-0 group-hover:opacity-100"+ /></span></button></TooltipHint>@@ -1223,7 +1222,7 @@ export function AgentTranscriptDialog({: t(($) => $.transcript.sort_chronological)}</DropdownMenuItem><DropdownMenuItem onClick={handleCopyAll}>- {copied ? <Check className="h-3.5 w-3.5" /> : <Copy className="h-3.5 w-3.5" />}+ <CopyCheckIcon copied={copied} />{copyTranscriptLabel}</DropdownMenuItem></DropdownMenuContent>@@ -1633,7 +1632,7 @@ function GroupRow({<ChevronRightaria-hiddenclassName={cn(- "mt-1 h-3 w-3 shrink-0 text-faint-foreground transition-transform",+ "mt-1 h-3 w-3 shrink-0 text-faint-foreground transition-transform duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none",expanded && "rotate-90",)}/>@@ -1781,7 +1780,7 @@ function StepInspector({tooltipSide="bottom"className="shrink-0 text-muted-foreground">- {copied ? <Check className="h-3.5 w-3.5" /> : <Copy className="h-3.5 w-3.5" />}+ <CopyCheckIcon copied={copied} /></IconButton><IconButtonvariant="ghost"diff --git a/packages/views/dashboard/components/dashboard-page.tsx b/packages/views/dashboard/components/dashboard-page.tsxindex b217aaed67..f59c6b30c2 100644--- a/packages/views/dashboard/components/dashboard-page.tsx+++ b/packages/views/dashboard/components/dashboard-page.tsx@@ -542,13 +542,13 @@ export function DashboardPage() {<TabsList variant="line" className="shrink-0 gap-0 p-0 group-data-horizontal/tabs:h-full"><TabsTriggervalue="usage"- className="h-full rounded-none px-2.5 group-data-horizontal/tabs:after:bottom-0"+ className="h-full rounded-none px-2.5">{t(($) => $.tab_usage)}</TabsTrigger><TabsTriggervalue="errors"- className="h-full rounded-none px-2.5 group-data-horizontal/tabs:after:bottom-0"+ className="h-full rounded-none px-2.5">{t(($) => $.errors.title)}</TabsTrigger>diff --git a/packages/views/dashboard/components/dashboard-shared.tsx b/packages/views/dashboard/components/dashboard-shared.tsxindex a56b4cbdba..fdb52886f2 100644--- a/packages/views/dashboard/components/dashboard-shared.tsx+++ b/packages/views/dashboard/components/dashboard-shared.tsx@@ -1,5 +1,9 @@"use client";+import { useId } from "react";+import { motion } from "motion/react";+import { useReducedMotion } from "@multica/core/appearance";+import { UI_INDICATOR_SPRING } from "@multica/ui/lib/motion";import {NumberFlow,NumberFlowGroup,@@ -83,27 +87,43 @@ export function Segmented<T extends string | number>({options: readonly { label: string; value: T }[];label: string;}) {+ const indicatorId = useId();+ const prefersReducedMotion = useReducedMotion();+ const transition = prefersReducedMotion ? { duration: 0 } : UI_INDICATOR_SPRING;+return (<divrole="group"aria-label={label}className="inline-flex items-center gap-0.5 rounded-md bg-muted p-0.5">- {options.map((o) => (- <button- key={String(o.value)}- type="button"- aria-pressed={o.value === value}- onClick={() => onChange(o.value)}- className={`rounded-sm px-2.5 py-1 text-caption font-medium transition-colors ${- o.value === value- ? "bg-background text-foreground shadow-sm"- : "text-muted-foreground hover:text-foreground"- }`}- >- {o.label}- </button>- ))}+ {options.map((o) => {+ const active = o.value === value;+ return (+ <button+ key={String(o.value)}+ type="button"+ aria-pressed={active}+ onClick={() => onChange(o.value)}+ className={`relative rounded-sm px-2.5 py-1 text-caption font-medium transition-colors ${+ active+ ? "text-foreground"+ : "text-muted-foreground hover:text-foreground"+ }`}+ >+ {active && (+ <motion.span+ layoutId={indicatorId}+ transition={transition}+ aria-hidden="true"+ data-slot="segmented-indicator"+ className="pointer-events-none absolute inset-0 rounded-sm bg-background shadow-sm"+ />+ )}+ <span className="relative z-10">{o.label}</span>+ </button>+ );+ })}</div>);}diff --git a/packages/views/editor/dynamic-block.tsx b/packages/views/editor/dynamic-block.tsxindex c7430835dd..02f95073dd 100644--- a/packages/views/editor/dynamic-block.tsx+++ b/packages/views/editor/dynamic-block.tsx@@ -30,16 +30,15 @@ import {} from "react";import {AppWindow,- Check,ChevronDown,CodeXml,- Copy,Maximize2,RotateCw,TriangleAlert,Workflow,} from "@multica/ui/icons";import { Button } from "@multica/ui/components/ui/button";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { IconButton } from "@multica/ui/components/common/icon-button";import { Tabs, TabsContent, TabsList, TabsTrigger } from "@multica/ui/components/ui/tabs";import { TooltipHint } from "@multica/ui/components/common/tooltip-hint";@@ -322,7 +321,7 @@ export function DynamicBlock({onClick={handleCopy}label={t(($) => $.dynamic_block.copy_source)}>- {copied ? <Check /> : <Copy />}+ <CopyCheckIcon copied={copied} /></IconButton></div></div>@@ -598,7 +597,7 @@ function DynamicBlockErrorPanel({{t(($) => $.dynamic_block.view_source)}</Button><Button type="button" variant="outline" size="sm" onClick={handleCopyError}>- {copied ? <Check /> : <Copy />}+ <CopyCheckIcon copied={copied} />{t(($) => $.dynamic_block.copy_error)}</Button></div>diff --git a/packages/views/editor/extensions/code-block-view.tsx b/packages/views/editor/extensions/code-block-view.tsxindex f75a63281f..905564bb0c 100644--- a/packages/views/editor/extensions/code-block-view.tsx+++ b/packages/views/editor/extensions/code-block-view.tsx@@ -4,7 +4,7 @@ import { useCallback, useEffect, useRef, useState } from "react";import { NodeViewWrapper, NodeViewContent } from "@tiptap/react";import type { NodeViewProps } from "@tiptap/react";import { NodeSelection } from "@tiptap/pm/state";-import { Copy, Check } from "@multica/ui/icons";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { TooltipHint } from "@multica/ui/components/common/tooltip-hint";import { copyText } from "@multica/ui/lib/clipboard";import { useDebouncedValue } from "../../common/use-debounced-value";@@ -151,11 +151,7 @@ function PlainCodeBlockView({ node }: NodeViewProps) {className="flex h-6 w-6 items-center justify-center rounded-xs text-muted-foreground hover:bg-muted hover:text-foreground transition-colors"aria-label={t(($) => $.code_block.copy_code)}>- {copied ? (- <Check className="h-3.5 w-3.5" />- ) : (- <Copy className="h-3.5 w-3.5" />- )}+ <CopyCheckIcon copied={copied} /></button></TooltipHint></div>diff --git a/packages/views/editor/mermaid-diagram.tsx b/packages/views/editor/mermaid-diagram.tsxindex 2a42a8506e..7de2ed6991 100644--- a/packages/views/editor/mermaid-diagram.tsx+++ b/packages/views/editor/mermaid-diagram.tsx@@ -39,7 +39,8 @@ import {type CSSProperties,type RefObject,} from "react";-import { Check, Copy, Frame, Maximize2, Minus, Plus } from "@multica/ui/icons";+import { Frame, Maximize2, Minus, Plus } from "@multica/ui/icons";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { copyText } from "@multica/ui/lib/clipboard";import { TooltipHint } from "@multica/ui/components/common/tooltip-hint";import { useT } from "../i18n";@@ -529,7 +530,7 @@ export function MermaidDiagram({onClick={handleCopySource}aria-label={t(($) => $.mermaid.copy_source)}>- {copied ? <Check className="size-3.5" /> : <Copy className="size-3.5" />}+ <CopyCheckIcon copied={copied} /></button></TooltipHint></div>@@ -604,7 +605,7 @@ export function MermaidDiagram({onClick={handleCopySource}aria-label={t(($) => $.mermaid.copy_source)}>- {copied ? <Check className="size-3.5" /> : <Copy className="size-3.5" />}+ <CopyCheckIcon copied={copied} /></button></TooltipHint><TooltipHint label={t(($) => $.mermaid.open_viewer)}>diff --git a/packages/views/editor/mermaid-viewer.tsx b/packages/views/editor/mermaid-viewer.tsxindex c4aaeef4fd..728bb45361 100644--- a/packages/views/editor/mermaid-viewer.tsx+++ b/packages/views/editor/mermaid-viewer.tsx@@ -17,13 +17,12 @@import { useCallback, useMemo, useRef, useState } from "react";import {- Check,Code as CodeIcon,- Copy,Download,Image as ImageIcon,X,} from "@multica/ui/icons";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { cn } from "@multica/ui/lib/utils";import { copyText } from "@multica/ui/lib/clipboard";import { Dialog, DialogContent, DialogTitle } from "@multica/ui/components/ui/dialog";@@ -225,7 +224,7 @@ function MermaidViewerContent({onClick={handleCopySource}label={t(($) => $.mermaid.copy_source)}>- {copied ? <Check className="size-4" /> : <Copy className="size-4" />}+ <CopyCheckIcon copied={copied} className="size-4" /></ToolbarButton><DropdownMenu><TooltipHint label={t(($) => $.mermaid.export)} side="bottom">diff --git a/packages/views/inbox/components/inbox-delete-dialog.tsx b/packages/views/inbox/components/inbox-delete-dialog.tsxindex 592c80f103..b9be376994 100644--- a/packages/views/inbox/components/inbox-delete-dialog.tsx+++ b/packages/views/inbox/components/inbox-delete-dialog.tsx@@ -17,15 +17,19 @@ import { useT } from "../../i18n";import type { InboxView } from "./inbox-view";export function InboxDeleteDialog({+ open = true,item,view,onClose,onDeleted,+ onOpenChangeComplete,}: {+ open?: boolean;item: InboxItem;view: InboxView;onClose: () => void;onDeleted: (id: string) => void;+ onOpenChangeComplete?: (open: boolean) => void;}) {const { t } = useT("inbox");const mutation = useDeleteInbox();@@ -44,10 +48,11 @@ export function InboxDeleteDialog({return (<AlertDialog- open- onOpenChange={(open) => {- if (!open && !mutation.isPending) onClose();+ open={open}+ onOpenChange={(nextOpen) => {+ if (!nextOpen && !mutation.isPending) onClose();}}+ onOpenChangeComplete={onOpenChangeComplete}><AlertDialogContent><AlertDialogHeader>diff --git a/packages/views/inbox/components/inbox-page.tsx b/packages/views/inbox/components/inbox-page.tsxindex 09169ad0b7..39ce8ebc1a 100644--- a/packages/views/inbox/components/inbox-page.tsx+++ b/packages/views/inbox/components/inbox-page.tsx@@ -422,6 +422,11 @@ export function InboxPage() {const markReadMutation = useMarkInboxRead();const [deleteTarget, setDeleteTarget] = useState<InboxItem | null>(null);+ const [retainedDeleteTarget, setRetainedDeleteTarget] = useState<InboxItem | null>(null);+ if (deleteTarget !== null && retainedDeleteTarget?.id !== deleteTarget.id) {+ setRetainedDeleteTarget(deleteTarget);+ }+ const activeDeleteTarget = deleteTarget ?? retainedDeleteTarget;const markUnreadMutation = useMarkInboxUnread();const archiveWithUndo = useArchiveInboxWithUndo();const archiveBatchWithUndo = useArchiveInboxBatchWithUndo();@@ -927,12 +932,20 @@ export function InboxPage() {) : undefined}/>- {deleteTarget && (+ {activeDeleteTarget && (<InboxDeleteDialog- key={deleteTarget.id}- item={deleteTarget}+ key={activeDeleteTarget.id}+ open={deleteTarget !== null}+ item={activeDeleteTarget}view={view}onClose={() => setDeleteTarget(null)}+ onOpenChangeComplete={(nextOpen) => {+ if (!nextOpen) {+ setRetainedDeleteTarget((prev) =>+ prev?.id === activeDeleteTarget.id ? null : prev,+ );+ }+ }}onDeleted={(id) => {advanceSelectionPast(id, listedItems);toast.success(t(($) => $.toasts.deleted));diff --git a/packages/views/issues/components/issues-header.tsx b/packages/views/issues/components/issues-header.tsxindex e427718db4..8d09ad47d8 100644--- a/packages/views/issues/components/issues-header.tsx+++ b/packages/views/issues/components/issues-header.tsx@@ -1,6 +1,9 @@"use client";-import { cloneElement, useEffect, useMemo, useRef, useState } from "react";+import { cloneElement, useEffect, useId, useMemo, useRef, useState } from "react";+import { motion } from "motion/react";+import { useReducedMotion } from "@multica/core/appearance";+import { UI_INDICATOR_SPRING } from "@multica/ui/lib/motion";import {Activity,BotOff,@@ -2050,6 +2053,9 @@ export function IssueDisplayControls({: effectiveTableGrouping === "project"? t(($) => $.table.columns.project): t(($) => $.table.group_none);+ const viewToggleIndicatorId = useId();+ const prefersReducedMotion = useReducedMotion();+ const viewToggleTransition = prefersReducedMotion ? { duration: 0 } : UI_INDICATOR_SPRING;// A Gantt layout persisted on a surface without Gantt renders as List.const layout: ViewMode = viewMode === "gantt" && !allowGantt ? "list" : viewMode;const layouts = LAYOUTS.filter(({ mode }) => mode !== "gantt" || allowGantt);@@ -2139,18 +2145,30 @@ export function IssueDisplayControls({layouts.length === 5 ? "grid-cols-5" : "grid-cols-4",)}>- {layouts.map(({ mode, Icon }) => (- <Toggle- key={mode}- pressed={layout === mode}- onPressedChange={() => act.setViewMode(mode)}- title={t(($) => $.view[mode])}- className="h-auto min-w-0 flex-col gap-1 rounded-md px-0.5 py-1.5 text-caption font-normal text-muted-foreground hover:bg-transparent hover:text-foreground aria-pressed:bg-background aria-pressed:text-foreground aria-pressed:shadow-sm aria-pressed:hover:bg-background"- >- <Icon className="size-4" />- <span className="max-w-full truncate">{t(($) => $.view[mode])}</span>- </Toggle>- ))}+ {layouts.map(({ mode, Icon }) => {+ const active = layout === mode;+ return (+ <Toggle+ key={mode}+ pressed={active}+ onPressedChange={() => act.setViewMode(mode)}+ title={t(($) => $.view[mode])}+ className="relative h-auto min-w-0 flex-col gap-1 rounded-md px-0.5 py-1.5 text-caption font-normal text-muted-foreground hover:bg-transparent hover:text-foreground aria-pressed:bg-transparent aria-pressed:text-foreground aria-pressed:hover:bg-transparent"+ >+ {active && (+ <motion.span+ layoutId={viewToggleIndicatorId}+ transition={viewToggleTransition}+ aria-hidden="true"+ data-slot="view-toggle-indicator"+ className="pointer-events-none absolute inset-0 rounded-md bg-background shadow-sm"+ />+ )}+ <Icon className="relative z-10 size-4" />+ <span className="relative z-10 max-w-full truncate">{t(($) => $.view[mode])}</span>+ </Toggle>+ );+ })}</div>)}<div className="space-y-3">diff --git a/packages/views/issues/components/terminate-task-confirm-dialog.tsx b/packages/views/issues/components/terminate-task-confirm-dialog.tsxindex 9eee945dc0..2f0cd6715a 100644--- a/packages/views/issues/components/terminate-task-confirm-dialog.tsx+++ b/packages/views/issues/components/terminate-task-confirm-dialog.tsx@@ -26,6 +26,7 @@ import { useT } from "../../i18n";interface TerminateTaskConfirmDialogProps {open: boolean;onOpenChange: (open: boolean) => void;+ onOpenChangeComplete?: (open: boolean) => void;onConfirm: () => void;// Running tasks may take a few seconds to fully halt on the daemon// side. Queued tasks cancel immediately, so we omit the note to keep@@ -36,15 +37,18 @@ interface TerminateTaskConfirmDialogProps {export function TerminateTaskConfirmDialog({open,onOpenChange,+ onOpenChangeComplete,onConfirm,showRunningNote = false,}: TerminateTaskConfirmDialogProps) {const { t } = useT("issues");- if (!open) return null;-return (- <AlertDialog open onOpenChange={onOpenChange}>+ <AlertDialog+ open={open}+ onOpenChange={onOpenChange}+ onOpenChangeComplete={onOpenChangeComplete}+ ><AlertDialogContent// Stop clicks inside the dialog from bubbling to the row /// banner underneath (the dialog can render inside a clickablediff --git a/packages/views/modals/add-child-issue.tsx b/packages/views/modals/add-child-issue.tsxindex 4a6dd3c7fb..9b8ba2c9ff 100644--- a/packages/views/modals/add-child-issue.tsx+++ b/packages/views/modals/add-child-issue.tsx@@ -12,10 +12,14 @@ import { IssuePickerModal } from "./issue-picker-modal";import { useT } from "../i18n";export function AddChildIssueModal({+ open = true,onClose,+ onOpenChangeComplete,data,}: {+ open?: boolean;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;data: Record<string, unknown> | null;}) {const { t } = useT("modals");@@ -42,10 +46,11 @@ export function AddChildIssueModal({// the toasts follow the request's promise rather than per-call callbacks.return (<IssuePickerModal- open+ open={open}onOpenChange={(v) => {if (!v) onClose();}}+ onOpenChangeComplete={onOpenChangeComplete}title={t(($) => $.add_child.title)}description={t(($) => $.add_child.description)}excludeIds={excludeIds}diff --git a/packages/views/modals/add-project-issue.tsx b/packages/views/modals/add-project-issue.tsxindex 2213c5bb4f..1cd5a635e6 100644--- a/packages/views/modals/add-project-issue.tsx+++ b/packages/views/modals/add-project-issue.tsx@@ -6,10 +6,14 @@ import { IssuePickerModal } from "./issue-picker-modal";import { useT } from "../i18n";export function AddProjectIssueModal({+ open = true,onClose,+ onOpenChangeComplete,data,}: {+ open?: boolean;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;data: Record<string, unknown> | null;}) {const { t } = useT("modals");@@ -20,10 +24,11 @@ export function AddProjectIssueModal({// the toasts follow the request's promise rather than per-call callbacks.return (<IssuePickerModal- open+ open={open}onOpenChange={(v) => {if (!v) onClose();}}+ onOpenChangeComplete={onOpenChangeComplete}title={t(($) => $.add_project_issue.title)}description={t(($) => $.add_project_issue.description)}excludeIds={[]}diff --git a/packages/views/modals/create-issue-dialog.tsx b/packages/views/modals/create-issue-dialog.tsxindex 40b8ea246b..9f61f95df0 100644--- a/packages/views/modals/create-issue-dialog.tsx+++ b/packages/views/modals/create-issue-dialog.tsx@@ -1,7 +1,10 @@"use client";import { useLayoutEffect, useState } from "react";+import { motion } from "motion/react";import { useQuery } from "@tanstack/react-query";+import { useReducedMotion } from "@multica/core/appearance";+import { UI_EASE_OUT } from "@multica/ui/lib/motion";import { cn } from "@multica/ui/lib/utils";import { Dialog, DialogContent } from "@multica/ui/components/ui/dialog";import {@@ -36,11 +39,15 @@ import { useWorkspaceId } from "@multica/core/hooks";* create-mode store, so the dialog reopens at the size it was last left at.*/export function CreateIssueDialog({+ open = true,onClose,+ onOpenChangeComplete,initialMode,data,}: {+ open?: boolean;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;initialMode: CreateMode;data?: Record<string, unknown> | null;}) {@@ -50,23 +57,37 @@ export function CreateIssueDialog({if (anchorCommentId) {return (<SourceContextCreateIssueDialog+ open={open}onClose={onClose}+ onOpenChangeComplete={onOpenChangeComplete}initialMode={initialMode}data={data}anchorCommentId={anchorCommentId}/>);}- return <CreateIssueDialogBody onClose={onClose} initialMode={initialMode} data={data} />;+ return (+ <CreateIssueDialogBody+ open={open}+ onClose={onClose}+ onOpenChangeComplete={onOpenChangeComplete}+ initialMode={initialMode}+ data={data}+ />+ );}function SourceContextCreateIssueDialog({+ open,onClose,+ onOpenChangeComplete,initialMode,data,anchorCommentId,}: {+ open: boolean;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;initialMode: CreateMode;data?: Record<string, unknown> | null;anchorCommentId: string;@@ -86,7 +107,9 @@ function SourceContextCreateIssueDialog({return (<CreateIssueDialogBody+ open={open}onClose={onClose}+ onOpenChangeComplete={onOpenChangeComplete}initialMode={initialMode}data={data}sourceContextExpanded={sourceContextExpanded}@@ -107,20 +130,26 @@ function SourceContextCreateIssueDialog({}function CreateIssueDialogBody({+ open,onClose,+ onOpenChangeComplete,initialMode,data,sourceContextData,sourceContextExpanded = false,}: {+ open: boolean;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;initialMode: CreateMode;data?: Record<string, unknown> | null;sourceContextData?: Record<string, unknown>;sourceContextExpanded?: boolean;}) {+ const prefersReducedMotion = useReducedMotion();const setLastMode = useCreateModeStore((s) => s.setLastMode);const [mode, setMode] = useState<CreateMode>(initialMode);+ const [modeSwitchCount, setModeSwitchCount] = useState(0);const [manualOpened, setManualOpened] = useState(initialMode === "manual");const [panelData, setPanelData] = useState(data ?? null);// Remembered across opens: the dialog reopens at the size it was left at.@@ -145,6 +174,7 @@ function CreateIssueDialogBody({assignee_id: data.assignee_id,} : carry ?? null);if (next === "manual") setManualOpened(true);+ setModeSwitchCount((count) => count + 1);setMode(next);};@@ -153,9 +183,9 @@ function CreateIssueDialogBody({? cn("p-0 gap-0 flex flex-col overflow-hidden","!top-1/2 !left-1/2 !-translate-x-1/2 !-translate-y-1/2",- // Smooth size transition when switching modes — the manual mode- // uses the same easing.- "!transition-all !duration-300 !ease-out",+ // Geometry-only transition so DialogContent's enter/exit animation+ // keeps its own duration & easing without being overridden.+ "[interpolate-size:allow-keywords] [transition-property:width,max-width,height] [transition-duration:200ms] [transition-timing-function:cubic-bezier(0.23,1,0.32,1)] motion-reduce:[transition-duration:0ms]",// Phone gutter. The widths below are `!important` so they beat// DialogContent's own sizing — which also made them beat its// `max-w-[calc(100%-2rem)]` safety margin, leaving the card flush@@ -180,29 +210,41 @@ function CreateIssueDialogBody({);return (- <Dialog open onOpenChange={(v) => { if (!v) onClose(); }}>+ <Dialog+ open={open}+ onOpenChange={(v) => { if (!v) onClose(); }}+ onOpenChangeComplete={onOpenChangeComplete}+ ><DialogContentfinalFocus={false}showCloseButton={false}className={className}>- {mode === "agent" ? (- <AgentCreatePanel- onClose={onClose}- onSwitchMode={switchTo("manual")}- data={effectiveData}- isExpanded={isExpanded}- setIsExpanded={setIsExpanded}- />- ) : (- <ManualCreatePanel- onClose={onClose}- onSwitchMode={switchTo("agent")}- data={effectiveData}- isExpanded={isExpanded}- setIsExpanded={setIsExpanded}- />- )}+ <motion.div+ key={mode}+ initial={modeSwitchCount > 0 && !prefersReducedMotion ? { opacity: 0 } : false}+ animate={{ opacity: 1 }}+ transition={{ duration: prefersReducedMotion ? 0 : 0.13, ease: UI_EASE_OUT }}+ className="flex min-h-0 flex-1 flex-col"+ >+ {mode === "agent" ? (+ <AgentCreatePanel+ onClose={onClose}+ onSwitchMode={switchTo("manual")}+ data={effectiveData}+ isExpanded={isExpanded}+ setIsExpanded={setIsExpanded}+ />+ ) : (+ <ManualCreatePanel+ onClose={onClose}+ onSwitchMode={switchTo("agent")}+ data={effectiveData}+ isExpanded={isExpanded}+ setIsExpanded={setIsExpanded}+ />+ )}+ </motion.div></DialogContent></Dialog>);diff --git a/packages/views/modals/create-issue.tsx b/packages/views/modals/create-issue.tsxindex 5353e65ed7..edb8f08658 100644--- a/packages/views/modals/create-issue.tsx+++ b/packages/views/modals/create-issue.tsx@@ -176,8 +176,8 @@ function CreateRunHint({return (<divclassName={cn(- "grid shrink-0 transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none",- ready ? "grid-rows-[1fr]" : "grid-rows-[0fr]",+ "grid shrink-0 transition-[grid-template-rows,opacity] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none",+ ready ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0",)}aria-hidden={!ready}>@@ -214,12 +214,34 @@ function WorkflowHandoffHint({ projectId, status }: { projectId?: string; statusconst handlerLabel = useStepHandlerLabel(project);const step = workflowStep(workflow, status);const label = handlerLabel(step);- if (!label) return null;const actor = stepHandlerActor(step, project);+ const ready = Boolean(label);+ const [shown, setShown] = useState<{ label: string; actor: ReturnType<typeof stepHandlerActor> } | null>(+ label ? { label, actor } : null,+ );+ if (+ label &&+ (shown?.label !== label ||+ shown.actor?.id !== actor?.id ||+ shown.actor?.type !== actor?.type)+ ) {+ setShown({ label, actor });+ }+ if (!shown) return null;return (- <div aria-live="polite" className="flex items-center gap-1.5 px-4 pb-1 pt-0.5 text-micro text-muted-foreground">- {actor && <ActorAvatar actorType={actor.type} actorId={actor.id} size="sm" profileLink={false} />}- <span className="truncate">{t(($) => $.workflows.create_handoff_hint, { name: label })}</span>+ <div+ className={cn(+ "grid shrink-0 transition-[grid-template-rows,opacity] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none",+ ready ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0",+ )}+ aria-hidden={!ready}+ >+ <div className="overflow-hidden">+ <div aria-live="polite" className="flex items-center gap-1.5 px-4 pb-1 pt-0.5 text-micro text-muted-foreground">+ {shown.actor && <ActorAvatar actorType={shown.actor.type} actorId={shown.actor.id} size="sm" profileLink={false} />}+ <span className="truncate">{t(($) => $.workflows.create_handoff_hint, { name: shown.label })}</span>+ </div>+ </div></div>);}@@ -1608,7 +1630,7 @@ export function manualDialogContentClass(isExpanded: boolean) {return cn("p-0 gap-0 flex flex-col overflow-hidden","!top-1/2 !left-1/2 !-translate-x-1/2",- "!transition-all !duration-300 !ease-out",+ "[interpolate-size:allow-keywords] [transition-property:width,max-width,height] [transition-duration:200ms] [transition-timing-function:cubic-bezier(0.23,1,0.32,1)] motion-reduce:[transition-duration:0ms]",// Phone gutter — see the matching note in create-issue-dialog.tsx: the// `!important` widths below also override DialogContent's// `max-w-[calc(100%-2rem)]`, leaving the card edge to edge on a phonediff --git a/packages/views/modals/create-project.tsx b/packages/views/modals/create-project.tsxindex eb9a823b0d..2bdaefc722 100644--- a/packages/views/modals/create-project.tsx+++ b/packages/views/modals/create-project.tsx@@ -38,6 +38,7 @@ import type { ProjectStatus, ProjectPriority, ProjectVisibility } from "@multicaimport { cn } from "@multica/ui/lib/utils";import { toast } from "sonner";import { Dialog, DialogContent, DialogTitle } from "@multica/ui/components/ui/dialog";+import { Collapsible, CollapsibleContent } from "@multica/ui/components/ui/collapsible";import {DropdownMenu,DropdownMenuContent,@@ -145,10 +146,14 @@ function RepoUrlText({}export function CreateProjectModal({+ open = true,onClose,+ onOpenChangeComplete,data,}: {+ open?: boolean;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;data?: Record<string, unknown> | null;}) {const { t } = useT("modals");@@ -494,13 +499,17 @@ export function CreateProjectModal({};return (- <Dialog open onOpenChange={(v) => { if (!v) onClose(); }}>+ <Dialog+ open={open}+ onOpenChange={(v) => { if (!v) onClose(); }}+ onOpenChangeComplete={onOpenChangeComplete}+ ><DialogContentshowCloseButton={false}className={cn("p-0 gap-0 flex flex-col overflow-hidden","!top-1/2 !left-1/2 !-translate-x-1/2",- "!transition-all !duration-300 !ease-out",+ "[transition-property:width,max-width,height] [transition-duration:200ms] [transition-timing-function:cubic-bezier(0.23,1,0.32,1)] motion-reduce:[transition-duration:0ms]",isExpanded? "!max-w-4xl !w-full !h-5/6 !-translate-y-1/2": "!max-w-2xl !w-full !h-96 !-translate-y-1/2",@@ -924,13 +933,15 @@ export function CreateProjectModal({read as one field, and the default branch is the rightanswer often enough that this must not look like asecond required step. */}- {customRepoUrl.trim() && (- <GithubRefField- id="create-project-repo-ref"- value={customRepoRef}- onChange={setCustomRepoRef}- />- )}+ <Collapsible open={Boolean(customRepoUrl.trim())}>+ <CollapsibleContent>+ <GithubRefField+ id="create-project-repo-ref"+ value={customRepoRef}+ onChange={setCustomRepoRef}+ />+ </CollapsibleContent>+ </Collapsible></form>{selectedRepos.length > 0 && (<div className="space-y-1 pt-1 border-t">diff --git a/packages/views/modals/create-squad.tsx b/packages/views/modals/create-squad.tsxindex 6e483e64a1..20d4e9c3ca 100644--- a/packages/views/modals/create-squad.tsx+++ b/packages/views/modals/create-squad.tsx@@ -53,7 +53,15 @@ type SelectedMember = {// How many chips we show inline before collapsing the tail into "+N".const CHIP_DISPLAY_LIMIT = 3;-export function CreateSquadModal({ onClose }: { onClose: () => void }) {+export function CreateSquadModal({+ open = true,+ onClose,+ onOpenChangeComplete,+}: {+ open?: boolean;+ onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;+}) {const { t } = useT("modals");const router = useNavigation();const wsPaths = useWorkspacePaths();@@ -141,7 +149,11 @@ export function CreateSquadModal({ onClose }: { onClose: () => void }) {};return (- <Dialog open onOpenChange={(v) => { if (!v) onClose(); }}>+ <Dialog+ open={open}+ onOpenChange={(v) => { if (!v) onClose(); }}+ onOpenChangeComplete={onOpenChangeComplete}+ ><DialogContent className="p-0 gap-0 flex flex-col overflow-hidden !top-1/2 !left-1/2 !-translate-x-1/2 !-translate-y-1/2 !w-full !max-w-2xl !h-[85%]"><DialogHeader className="border-b px-5 py-3 space-y-0"><DialogTitle className="text-title-sm font-semibold">diff --git a/packages/views/modals/delete-issue-confirm.tsx b/packages/views/modals/delete-issue-confirm.tsxindex 487eccfc35..a259ea4ba4 100644--- a/packages/views/modals/delete-issue-confirm.tsx+++ b/packages/views/modals/delete-issue-confirm.tsx@@ -17,10 +17,14 @@ import { useBackOrReplace } from "../navigation";import { useT } from "../i18n";export function DeleteIssueConfirmModal({+ open = true,onClose,+ onOpenChangeComplete,data,}: {+ open?: boolean;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;data: Record<string, unknown> | null;}) {const { t } = useT("modals");@@ -53,7 +57,11 @@ export function DeleteIssueConfirmModal({};return (- <AlertDialog open onOpenChange={(v) => { if (!v && !deleting) onClose(); }}>+ <AlertDialog+ open={open}+ onOpenChange={(v) => { if (!v && !deleting) onClose(); }}+ onOpenChangeComplete={onOpenChangeComplete}+ ><AlertDialogContent><AlertDialogHeader><AlertDialogTitle>{t(($) => $.delete_issue.title)}</AlertDialogTitle>diff --git a/packages/views/modals/feedback.tsx b/packages/views/modals/feedback.tsxindex ee6f5ed319..c8a1f3ce08 100644--- a/packages/views/modals/feedback.tsx+++ b/packages/views/modals/feedback.tsx@@ -49,11 +49,15 @@ ${incomingInitialMessage}`;}export function FeedbackModal({+ open = true,onClose,+ onOpenChangeComplete,data,initialMessage,}: {+ open?: boolean;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;data?: Record<string, unknown> | null;initialMessage?: string;}) {@@ -140,7 +144,11 @@ export function FeedbackModal({};return (- <Dialog open onOpenChange={(v) => !v && onClose()}>+ <Dialog+ open={open}+ onOpenChange={(v) => !v && onClose()}+ onOpenChangeComplete={onOpenChangeComplete}+ ><DialogContent className="sm:max-w-2xl !h-[28rem] p-0 gap-0 flex flex-col overflow-hidden"><DialogHeader className="px-5 pt-4 pb-2 shrink-0"><DialogTitle>{t(($) => $.feedback.title)}</DialogTitle>diff --git a/packages/views/modals/issue-picker-modal.tsx b/packages/views/modals/issue-picker-modal.tsxindex 6c8170b641..e8ee498319 100644--- a/packages/views/modals/issue-picker-modal.tsx+++ b/packages/views/modals/issue-picker-modal.tsx@@ -28,6 +28,7 @@ export interface IssuePickerSuggestionGroup {interface IssuePickerModalProps {open: boolean;onOpenChange: (open: boolean) => void;+ onOpenChangeComplete?: (open: boolean) => void;title: string;description: string;excludeIds: string[];@@ -41,6 +42,7 @@ interface IssuePickerModalProps {export function IssuePickerModal({open,onOpenChange,+ onOpenChangeComplete,title,description,excludeIds,@@ -65,9 +67,8 @@ export function IssuePickerModal({useEffect(() => {if (!open) {- setQuery("");- setResults([]);- setIsLoading(false);+ if (debounceRef.current) clearTimeout(debounceRef.current);+ if (abortRef.current) abortRef.current.abort();}}, [open]);@@ -132,6 +133,14 @@ export function IssuePickerModal({<CommandDialogopen={open}onOpenChange={onOpenChange}+ onOpenChangeComplete={(nextOpen) => {+ if (!nextOpen) {+ setQuery("");+ setResults([]);+ setIsLoading(false);+ }+ onOpenChangeComplete?.(nextOpen);+ }}title={title}description={description}>diff --git a/packages/views/modals/mark-duplicate-issue.tsx b/packages/views/modals/mark-duplicate-issue.tsxindex 33be2a9d0f..27076bb934 100644--- a/packages/views/modals/mark-duplicate-issue.tsx+++ b/packages/views/modals/mark-duplicate-issue.tsx@@ -36,10 +36,14 @@ const notDuplicate = (candidate: Issue) => !isDuplicateIssue(candidate);* left out of candidates and search results alike.*/export function MarkDuplicateIssueModal({+ open = true,onClose,+ onOpenChangeComplete,data,}: {+ open?: boolean;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;data: Record<string, unknown> | null;}) {const { t } = useT("modals");@@ -93,10 +97,11 @@ export function MarkDuplicateIssueModal({return (<IssuePickerModal- open+ open={open}onOpenChange={(v) => {if (!v) onClose();}}+ onOpenChangeComplete={onOpenChangeComplete}title={t(($) => $.mark_duplicate.title)}description={t(($) => $.mark_duplicate.description)}excludeIds={excludeIds}diff --git a/packages/views/modals/registry.test.tsx b/packages/views/modals/registry.test.tsxnew file mode 100644index 0000000000..c8bc1a8a44--- /dev/null+++ b/packages/views/modals/registry.test.tsx@@ -0,0 +1,120 @@+import { act, cleanup, render, screen } from "@testing-library/react";+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import { useModalStore } from "@multica/core/modals";++const captured = vi.hoisted(() => ({+ calls: [] as Array<{+ open?: boolean;+ onOpenChangeComplete?: (open: boolean) => void;+ data?: Record<string, unknown> | null;+ }>,+ mounts: 0,+}));++vi.mock("./rename-issue", async () => {+ const React = await import("react");+ return {+ RenameIssueModal: ({+ open,+ onOpenChangeComplete,+ data,+ }: {+ open?: boolean;+ onOpenChangeComplete?: (open: boolean) => void;+ data?: Record<string, unknown> | null;+ }) => {+ React.useEffect(() => {+ captured.mounts += 1;+ }, []);+ captured.calls.push({ open, onOpenChangeComplete, data });+ return (+ <div+ data-testid="mock-rename-issue"+ data-open={String(open)}+ data-title={String(data?.title ?? "")}+ />+ );+ },+ };+});++vi.mock("./limit-recovery-dialog", () => ({+ LimitRecoveryDialog: () => null,+}));++vi.mock("../extensions", () => ({+ getProjectFoldersExtension: () => null,+}));++import { ModalRegistry } from "./registry";++describe("ModalRegistry exit animation retention", () => {+ beforeEach(() => {+ captured.calls = [];+ captured.mounts = 0;+ useModalStore.setState({ modal: null, data: null });+ });++ afterEach(() => {+ cleanup();+ useModalStore.setState({ modal: null, data: null });+ });++ it("keeps the closing modal mounted with open=false until onOpenChangeComplete fires", () => {+ render(<ModalRegistry />);+ expect(screen.queryByTestId("mock-rename-issue")).not.toBeInTheDocument();++ act(() => {+ useModalStore.getState().open("issue-rename", { issueId: "1", title: "Original" });+ });++ const el = screen.getByTestId("mock-rename-issue");+ expect(el).toHaveAttribute("data-open", "true");+ expect(el).toHaveAttribute("data-title", "Original");++ // Closing flips open to false without unmounting immediately so exit animation can play.+ act(() => {+ useModalStore.getState().close();+ });++ const closingEl = screen.getByTestId("mock-rename-issue");+ expect(closingEl).toHaveAttribute("data-open", "false");+ expect(closingEl).toHaveAttribute("data-title", "Original");++ // Unmounts only once Base UI signals the exit transition finished.+ const complete = captured.calls.at(-1)?.onOpenChangeComplete;+ expect(complete).toBeTypeOf("function");+ act(() => {+ complete?.(false);+ });++ expect(screen.queryByTestId("mock-rename-issue")).not.toBeInTheDocument();+ });++ it("remounts cleanly on rapid close-then-reopen and ignores stale exit callbacks", () => {+ render(<ModalRegistry />);++ act(() => {+ useModalStore.getState().open("issue-rename", { issueId: "1", title: "First" });+ });+ expect(captured.mounts).toBe(1);++ act(() => {+ useModalStore.getState().close();+ });+ const staleComplete = captured.calls.at(-1)?.onOpenChangeComplete;++ // Reopen before the previous exit callback fires.+ act(() => {+ useModalStore.getState().open("issue-rename", { issueId: "1", title: "First" });+ });+ expect(captured.mounts).toBe(2);+ expect(screen.getByTestId("mock-rename-issue")).toHaveAttribute("data-open", "true");++ // Stale completion callback from the previous instance must not unmount the new modal.+ act(() => {+ staleComplete?.(false);+ });+ expect(screen.getByTestId("mock-rename-issue")).toHaveAttribute("data-open", "true");+ });+});diff --git a/packages/views/modals/registry.tsx b/packages/views/modals/registry.tsxindex a824c41553..da4cf7e075 100644--- a/packages/views/modals/registry.tsx+++ b/packages/views/modals/registry.tsx@@ -1,6 +1,6 @@"use client";-import type { ReactNode } from "react";+import { useState, type ReactNode } from "react";import { useModalStore } from "@multica/core/modals";import { CreateIssueDialog } from "./create-issue-dialog";import { CreateProjectModal } from "./create-project";@@ -18,69 +18,228 @@ import { RunConfirmModal } from "./run-confirm";import { WorkflowHandoffModal } from "./workflow-handoff";import { LimitRecoveryDialog } from "./limit-recovery-dialog";+type ActiveModalName = NonNullable<ReturnType<typeof useModalStore.getState>["modal"]>;++type RetainedModal = {+ modal: ActiveModalName;+ data: Record<string, unknown> | null;+ sessionKey: number;+ closing: boolean;+};+export function ModalRegistry() {const modal = useModalStore((s) => s.modal);const data = useModalStore((s) => s.data);const close = useModalStore((s) => s.close);+ const [retained, setRetained] = useState<RetainedModal | null>(null);++ if (modal !== null) {+ if (+ retained === null ||+ retained.closing ||+ retained.modal !== modal ||+ retained.data !== data+ ) {+ setRetained({+ modal,+ data,+ sessionKey: (retained?.sessionKey ?? 0) + 1,+ closing: false,+ });+ }+ } else if (retained !== null && !retained.closing) {+ setRetained({ ...retained, closing: true });+ }++ const snapshot: RetainedModal | null =+ modal !== null+ ? retained !== null &&+ !retained.closing &&+ retained.modal === modal &&+ retained.data === data+ ? retained+ : {+ modal,+ data,+ sessionKey: (retained?.sessionKey ?? 0) + 1,+ closing: false,+ }+ : retained;++ const isOpen = modal !== null;let activeModal: ReactNode = null;- switch (modal) {- // Both modal types open the same shell so the in-modal mode switch is- // instant — only the inner panel swaps, the Dialog Root stays mounted.- case "create-issue":- activeModal = (- <CreateIssueDialog- onClose={close}- initialMode="manual"- data={data}- />- );- break;- case "quick-create-issue":- activeModal = (- <CreateIssueDialog- onClose={close}- initialMode="agent"- data={data}- />- );- break;- case "create-project":- activeModal = <CreateProjectModal onClose={close} data={data} />;- break;- case "create-squad":- activeModal = <CreateSquadModal onClose={close} />;- break;- case "feedback":- activeModal = <FeedbackModal onClose={close} data={data} />;- break;- case "issue-set-parent":- activeModal = <SetParentIssueModal onClose={close} data={data} />;- break;- case "issue-mark-duplicate":- activeModal = <MarkDuplicateIssueModal onClose={close} data={data} />;- break;- case "issue-add-child":- activeModal = <AddChildIssueModal onClose={close} data={data} />;- break;- case "project-add-issue":- activeModal = <AddProjectIssueModal onClose={close} data={data} />;- break;- case "project-rename":- activeModal = <RenameProjectModal onClose={close} data={data} />;- break;- case "issue-rename":- activeModal = <RenameIssueModal onClose={close} data={data} />;- break;- case "issue-delete-confirm":- activeModal = <DeleteIssueConfirmModal onClose={close} data={data} />;- break;- case "issue-run-confirm":- activeModal = <RunConfirmModal onClose={close} data={data} />;- break;- case "issue-workflow-handoff":- activeModal = <WorkflowHandoffModal onClose={close} data={data} />;- break;+ if (snapshot !== null) {+ const { modal: currentModal, data: currentData, sessionKey } = snapshot;+ const handleOpenChangeComplete = (nextOpen: boolean) => {+ if (!nextOpen) {+ setRetained((prev) =>+ prev !== null && prev.sessionKey === sessionKey && prev.closing+ ? null+ : prev,+ );+ }+ };++ switch (currentModal) {+ // Both modal types open the same shell so the in-modal mode switch is+ // instant — only the inner panel swaps, the Dialog Root stays mounted.+ case "create-issue":+ activeModal = (+ <CreateIssueDialog+ key={sessionKey}+ open={isOpen}+ onClose={close}+ onOpenChangeComplete={handleOpenChangeComplete}+ initialMode="manual"+ data={currentData}+ />+ );+ break;+ case "quick-create-issue":+ activeModal = (+ <CreateIssueDialog+ key={sessionKey}+ open={isOpen}+ onClose={close}+ onOpenChangeComplete={handleOpenChangeComplete}+ initialMode="agent"+ data={currentData}+ />+ );+ break;+ case "create-project":+ activeModal = (+ <CreateProjectModal+ key={sessionKey}+ open={isOpen}+ onClose={close}+ onOpenChangeComplete={handleOpenChangeComplete}+ data={currentData}+ />+ );+ break;+ case "create-squad":+ activeModal = (+ <CreateSquadModal+ key={sessionKey}+ open={isOpen}+ onClose={close}+ onOpenChangeComplete={handleOpenChangeComplete}+ />+ );+ break;+ case "feedback":+ activeModal = (+ <FeedbackModal+ key={sessionKey}+ open={isOpen}+ onClose={close}+ onOpenChangeComplete={handleOpenChangeComplete}+ data={currentData}+ />+ );+ break;+ case "issue-set-parent":+ activeModal = (+ <SetParentIssueModal+ key={sessionKey}+ open={isOpen}+ onClose={close}+ onOpenChangeComplete={handleOpenChangeComplete}+ data={currentData}+ />+ );+ break;+ case "issue-mark-duplicate":+ activeModal = (+ <MarkDuplicateIssueModal+ key={sessionKey}+ open={isOpen}+ onClose={close}+ onOpenChangeComplete={handleOpenChangeComplete}+ data={currentData}+ />+ );+ break;+ case "issue-add-child":+ activeModal = (+ <AddChildIssueModal+ key={sessionKey}+ open={isOpen}+ onClose={close}+ onOpenChangeComplete={handleOpenChangeComplete}+ data={currentData}+ />+ );+ break;+ case "project-add-issue":+ activeModal = (+ <AddProjectIssueModal+ key={sessionKey}+ open={isOpen}+ onClose={close}+ onOpenChangeComplete={handleOpenChangeComplete}+ data={currentData}+ />+ );+ break;+ case "project-rename":+ activeModal = (+ <RenameProjectModal+ key={sessionKey}+ open={isOpen}+ onClose={close}+ onOpenChangeComplete={handleOpenChangeComplete}+ data={currentData}+ />+ );+ break;+ case "issue-rename":+ activeModal = (+ <RenameIssueModal+ key={sessionKey}+ open={isOpen}+ onClose={close}+ onOpenChangeComplete={handleOpenChangeComplete}+ data={currentData}+ />+ );+ break;+ case "issue-delete-confirm":+ activeModal = (+ <DeleteIssueConfirmModal+ key={sessionKey}+ open={isOpen}+ onClose={close}+ onOpenChangeComplete={handleOpenChangeComplete}+ data={currentData}+ />+ );+ break;+ case "issue-run-confirm":+ activeModal = (+ <RunConfirmModal+ key={sessionKey}+ open={isOpen}+ onClose={close}+ onOpenChangeComplete={handleOpenChangeComplete}+ data={currentData}+ />+ );+ break;+ case "issue-workflow-handoff":+ activeModal = (+ <WorkflowHandoffModal+ key={sessionKey}+ open={isOpen}+ onClose={close}+ onOpenChangeComplete={handleOpenChangeComplete}+ data={currentData}+ />+ );+ break;+ }}const FoldersHost = getProjectFoldersExtension()?.Host;diff --git a/packages/views/modals/rename-issue.tsx b/packages/views/modals/rename-issue.tsxindex 0e4cca59f9..b5adbc42d4 100644--- a/packages/views/modals/rename-issue.tsx+++ b/packages/views/modals/rename-issue.tsx@@ -26,10 +26,14 @@ import { useT } from "../i18n";* the detail projection all reconcile from one code path).*/export function RenameIssueModal({+ open = true,onClose,+ onOpenChangeComplete,data,}: {+ open?: boolean;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;data: Record<string, unknown> | null;}) {const { t } = useT("modals");@@ -92,12 +96,13 @@ export function RenameIssueModal({return (<Dialog- open+ open={open}onOpenChange={(v) => {// Never dismiss mid-write: the mutation has already been sent, and// closing here would leave the user with no feedback either way.if (!v && !pending) onClose();}}+ onOpenChangeComplete={onOpenChangeComplete}><DialogContent className="sm:max-w-md"><DialogHeader>diff --git a/packages/views/modals/rename-project.tsx b/packages/views/modals/rename-project.tsxindex 49bbdb8567..736f7d0180 100644--- a/packages/views/modals/rename-project.tsx+++ b/packages/views/modals/rename-project.tsx@@ -27,10 +27,14 @@ import { useT } from "../i18n";* one code path.*/export function RenameProjectModal({+ open = true,onClose,+ onOpenChangeComplete,data,}: {+ open?: boolean;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;data: Record<string, unknown> | null;}) {const { t } = useT("modals");@@ -87,11 +91,12 @@ export function RenameProjectModal({return (<Dialog- open+ open={open}onOpenChange={(v) => {// The write is already in flight; closing now would drop its outcome.if (!v && !pending) onClose();}}+ onOpenChangeComplete={onOpenChangeComplete}><DialogContent className="sm:max-w-md" initialFocus={focusNameInput}><DialogHeader>diff --git a/packages/views/modals/run-confirm.tsx b/packages/views/modals/run-confirm.tsxindex 5059d8a81b..6c5fe7e4d6 100644--- a/packages/views/modals/run-confirm.tsx+++ b/packages/views/modals/run-confirm.tsx@@ -92,10 +92,14 @@ interface RunConfirmData {* single-issue promotion out of backlog.*/export function RunConfirmModal({+ open = true,onClose,+ onOpenChangeComplete,data,}: {+ open?: boolean;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;data: Record<string, unknown> | null;}) {const { t } = useT("modals");@@ -225,7 +229,11 @@ export function RunConfirmModal({);return (- <Dialog open onOpenChange={(v) => { if (!v && !submitting) onClose(); }}>+ <Dialog+ open={open}+ onOpenChange={(v) => { if (!v && !submitting) onClose(); }}+ onOpenChangeComplete={onOpenChangeComplete}+ >{/* Wider than the primitive's sm:max-w-sm: the two actions are longphrases, not "Cancel"/"Save". In French they measure ~435px with thesend-shortcut keycaps against the 352px the default leaves, so thediff --git a/packages/views/modals/set-parent-issue.tsx b/packages/views/modals/set-parent-issue.tsxindex b559005d36..43e9c34245 100644--- a/packages/views/modals/set-parent-issue.tsx+++ b/packages/views/modals/set-parent-issue.tsx@@ -11,10 +11,14 @@ import { IssuePickerModal } from "./issue-picker-modal";import { useT } from "../i18n";export function SetParentIssueModal({+ open = true,onClose,+ onOpenChangeComplete,data,}: {+ open?: boolean;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;data: Record<string, unknown> | null;}) {const { t } = useT("modals");@@ -34,10 +38,11 @@ export function SetParentIssueModal({return (<IssuePickerModal- open+ open={open}onOpenChange={(v) => {if (!v) onClose();}}+ onOpenChangeComplete={onOpenChangeComplete}title={t(($) => $.set_parent.title)}description={t(($) => $.set_parent.description)}excludeIds={excludeIds}diff --git a/packages/views/modals/source-context-preview.tsx b/packages/views/modals/source-context-preview.tsxindex 8a5802ac81..ba9a636bb0 100644--- a/packages/views/modals/source-context-preview.tsx+++ b/packages/views/modals/source-context-preview.tsx@@ -3,6 +3,11 @@import { useState } from "react";import { ChevronRight, Loader2, RefreshCw } from "@multica/ui/icons";import { Button } from "@multica/ui/components/ui/button";+import {+ Collapsible,+ CollapsibleContent,+ CollapsibleTrigger,+} from "@multica/ui/components/ui/collapsible";import { cn } from "@multica/ui/lib/utils";import type { SourceContextPreview } from "@multica/core/types";import { ApiError } from "@multica/core/api";@@ -81,8 +86,7 @@ export function SourceContextPreviewCard({const sourceContextFailureMessage = useSourceContextFailureMessage();const [internalExpanded, setInternalExpanded] = useState(false);const expanded = controlledExpanded ?? internalExpanded;- const toggleExpanded = () => {- const next = !expanded;+ const setExpanded = (next: boolean) => {if (controlledExpanded === undefined) setInternalExpanded(next);onExpandedChange?.(next);};@@ -112,7 +116,9 @@ export function SourceContextPreviewCard({const anchor = preview.comment_thread.find((comment) => comment.id === preview.anchor_comment_id);return (- <div+ <Collapsible+ open={expanded}+ onOpenChange={setExpanded}data-slot="source-context-preview"className={cn("mx-4 mb-2 shrink-0 overflow-hidden rounded-md border bg-muted/25",@@ -121,13 +127,11 @@ export function SourceContextPreviewCard({: "shrink-0"),)}>- <button+ <CollapsibleTriggertype="button"className="flex w-full min-w-0 shrink-0 items-center gap-2 px-3 py-2 text-left text-caption hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"- aria-expanded={expanded}- onClick={toggleExpanded}>- <ChevronRight className={cn("size-3.5 shrink-0 transition-transform motion-reduce:transition-none", expanded && "rotate-90")} aria-hidden />+ <ChevronRight className={cn("size-3.5 shrink-0 transition-transform duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none", expanded && "rotate-90")} aria-hidden /><span className="min-w-0 truncate font-medium">{t(($) => $.source_context.preview_summary, {identifier: preview.source_issue.identifier,@@ -137,8 +141,10 @@ export function SourceContextPreviewCard({{anchor?.author.name && (<span className="truncate text-muted-foreground">· {anchor.author.name}</span>)}- </button>- {expanded && (+ </CollapsibleTrigger>+ <CollapsibleContent+ className={cn(constrainToParent && "flex min-h-0 flex-1 flex-col")}+ ><divdata-slot="source-context-preview-body"className={cn(@@ -154,7 +160,7 @@ export function SourceContextPreviewCard({anchorCommentId={preview.anchor_comment_id}/></div>- )}- </div>+ </CollapsibleContent>+ </Collapsible>);}diff --git a/packages/views/modals/workflow-handoff.tsx b/packages/views/modals/workflow-handoff.tsxindex d8be3180db..cdcc5ba150 100644--- a/packages/views/modals/workflow-handoff.tsx+++ b/packages/views/modals/workflow-handoff.tsx@@ -11,10 +11,14 @@ import { WorkflowHandoffConfirmDialog } from "../workflows/handoff-confirm-dialo* status change once confirmed.*/export function WorkflowHandoffModal({+ open = true,onClose,+ onOpenChangeComplete,data,}: {+ open?: boolean;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;data: Record<string, unknown> | null;}) {const { t } = useT("issues");@@ -25,9 +29,11 @@ export function WorkflowHandoffModal({if (!issueId || !status) return null;return (<WorkflowHandoffConfirmDialog+ open={open}issue={{ id: issueId, identifier }}toStatus={status}onCancel={onClose}+ onOpenChangeComplete={onOpenChangeComplete}onConfirm={({ stopPreviousRuns }) => {onClose();// Closing unmounts this modal, so the failure follows the promise.diff --git a/packages/views/onboarding/steps/cli-install-instructions.tsx b/packages/views/onboarding/steps/cli-install-instructions.tsxindex 9f6b0f5a64..aaf063b82f 100644--- a/packages/views/onboarding/steps/cli-install-instructions.tsx+++ b/packages/views/onboarding/steps/cli-install-instructions.tsx@@ -1,8 +1,9 @@"use client";import { useState, type ReactNode } from "react";-import { Check, Copy, Terminal } from "@multica/ui/icons";+import { Terminal } from "@multica/ui/icons";import { Card, CardContent } from "@multica/ui/components/ui/card";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { TooltipHint } from "@multica/ui/components/common/tooltip-hint";import { CODE_LIGATURE_CLASS } from "@multica/ui/lib/code-style";import { cn } from "@multica/ui/lib/utils";@@ -32,11 +33,7 @@ function CopyButton({ text }: { text: string }) {className="shrink-0 rounded-xs p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"aria-label={t(($) => $.cli_install.copy_aria)}>- {copied ? (- <Check className="h-3.5 w-3.5 text-success" />- ) : (- <Copy className="h-3.5 w-3.5" />- )}+ <CopyCheckIcon copied={copied} /></button></TooltipHint>);diff --git a/packages/views/package.json b/packages/views/package.jsonindex a554929e30..12bb14a155 100644--- a/packages/views/package.json+++ b/packages/views/package.json@@ -16,6 +16,7 @@"./common/cli-install-command": "./common/cli-install-command.tsx","./common/context-menu-scope": "./common/context-menu-scope.tsx","./common/menu-primitives": "./common/menu-primitives.ts",+ "./common/motion-provider": "./common/motion-provider.tsx","./common/shortcut-keycaps": "./common/shortcut-keycaps.tsx","./editor": "./editor/index.ts","./editor/schema": "./editor/schema/index.ts",diff --git a/packages/views/projects/components/project-overview.tsx b/packages/views/projects/components/project-overview.tsxindex a5ea04cdf5..65186a484e 100644--- a/packages/views/projects/components/project-overview.tsx+++ b/packages/views/projects/components/project-overview.tsx@@ -22,7 +22,7 @@ import { useT } from "../../i18n";import { ProjectIcon } from "./project-icon";import { ProjectResourcesSection } from "./project-resources-section";-const TAB_TRIGGER_CLASS = "h-full rounded-none px-2.5 group-data-horizontal/tabs:after:bottom-0";+const TAB_TRIGGER_CLASS = "h-full rounded-none px-2.5";/** Overview / Issues / Activity switch, sized to sit in a page header and underline at its bottom edge. */export function ProjectTabs({diff --git a/packages/views/rich-content/rich-code-block.tsx b/packages/views/rich-content/rich-code-block.tsxindex 0067eee5d9..c5df378c63 100644--- a/packages/views/rich-content/rich-code-block.tsx+++ b/packages/views/rich-content/rich-code-block.tsx@@ -25,7 +25,7 @@*/import { memo, useEffect, useMemo, useState, type ReactNode } from "react";-import { Check, Copy } from "@multica/ui/icons";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { cn } from "@multica/ui/lib/utils";import { copyText } from "@multica/ui/lib/clipboard";import { useT } from "../i18n";@@ -152,11 +152,7 @@ export function CodeBlockShell({className="flex h-6 w-6 items-center justify-center rounded-xs text-muted-foreground hover:bg-muted hover:text-foreground transition-colors"aria-label={copyLabel}>- {copied ? (- <Check className="h-3.5 w-3.5" />- ) : (- <Copy className="h-3.5 w-3.5" />- )}+ <CopyCheckIcon copied={copied} /></button>}/>diff --git a/packages/views/rich-content/rich-table.tsx b/packages/views/rich-content/rich-table.tsxindex d94bd13985..63f8ee3ff1 100644--- a/packages/views/rich-content/rich-table.tsx+++ b/packages/views/rich-content/rich-table.tsx@@ -31,7 +31,8 @@ import {} from "react";import { createPortal } from "react-dom";import type { ExtraProps } from "react-markdown";-import { Check, Copy, Maximize2, RotateCcw } from "@multica/ui/icons";+import { Maximize2, RotateCcw } from "@multica/ui/icons";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { copyText } from "@multica/ui/lib/clipboard";import { cn } from "@multica/ui/lib/utils";import { useT } from "../i18n";@@ -439,7 +440,7 @@ export function RichTableFrame({ model, getMarkdown, tableRef: onTable, childrenclassName={cn(toolbarButton, "w-6")}aria-label={t(($) => $.table.copy_markdown)}>- {copied ? <Check className="size-3.5" /> : <Copy className="size-3.5" />}+ <CopyCheckIcon copied={copied} /></button>}/>diff --git a/packages/views/runtimes/components/connect-remote-dialog.tsx b/packages/views/runtimes/components/connect-remote-dialog.tsxindex 43c22f01d5..135885dfe2 100644--- a/packages/views/runtimes/components/connect-remote-dialog.tsx+++ b/packages/views/runtimes/components/connect-remote-dialog.tsx@@ -9,7 +9,8 @@ import {} from "react";import { AnimatePresence, motion } from "motion/react";import { useReducedMotion } from "@multica/core/appearance";-import { Check, ChevronRight, Copy, Terminal } from "@multica/ui/icons";+import { Check, ChevronRight, Terminal } from "@multica/ui/icons";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { useQuery, useQueryClient } from "@tanstack/react-query";import { useAuthStore } from "@multica/core/auth";import { useWorkspaceId } from "@multica/core/hooks";@@ -220,11 +221,7 @@ function CopyButton({ text, ariaLabel }: { text: string; ariaLabel: string }) {aria-label={ariaLabel}className="shrink-0 rounded-xs p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring">- {copied ? (- <Check className="h-3.5 w-3.5 text-success" aria-hidden />- ) : (- <Copy className="h-3.5 w-3.5" aria-hidden />- )}+ <CopyCheckIcon copied={copied} /></button></TooltipHint>);diff --git a/packages/views/search/host-dialogs.tsx b/packages/views/search/host-dialogs.tsxindex bdff62856c..2ee191a9ff 100644--- a/packages/views/search/host-dialogs.tsx+++ b/packages/views/search/host-dialogs.tsx@@ -1,5 +1,6 @@"use client";+import { useState } from "react";import { toast } from "sonner";import { useBatchDeleteIssues, useCancelIssueRun } from "@multica/core/issues/mutations";import {@@ -30,31 +31,85 @@ export function PaletteHostDialogs({dialog: PaletteHostDialog | null;onClose: () => void;}) {- if (!dialog) return null;- switch (dialog.type) {+ const [retained, setRetained] = useState<{+ dialog: PaletteHostDialog;+ sessionKey: number;+ } | null>(null);++ if (dialog !== null && retained?.dialog !== dialog) {+ setRetained((prev) => ({+ dialog,+ sessionKey: (prev?.sessionKey ?? 0) + 1,+ }));+ }++ const active = dialog !== null+ ? { dialog, sessionKey: retained?.dialog === dialog ? retained.sessionKey : (retained?.sessionKey ?? 0) + 1 }+ : retained;++ if (!active) return null;++ const isOpen = dialog !== null;+ const { dialog: current, sessionKey } = active;+ const handleOpenChangeComplete = (nextOpen: boolean) => {+ if (!nextOpen) {+ setRetained((prev) => (prev?.sessionKey === sessionKey ? null : prev));+ }+ };++ switch (current.type) {case "cancel-run":- return <CancelRunDialog dialog={dialog} onClose={onClose} />;+ return (+ <CancelRunDialog+ key={sessionKey}+ open={isOpen}+ dialog={current}+ onClose={onClose}+ onOpenChangeComplete={handleOpenChangeComplete}+ />+ );case "batch-delete":- return <BatchDeleteDialog dialog={dialog} onClose={onClose} />;+ return (+ <BatchDeleteDialog+ key={sessionKey}+ open={isOpen}+ dialog={current}+ onClose={onClose}+ onOpenChangeComplete={handleOpenChangeComplete}+ />+ );case "new-autopilot":- return <AutopilotDialog mode="create" open onOpenChange={(open) => !open && onClose()} />;+ return (+ <AutopilotDialog+ key={sessionKey}+ mode="create"+ open={isOpen}+ onOpenChange={(open) => !open && onClose()}+ onOpenChangeComplete={handleOpenChangeComplete}+ />+ );}}function CancelRunDialog({+ open,dialog,onClose,+ onOpenChangeComplete,}: {+ open: boolean;dialog: Extract<PaletteHostDialog, { type: "cancel-run" }>;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;}) {const { t } = useT("issues");const { t: tSearch } = useT("search");const cancelRun = useCancelIssueRun(dialog.issueId);return (<TerminateTaskConfirmDialog- open- onOpenChange={(open) => !open && onClose()}+ open={open}+ onOpenChange={(nextOpen) => !nextOpen && onClose()}+ onOpenChangeComplete={onOpenChangeComplete}showRunningNote={dialog.running}onConfirm={() => {onClose();@@ -69,11 +124,15 @@ function CancelRunDialog({}function BatchDeleteDialog({+ open,dialog,onClose,+ onOpenChangeComplete,}: {+ open: boolean;dialog: Extract<PaletteHostDialog, { type: "batch-delete" }>;onClose: () => void;+ onOpenChangeComplete?: (open: boolean) => void;}) {const { t } = useT("issues");const batchDelete = useBatchDeleteIssues();@@ -90,7 +149,11 @@ function BatchDeleteDialog({}};return (- <AlertDialog open onOpenChange={(open) => !open && onClose()}>+ <AlertDialog+ open={open}+ onOpenChange={(nextOpen) => !nextOpen && onClose()}+ onOpenChangeComplete={onOpenChangeComplete}+ ><AlertDialogContent><AlertDialogHeader><AlertDialogTitle>{t(($) => $.batch.delete_dialog_title, { count })}</AlertDialogTitle>diff --git a/packages/views/search/search-command.tsx b/packages/views/search/search-command.tsxindex 69bed1f5c3..67cc15f448 100644--- a/packages/views/search/search-command.tsx+++ b/packages/views/search/search-command.tsx@@ -63,8 +63,10 @@ export function SearchCommand() {<DialogDescription>{t(($) => $.description)}</DialogDescription></DialogHeader>{/* The desktop shell survives workspace navigation. Reset its query,- selection and pending searches together with their workspace. */}- {open && <PaletteBody key={workspaceSlug} close={close} openHostDialog={openHostDialog} />}+ selection and pending searches together with their workspace.+ Base UI's Portal keeps the body mounted through the exit animation+ and unmounts it once closed, so no `{open && ...}` gate is needed. */}+ <PaletteBody key={workspaceSlug} active={open} close={close} openHostDialog={openHostDialog} /></DialogContent></Dialog><PaletteHostDialogs dialog={hostDialog} onClose={() => setHostDialog(null)} />@@ -73,9 +75,11 @@ export function SearchCommand() {}function PaletteBody({+ active,close,openHostDialog,}: {+ active: boolean;close: () => void;openHostDialog: (dialog: PaletteHostDialog) => void;}) {@@ -122,6 +126,7 @@ function PaletteBody({// Close on single ESC — capture phase fires before base-ui Dialog's handlersuseEffect(() => {+ if (!active) return;const handleEsc = (e: KeyboardEvent) => {if (e.key === "Escape") {e.preventDefault();@@ -131,7 +136,7 @@ function PaletteBody({};document.addEventListener("keydown", handleEsc, true);return () => document.removeEventListener("keydown", handleEsc, true);- }, [close]);+ }, [active, close]);return (<PaletteContext.Provider value={api}>@@ -167,6 +172,9 @@ function PaletteFrame({const current = stack[stack.length - 1] ?? null;const inputValue = current ? pageQuery : rawQuery;+ // Base UI's DialogPortal only mounts PaletteBody while open or exiting, so+ // keeping `active: true` does not fetch while closed and prevents recent+ // items and search results from clearing on frame 1 of the exit animation.const model = useRootModel(rawQuery, contexts, { active: true });const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {diff --git a/packages/views/settings/components/code-vcs.tsx b/packages/views/settings/components/code-vcs.tsxindex bfac2efd68..d6d8fc3703 100644--- a/packages/views/settings/components/code-vcs.tsx+++ b/packages/views/settings/components/code-vcs.tsx@@ -1,10 +1,11 @@"use client";-import { useState } from "react";+import { useEffect, useRef, useState } from "react";import { useQuery, useQueryClient } from "@tanstack/react-query";import { toast } from "sonner";-import { Copy, FolderGit2, GitBranch, MoreHorizontal, RefreshCw, Unplug } from "@multica/ui/icons";+import { FolderGit2, GitBranch, MoreHorizontal, RefreshCw, Unplug } from "@multica/ui/icons";import { Button } from "@multica/ui/components/ui/button";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { IconButton } from "@multica/ui/components/common/icon-button";import { Input } from "@multica/ui/components/ui/input";import { Label } from "@multica/ui/components/ui/label";@@ -436,6 +437,22 @@ function CopyField({copyLabel: string;mono?: boolean;}) {+ const [copied, setCopied] = useState(false);+ const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);++ useEffect(() => {+ return () => {+ if (timerRef.current) clearTimeout(timerRef.current);+ };+ }, []);++ const handleClick = () => {+ onCopy(value);+ setCopied(true);+ if (timerRef.current) clearTimeout(timerRef.current);+ timerRef.current = setTimeout(() => setCopied(false), 2000);+ };+return (<div className="space-y-1.5"><Label htmlFor={id} className="text-caption">@@ -452,10 +469,10 @@ function CopyField({variant="outline"size="icon-sm"className="shrink-0"- onClick={() => onCopy(value)}+ onClick={handleClick}label={`${copyLabel}: ${label}`}>- <Copy />+ <CopyCheckIcon copied={copied} /></IconButton></div></div>diff --git a/packages/views/settings/components/settings-layout.tsx b/packages/views/settings/components/settings-layout.tsxindex b20e4dca63..2081f55634 100644--- a/packages/views/settings/components/settings-layout.tsx+++ b/packages/views/settings/components/settings-layout.tsx@@ -8,6 +8,7 @@ import {type ReactNode,} from "react";import { createPortal } from "react-dom";+import { motion } from "motion/react";import {AlertCircle,Building2,@@ -20,7 +21,9 @@ import {UserRound,} from "@multica/ui/icons";import { useQuery } from "@tanstack/react-query";+import { useReducedMotion } from "@multica/core/appearance";import { Card, CardContent } from "@multica/ui/components/ui/card";+import { UI_INDICATOR_SPRING } from "@multica/ui/lib/motion";import { cn } from "@multica/ui/lib/utils";import { useCurrentWorkspace } from "@multica/core/paths";import { memberListOptions } from "@multica/core/workspace/queries";@@ -360,37 +363,55 @@ export function SettingsViewTabs<T extends string>({value: T;onChange: (value: T) => void;}) {+ const indicatorId = useId();+ const prefersReducedMotion = useReducedMotion();+ const transition = prefersReducedMotion ? { duration: 0 } : UI_INDICATOR_SPRING;+return (<divrole="tablist"aria-label={label}className="inline-flex w-fit items-center gap-0.5 rounded-lg bg-muted p-0.5">- {items.map((item) => (- <button- key={item.value}- type="button"- role="tab"- aria-selected={value === item.value}- onClick={() => onChange(item.value)}- className={cn(- "inline-flex h-7 items-center gap-1.5 rounded-md px-2.5 text-label font-medium transition-colors focus-visible:outline-2 focus-visible:outline-ring",- value === item.value- ? "bg-background text-foreground shadow-sm"- : "text-muted-foreground hover:text-foreground",- )}- >- {item.label}- {item.count !== undefined ? (- <>- {" "}- <span className="text-caption font-normal tabular-nums text-muted-foreground">- {item.count}- </span>- </>- ) : null}- </button>- ))}+ {items.map((item) => {+ const active = value === item.value;+ return (+ <button+ key={item.value}+ type="button"+ role="tab"+ aria-selected={active}+ onClick={() => onChange(item.value)}+ className={cn(+ "relative inline-flex h-7 items-center gap-1.5 rounded-md px-2.5 text-label font-medium transition-colors focus-visible:outline-2 focus-visible:outline-ring",+ active+ ? "text-foreground"+ : "text-muted-foreground hover:text-foreground",+ )}+ >+ {active && (+ <motion.span+ layoutId={indicatorId}+ transition={transition}+ aria-hidden="true"+ data-slot="settings-view-tabs-indicator"+ className="pointer-events-none absolute inset-0 rounded-md bg-background shadow-sm"+ />+ )}+ <span className="relative z-10 inline-flex items-center gap-1.5">+ {item.label}+ {item.count !== undefined ? (+ <>+ {" "}+ <span className="text-caption font-normal tabular-nums text-muted-foreground">+ {item.count}+ </span>+ </>+ ) : null}+ </span>+ </button>+ );+ })}</div>);}diff --git a/packages/views/settings/components/tokens-tab.tsx b/packages/views/settings/components/tokens-tab.tsxindex 986c6c8467..f96749b502 100644--- a/packages/views/settings/components/tokens-tab.tsx+++ b/packages/views/settings/components/tokens-tab.tsx@@ -1,7 +1,8 @@"use client";import { useEffect, useState, useCallback } from "react";-import { Trash2, Copy, Check, Info } from "@multica/ui/icons";+import { Trash2, Info } from "@multica/ui/icons";+import { CopyCheckIcon } from "@multica/ui/components/common/copy-check-icon";import { Tooltip, TooltipTrigger, TooltipContent } from "@multica/ui/components/ui/tooltip";import type { PersonalAccessToken } from "@multica/core/types";import { Alert, AlertDescription } from "@multica/ui/components/ui/alert";@@ -290,7 +291,7 @@ export function TokensTab() {onClick={handleCopyToken}aria-label={t(($) => $.tokens.created_dialog.copy_tooltip)}>- {tokenCopied ? <Check className="h-4 w-4" /> : <Copy className="h-4 w-4" />}+ <CopyCheckIcon copied={tokenCopied} className="size-4" /></Button>}/>@@ -312,7 +313,7 @@ export function TokensTab() {onClick={handleCopyCommand}aria-label={t(($) => $.tokens.created_dialog.copy_command_tooltip)}>- {commandCopied ? <Check className="h-4 w-4" /> : <Copy className="h-4 w-4" />}+ <CopyCheckIcon copied={commandCopied} className="size-4" /></Button>}/>diff --git a/packages/views/skills/components/skill-detail-page.test.tsx b/packages/views/skills/components/skill-detail-page.test.tsxindex 1e085da76e..f8a729ba54 100644--- a/packages/views/skills/components/skill-detail-page.test.tsx+++ b/packages/views/skills/components/skill-detail-page.test.tsx@@ -695,7 +695,7 @@ describe("SkillDetailPage draft baseline (MUL-5645)", () => {renderPage();fireEvent.change(await openDescription(), { target: { value: "edited" } });fireEvent.click(await screen.findByRole("button", { name: "Discard" }));- expect(screen.queryByText(/^Changed:/)).toBeNull();+ await vi.waitFor(() => expect(screen.queryByText(/^Changed:/)).toBeNull());});it("pulls a remote edit in silently while the draft is untouched", async () => {diff --git a/packages/views/skills/components/skill-detail-page.tsx b/packages/views/skills/components/skill-detail-page.tsxindex 73ed2f4e1a..a558c6309d 100644--- a/packages/views/skills/components/skill-detail-page.tsx+++ b/packages/views/skills/components/skill-detail-page.tsx@@ -8,6 +8,9 @@ import {useRef,useState,} from "react";+import { AnimatePresence, motion } from "motion/react";+import { useReducedMotion } from "@multica/core/appearance";+import { UI_EASE_OUT, UI_MOTION_DURATION } from "@multica/ui/lib/motion";import {AlertCircle,AlertTriangle,@@ -351,6 +354,7 @@ function UsedByList({ agents }: { agents: Agent[] }) {export function SkillDetailPage({ skillId }: { skillId: string }) {const { t } = useT("skills");const { t: tCommon } = useT("common");+ const prefersReducedMotion = useReducedMotion();const wsId = useWorkspaceId();const qc = useQueryClient();const paths = useWorkspacePaths();@@ -1103,48 +1107,60 @@ export function SkillDetailPage({ skillId }: { skillId: string }) {{/* Dirty-only and floating, matching the skills list batch toolbar;anchored to the page root (relative), NOT the viewport. */}- {canEdit && isDirty && (- <div- role="status"- aria-live="polite"- className="absolute bottom-6 left-1/2 z-50 flex -translate-x-1/2 animate-in items-center gap-1 rounded-lg border bg-background px-2 py-1.5 fade-in slide-in-from-bottom-2 shadow-lg max-md:above-chat-launcher"- >- <div className="mr-1 flex items-center border-r pl-1 pr-2">- <span className="whitespace-nowrap text-caption text-muted-foreground">- {t(($) => $.detail.save_bar.changed_summary, {- parts: changedParts.join(" · "),- })}- </span>- </div>- <Button- type="button"- variant="ghost"- size="xs"- onClick={handleDiscard}- disabled={saving}- >- {t(($) => $.detail.save_bar.discard)}- </Button>- <Button- type="button"- size="xs"- onClick={handleSave}- disabled={saving || !name.trim()}- >- {saving ? (- <>- <Loader2 className="h-3 w-3 animate-spin" />- {t(($) => $.detail.save_bar.saving)}- </>- ) : (- <>- <Save className="h-3 w-3" />- {t(($) => $.detail.save_bar.save)}- </>- )}- </Button>- </div>- )}+ <div className="pointer-events-none absolute bottom-6 left-1/2 z-50 -translate-x-1/2 max-md:above-chat-launcher">+ <AnimatePresence>+ {canEdit && isDirty && (+ <motion.div+ key="skill-save-bar"+ role="status"+ aria-live="polite"+ initial={{ opacity: 0, y: prefersReducedMotion ? 0 : 8 }}+ animate={{ opacity: 1, y: 0 }}+ exit={{ opacity: 0, y: prefersReducedMotion ? 0 : 8 }}+ transition={{+ duration: prefersReducedMotion ? 0 : UI_MOTION_DURATION.fast,+ ease: UI_EASE_OUT,+ }}+ className="pointer-events-auto flex items-center gap-1 rounded-lg border bg-background px-2 py-1.5 shadow-lg"+ >+ <div className="mr-1 flex items-center border-r pl-1 pr-2">+ <span className="whitespace-nowrap text-caption text-muted-foreground">+ {t(($) => $.detail.save_bar.changed_summary, {+ parts: changedParts.join(" · "),+ })}+ </span>+ </div>+ <Button+ type="button"+ variant="ghost"+ size="xs"+ onClick={handleDiscard}+ disabled={saving}+ >+ {t(($) => $.detail.save_bar.discard)}+ </Button>+ <Button+ type="button"+ size="xs"+ onClick={handleSave}+ disabled={saving || !name.trim()}+ >+ {saving ? (+ <>+ <Loader2 className="h-3 w-3 animate-spin" />+ {t(($) => $.detail.save_bar.saving)}+ </>+ ) : (+ <>+ <Save className="h-3 w-3" />+ {t(($) => $.detail.save_bar.save)}+ </>+ )}+ </Button>+ </motion.div>+ )}+ </AnimatePresence>+ </div>{/* Delete confirmation */}<Dialogdiff --git a/packages/views/voice/voice-ui.tsx b/packages/views/voice/voice-ui.tsxindex 544db27ab2..667eeef452 100644--- a/packages/views/voice/voice-ui.tsx+++ b/packages/views/voice/voice-ui.tsx@@ -1,11 +1,14 @@"use client";import { useEffect, useRef, type PointerEvent, type SyntheticEvent } from "react";+import { AnimatePresence, motion } from "motion/react";import { AlertCircle, Check, Mic, MicOff, RotateCcw, X } from "@multica/ui/icons";+import { useReducedMotion } from "@multica/core/appearance";import { Button } from "@multica/ui/components/ui/button";import { IconButton } from "@multica/ui/components/common/icon-button";import { ShimmerText } from "@multica/ui/components/common/shimmer-text";import { SubmitButton } from "@multica/ui/components/common/submit-button";+import { UI_EASE_OUT, UI_MOTION_DURATION } from "@multica/ui/lib/motion";import { cn } from "@multica/ui/lib/utils";import { createShortcutChord } from "@multica/core/shortcuts";import {@@ -287,31 +290,51 @@ export function VoiceStrip({ voice }: { voice: ComposerVoice }) {*/export function VoiceHud({ voice }: { voice: ComposerVoice }) {const { t } = useT("editor");+ const prefersReducedMotion = useReducedMotion();const phase = voice.session?.phase;- if (!voice.showHud) return null;return (<div className="pointer-events-none absolute bottom-full left-1/2 z-30 mb-3 -translate-x-1/2">- <div- role="status"- className="flex h-10 items-center gap-2.5 whitespace-nowrap rounded-full bg-multica-ink pl-3.5 pr-4 text-multica-paper shadow-[var(--floating-shadow)] animate-in fade-in zoom-in-95 slide-in-from-bottom-2"- >- {phase === "recording" ? (- <>- <RecDot className="bg-[#ff5a52]" />- <span className="sr-only">{t(($) => $.voice.recording)}</span>- <Waveform density="hud" className="w-[86px]" />- <Elapsed className="opacity-70" />- <span className="text-caption opacity-70">{t(($) => $.voice.release_to_insert)}</span>- </>- ) : (- <>- <Mic className="size-4 opacity-70" />- <span className="text-caption opacity-80">- {phase === "transcribing" ? t(($) => $.voice.transcribing) : t(($) => $.voice.requesting)}- </span>- </>+ <AnimatePresence>+ {voice.showHud && (+ <motion.div+ key="voice-hud"+ role="status"+ initial={{+ opacity: 0,+ y: prefersReducedMotion ? 0 : 6,+ scale: prefersReducedMotion ? 1 : 0.96,+ }}+ animate={{ opacity: 1, y: 0, scale: 1 }}+ exit={{+ opacity: 0,+ y: prefersReducedMotion ? 0 : 6,+ scale: prefersReducedMotion ? 1 : 0.96,+ }}+ transition={{+ duration: prefersReducedMotion ? 0 : UI_MOTION_DURATION.fast,+ ease: UI_EASE_OUT,+ }}+ className="flex h-10 items-center gap-2.5 whitespace-nowrap rounded-full bg-multica-ink pl-3.5 pr-4 text-multica-paper shadow-[var(--floating-shadow)]"+ >+ {phase === "recording" ? (+ <>+ <RecDot className="bg-[#ff5a52]" />+ <span className="sr-only">{t(($) => $.voice.recording)}</span>+ <Waveform density="hud" className="w-[86px]" />+ <Elapsed className="opacity-70" />+ <span className="text-caption opacity-70">{t(($) => $.voice.release_to_insert)}</span>+ </>+ ) : (+ <>+ <Mic className="size-4 opacity-70" />+ <span className="text-caption opacity-80">+ {phase === "transcribing" ? t(($) => $.voice.transcribing) : t(($) => $.voice.requesting)}+ </span>+ </>+ )}+ </motion.div>)}- </div>+ </AnimatePresence></div>);}diff --git a/packages/views/whats-new/whats-new-deck.tsx b/packages/views/whats-new/whats-new-deck.tsxindex 58cac4c70c..babefd88e2 100644--- a/packages/views/whats-new/whats-new-deck.tsx+++ b/packages/views/whats-new/whats-new-deck.tsx@@ -253,7 +253,7 @@ function Deck({onKeyDown={onKeyDown}className={cn("absolute right-[var(--chat-launcher-inset)] z-50 w-[min(23.75rem,calc(100%-2*var(--chat-launcher-inset)))]",- "animate-in fade-in-0 slide-in-from-bottom-3 duration-300 motion-reduce:animate-none",+ "animate-in fade-in-0 slide-in-from-bottom-3 duration-300 motion-reduce:animate-none motion-reduce:!transition-none",className,)}style={{@@ -292,7 +292,7 @@ function Deck({aria-hidden="true"onClick={offset === 1 ? () => go(i) : undefined}className={cn(- "absolute inset-0 bg-surface-raised transition-opacity duration-300",+ "absolute inset-0 bg-surface-raised transition-opacity duration-300 motion-reduce:transition-none",offset === 1 && "cursor-pointer",)}style={{ opacity: Math.min(offset, 2) * 0.28 }}@@ -387,7 +387,7 @@ function Dots({ count, index, onSelect }: { count: number; index: number; onSeleonClick={() => onSelect(i)}className={cn(// eslint-disable-next-line no-restricted-syntax -- page dots- "h-1.5 cursor-pointer rounded-full outline-none transition-[width,background-color] duration-200 focus-visible:ring-2 focus-visible:ring-ring/50",+ "h-1.5 cursor-pointer rounded-full outline-none transition-[width,background-color] duration-200 motion-reduce:transition-none focus-visible:ring-2 focus-visible:ring-ring/50",i === index ? "w-4 bg-foreground" : "w-1.5 bg-muted-foreground/30 hover:bg-muted-foreground/60",)}/>diff --git a/packages/views/workflows/handoff-confirm-dialog.tsx b/packages/views/workflows/handoff-confirm-dialog.tsxindex 3d0764dabc..c7e263c833 100644--- a/packages/views/workflows/handoff-confirm-dialog.tsx+++ b/packages/views/workflows/handoff-confirm-dialog.tsx@@ -60,12 +60,16 @@ function useDuration() {* or the workflow changed), the move applies without asking.*/export function WorkflowHandoffConfirmDialog({+ open: openProp,issue,toStatus,toProject,onCancel,onConfirm,+ onOpenChangeComplete,}: {+ /** Override open state while keeping issue data mounted for exit animation. */+ open?: boolean;/** The issue being moved; null keeps the dialog closed. */issue: { id: string; identifier: string } | null;/** The status being moved to; ignored with `toProject`. */@@ -73,6 +77,7 @@ export function WorkflowHandoffConfirmDialog({toProject?: { id: string; title: string } | null;onCancel: () => void;onConfirm: (options: { stopPreviousRuns: boolean }) => void;+ onOpenChangeComplete?: (open: boolean) => void;}) {const { t } = useT("issues");const wsId = useWorkspaceId();@@ -82,7 +87,7 @@ export function WorkflowHandoffConfirmDialog({const duration = useDuration();const [stop, setStop] = useState(true);const [briefOpen, setBriefOpen] = useState(false);- const open = issue !== null;+ const open = (openProp ?? true) && issue !== null;const { data: preview, isPending, isError } = useQuery({...workflowHandoffPreviewOptions(wsId, issue?.id ?? "", toProject ? "" : toStatus, toProject?.id),enabled: open,@@ -154,7 +159,11 @@ export function WorkflowHandoffConfirmDialog({}return (- <Dialog open={open && !(preview && !preview.handoff)} onOpenChange={(v) => !v && onCancel()}>+ <Dialog+ open={open && !(preview && !preview.handoff)}+ onOpenChange={(v) => !v && onCancel()}+ onOpenChangeComplete={onOpenChangeComplete}+ ><DialogContent className="sm:max-w-xl"><DialogHeader><DialogTitle>