Skip to content

AI-native design editor. Open-source Figma alternative.

feat(settings): centralize motion policy and add animation preference

Danila Poyarkov70341c33a15e
diff --git a/AGENTS.md b/AGENTS.md
index 10028b174..35305a013 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -232,6 +232,8 @@ Keep responsibilities distinct: engine tests cover state contracts, Playwright b
### Animations
+Motion policy lives in `src/app/shell/motion/`: resolve persisted System/Off preference and OS reduction once. The root `data-motion` attribute and the app's Tailwind `motion-safe`/`motion-reduce` variants represent this effective policy, including portalled content. Store-free presets/treatments live in `src/theme/motion/`; compose them into owning themes. Use the policy-aware Motion adapters for shared or feature-specific transitions rather than repeating preference conditionals in components. Keep what moves, geometry, and genuinely feature-specific spring values local.
+
- Use Tailwind transitions and `tw-animate-css` for simple visual state changes and enter/exit animations. Use the existing `motion-v` dependency for gesture-driven motion, coordinated layout changes, and springs; do not add another animation library.
- Use Reka state attributes and measured CSS variables for collapsibles. The utilities are `animate-collapsible-down` and `animate-collapsible-up`; keep padding and borders inside the animated height wrapper so they do not snap during collapse.
- Respect `prefers-reduced-motion` in both CSS and Motion. Disable or simplify nonessential motion while preserving state changes and interaction feedback.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6b315612b..b0bfcc0d1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -36,6 +36,7 @@
### Changed
+- Choose whether interface animations follow the system motion preference or stay off, with live updates and a persistent override.
- Put unbound fill and stroke style pickers in section headers, preserve applied and missing style rows, and remove the redundant Dimensions heading for text layers.
- Open variable pickers below their trigger when space permits, flipping above near the viewport edge.
- Keep AI chat preferences with the model overview and edit models in a fixed-size Settings pane with explicit Save and Cancel actions.
diff --git a/packages/vue/src/i18n/locales/de/settings.json b/packages/vue/src/i18n/locales/de/settings.json
index 9856ec3f5..659ef1e5e 100644
--- a/packages/vue/src/i18n/locales/de/settings.json
+++ b/packages/vue/src/i18n/locales/de/settings.json
@@ -19,5 +19,8 @@
"diagnostics": "Diagnose",
"media": "Medien",
"automation": "MCP & Automatisierung",
- "storage": "Cloud-Speicher"
+ "storage": "Cloud-Speicher",
+ "animations": "Animationen",
+ "animationsSystem": "Systemeinstellung",
+ "animationsOff": "Aus"
}
diff --git a/packages/vue/src/i18n/locales/es/settings.json b/packages/vue/src/i18n/locales/es/settings.json
index 8c3a491fb..89f763986 100644
--- a/packages/vue/src/i18n/locales/es/settings.json
+++ b/packages/vue/src/i18n/locales/es/settings.json
@@ -19,5 +19,8 @@
"diagnostics": "Diagnóstico",
"media": "Multimedia",
"automation": "MCP y automatización",
- "storage": "Almacenamiento en la nube"
+ "storage": "Almacenamiento en la nube",
+ "animations": "Animaciones",
+ "animationsSystem": "Seguir al sistema",
+ "animationsOff": "Desactivadas"
}
diff --git a/packages/vue/src/i18n/locales/fr/settings.json b/packages/vue/src/i18n/locales/fr/settings.json
index 350fa09a4..4bda03649 100644
--- a/packages/vue/src/i18n/locales/fr/settings.json
+++ b/packages/vue/src/i18n/locales/fr/settings.json
@@ -19,5 +19,8 @@
"diagnostics": "Diagnostics",
"media": "Médias",
"automation": "MCP et automatisation",
- "storage": "Stockage cloud"
+ "storage": "Stockage cloud",
+ "animations": "Animations",
+ "animationsSystem": "Suivre le système",
+ "animationsOff": "Désactivées"
}
diff --git a/packages/vue/src/i18n/locales/it/settings.json b/packages/vue/src/i18n/locales/it/settings.json
index 028af3b12..5934c7fcd 100644
--- a/packages/vue/src/i18n/locales/it/settings.json
+++ b/packages/vue/src/i18n/locales/it/settings.json
@@ -19,5 +19,8 @@
"diagnostics": "Diagnostica",
"media": "Media",
"automation": "MCP e automazione",
- "storage": "Archiviazione cloud"
+ "storage": "Archiviazione cloud",
+ "animations": "Animazioni",
+ "animationsSystem": "Segui il sistema",
+ "animationsOff": "Disattivate"
}
diff --git a/packages/vue/src/i18n/locales/ja/settings.json b/packages/vue/src/i18n/locales/ja/settings.json
index 329184b5d..43c14c599 100644
--- a/packages/vue/src/i18n/locales/ja/settings.json
+++ b/packages/vue/src/i18n/locales/ja/settings.json
@@ -19,5 +19,8 @@
"diagnostics": "診断",
"media": "メディア",
"automation": "MCP と自動化",
- "storage": "クラウドストレージ"
+ "storage": "クラウドストレージ",
+ "animations": "アニメーション",
+ "animationsSystem": "システム設定に従う",
+ "animationsOff": "オフ"
}
diff --git a/packages/vue/src/i18n/locales/pl/settings.json b/packages/vue/src/i18n/locales/pl/settings.json
index 606a75123..d057a18ef 100644
--- a/packages/vue/src/i18n/locales/pl/settings.json
+++ b/packages/vue/src/i18n/locales/pl/settings.json
@@ -19,5 +19,8 @@
"diagnostics": "Diagnostyka",
"media": "Media",
"automation": "MCP i automatyzacja",
- "storage": "Przechowywanie w chmurze"
+ "storage": "Przechowywanie w chmurze",
+ "animations": "Animacje",
+ "animationsSystem": "Zgodnie z systemem",
+ "animationsOff": "Wyłączone"
}
diff --git a/packages/vue/src/i18n/locales/ru/settings.json b/packages/vue/src/i18n/locales/ru/settings.json
index 2a0ff92ed..1d3b425a8 100644
--- a/packages/vue/src/i18n/locales/ru/settings.json
+++ b/packages/vue/src/i18n/locales/ru/settings.json
@@ -19,5 +19,8 @@
"diagnostics": "Диагностика",
"media": "Медиа",
"automation": "MCP и автоматизация",
- "storage": "Облачное хранилище"
+ "storage": "Облачное хранилище",
+ "animations": "Анимации",
+ "animationsSystem": "Как в системе",
+ "animationsOff": "Выключены"
}
diff --git a/packages/vue/src/i18n/locales/zh-cn/settings.json b/packages/vue/src/i18n/locales/zh-cn/settings.json
index 31605f2ea..81677d57e 100644
--- a/packages/vue/src/i18n/locales/zh-cn/settings.json
+++ b/packages/vue/src/i18n/locales/zh-cn/settings.json
@@ -19,5 +19,8 @@
"diagnostics": "诊断",
"media": "媒体",
"automation": "MCP 与自动化",
- "storage": "云存储"
+ "storage": "云存储",
+ "animations": "动画",
+ "animationsSystem": "跟随系统",
+ "animationsOff": "关闭"
}
diff --git a/packages/vue/src/i18n/messages/settings.ts b/packages/vue/src/i18n/messages/settings.ts
index 7982d6948..9400f88ef 100644
--- a/packages/vue/src/i18n/messages/settings.ts
+++ b/packages/vue/src/i18n/messages/settings.ts
@@ -1,6 +1,9 @@
import { i18n } from '#vue/i18n/create'
export const settingsMessageDefaults = {
+ animations: 'Animations',
+ animationsSystem: 'Follow system',
+ animationsOff: 'Off',
title: 'Settings',
description: 'Manage integrations and app preferences.',
general: 'General',
diff --git a/src/App.vue b/src/App.vue
index 84e1c5e03..884ccca38 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,12 +1,14 @@
<script setup lang="ts">
import { useHead } from '@unhead/vue'
import { useEventListener } from '@vueuse/core'
+import { MotionConfig } from 'motion-v'
import { TooltipProvider } from 'reka-ui'
-import { onMounted } from 'vue'
+import { computed, onMounted } from 'vue'
import { provideEditor, useI18n } from '@open-pencil/vue'
import { useEditorStore } from '@/app/editor/active-store'
+import { animationsEnabled } from '@/app/shell/motion'
import { useAppTheme } from '@/app/shell/theme'
import { toast } from '@/app/shell/ui'
import { scheduleStartupUpdateCheck } from '@/app/shell/updater'
@@ -24,7 +26,10 @@ const { updates, locale } = useI18n()
useHead({
titleTemplate: (title) => (title ? `${title} — OpenPencil` : 'OpenPencil'),
- htmlAttrs: { lang: locale }
+ htmlAttrs: {
+ lang: locale,
+ 'data-motion': computed(() => (animationsEnabled.value ? 'full' : 'off'))
+ }
})
provideEditor(store)
@@ -41,14 +46,16 @@ onMounted(() => {
</script>
<template>
- <TooltipProvider :delay-duration="400">
- <AppShell>
- <RouterView />
- </AppShell>
- <SettingsDialog />
- <RecoveryDialog />
- <PublishLibraryDialog />
- <LibraryUpdateReviewDialog />
- <AppToast />
- </TooltipProvider>
+ <MotionConfig :reduced-motion="animationsEnabled ? 'never' : 'always'">
+ <TooltipProvider :delay-duration="400">
+ <AppShell>
+ <RouterView />
+ </AppShell>
+ <SettingsDialog />
+ <RecoveryDialog />
+ <PublishLibraryDialog />
+ <LibraryUpdateReviewDialog />
+ <AppToast />
+ </TooltipProvider>
+ </MotionConfig>
</template>
diff --git a/src/app.css b/src/app.css
index ddb7affd5..f28f4540f 100644
--- a/src/app.css
+++ b/src/app.css
@@ -3,6 +3,23 @@
@import 'vue-stream-markdown/index.css' layer(components);
@import './theme/chat/markdown.css';
+@custom-variant motion-safe {
+ @media (prefers-reduced-motion: no-preference) {
+ &:where(:root:not([data-motion='off']), :root:not([data-motion='off']) *) {
+ @slot;
+ }
+ }
+}
+
+@custom-variant motion-reduce {
+ @media (prefers-reduced-motion: reduce) {
+ @slot;
+ }
+ &:where([data-motion='off'], [data-motion='off'] *) {
+ @slot;
+ }
+}
+
@utility scrollbar-none {
-ms-overflow-style: none;
scrollbar-width: none;
diff --git a/src/app/settings/preferences/store.ts b/src/app/settings/preferences/store.ts
index 3710cef51..1fb016957 100644
--- a/src/app/settings/preferences/store.ts
+++ b/src/app/settings/preferences/store.ts
@@ -2,11 +2,14 @@ import { useLocalStorage } from '@vueuse/core'
import { DEFAULT_SNAPPING_PREFERENCES, type SnappingPreferences } from '@open-pencil/core/editor'
+export type AnimationPreference = 'system' | 'off'
+
export type ReasoningDisplay = 'collapsed' | 'while-thinking' | 'expanded'
export type CanvasRenderingMode = 'retained' | 'tiled'
export interface AppPreferences {
+ appearance: { animations: AnimationPreference }
chat: { reasoningDisplay: ReasoningDisplay }
version: 1
recovery: {
@@ -21,6 +24,7 @@ export interface AppPreferences {
}
export const DEFAULT_APP_PREFERENCES: Readonly<AppPreferences> = {
+ appearance: { animations: 'system' },
chat: { reasoningDisplay: 'collapsed' },
version: 1,
recovery: { enabled: true },
@@ -43,6 +47,7 @@ interface StoredSnappingPreferences {
}
interface StoredAppPreferences {
+ appearance?: { animations?: unknown }
chat?: { reasoningDisplay?: unknown }
recovery?: { enabled?: unknown }
editing?: { snapping?: StoredSnappingPreferences }
@@ -53,11 +58,16 @@ function isStoredAppPreferences(value: unknown): value is StoredAppPreferences {
return Boolean(value) && typeof value === 'object' && !Array.isArray(value)
}
+function normalizeAnimationPreference(value: unknown): AnimationPreference {
+ return value === 'off' ? 'off' : 'system'
+}
+
function normalizePreferences(value: unknown): AppPreferences {
const stored = isStoredAppPreferences(value) ? value : undefined
const snapping = stored?.editing?.snapping
return {
+ appearance: { animations: normalizeAnimationPreference(stored?.appearance?.animations) },
chat: {
reasoningDisplay:
stored?.chat?.reasoningDisplay === 'expanded' ||
@@ -97,6 +107,10 @@ export const appPreferences = useLocalStorage<AppPreferences>(
{ mergeDefaults: (storageValue) => normalizePreferences(storageValue) }
)
+export function updateAnimationPreference(animations: AnimationPreference): void {
+ appPreferences.value = { ...appPreferences.value, appearance: { animations } }
+}
+
export function updateRecoveryEnabled(enabled: boolean): void {
const preferences = structuredClone(appPreferences.value)
preferences.recovery.enabled = enabled
diff --git a/src/app/shell/motion/index.ts b/src/app/shell/motion/index.ts
new file mode 100644
index 000000000..823289ca7
--- /dev/null
+++ b/src/app/shell/motion/index.ts
@@ -0,0 +1,13 @@
+import { usePreferredReducedMotion } from '@vueuse/core'
+import { computed } from 'vue'
+
+import { appPreferences, updateAnimationPreference } from '@/app/settings/preferences/store'
+
+const preferredMotion = usePreferredReducedMotion()
+export const animationPreference = computed({
+ get: () => appPreferences.value.appearance.animations,
+ set: updateAnimationPreference
+})
+export const animationsEnabled = computed(
+ () => animationPreference.value === 'system' && preferredMotion.value !== 'reduce'
+)
diff --git a/src/app/shell/motion/transitions.ts b/src/app/shell/motion/transitions.ts
new file mode 100644
index 000000000..37cdf6e22
--- /dev/null
+++ b/src/app/shell/motion/transitions.ts
@@ -0,0 +1,20 @@
+import type { Transition } from 'motion-v'
+import { computed, toValue, type MaybeRefOrGetter } from 'vue'
+
+import { animationsEnabled } from '@/app/shell/motion'
+import { motionTransitions, resolveMotionTransition } from '@/theme/motion/transitions'
+
+/** App adapter: presets stay store-free; this binds them to the effective motion policy. */
+export function useMotionTransitions() {
+ const quick = computed(() =>
+ resolveMotionTransition(animationsEnabled.value, motionTransitions.quick)
+ )
+ const layout = computed(() => ({
+ layout: resolveMotionTransition(animationsEnabled.value, motionTransitions.layout)
+ }))
+ return { quick, layout }
+}
+
+export function useMotionTransition(transition: MaybeRefOrGetter<Transition>) {
+ return computed(() => resolveMotionTransition(animationsEnabled.value, toValue(transition)))
+}
diff --git a/src/components/MobileDrawer.vue b/src/components/MobileDrawer.vue
index 0055578a5..698f2d472 100644
--- a/src/components/MobileDrawer.vue
+++ b/src/components/MobileDrawer.vue
@@ -8,6 +8,7 @@ import { computed, ref } from 'vue'
import { useI18n } from '@open-pencil/vue'
import { useEditorStore } from '@/app/editor/active-store'
+import { useMotionTransition } from '@/app/shell/motion/transitions'
import {
DRAWER_SPRING_DAMPING,
DRAWER_SPRING_STIFFNESS,
@@ -106,11 +107,11 @@ function onPanEnd(_e: PointerEvent, info: PanInfo) {
targetHeight.value = snapHeight(snap.value)
}
-const drawerTransition = {
- type: 'spring' as const,
+const drawerTransition = useMotionTransition({
+ type: 'spring',
stiffness: DRAWER_SPRING_STIFFNESS,
damping: DRAWER_SPRING_DAMPING
-}
+})
</script>
<template>
diff --git a/src/components/MobileHud/MobileActionToast.vue b/src/components/MobileHud/MobileActionToast.vue
index 9baa3ca79..e6d154154 100644
--- a/src/components/MobileHud/MobileActionToast.vue
+++ b/src/components/MobileHud/MobileActionToast.vue
@@ -1,14 +1,12 @@
<script setup lang="ts">
import { useMobileHudContext } from '@/components/MobileHud/context'
+import { feedbackTransition } from '@/theme/motion/styles'
const hud = useMobileHudContext()
</script>
<template>
- <Transition
- enter-active-class="animate-in fade-in duration-150"
- leave-active-class="animate-out fade-out duration-200"
- >
+ <Transition v-bind="feedbackTransition">
<div
v-if="hud.actionToast"
:key="hud.actionToast"
diff --git a/src/components/MobileHud/MobileActiveToolBadge.vue b/src/components/MobileHud/MobileActiveToolBadge.vue
index 770375851..c79f4455f 100644
--- a/src/components/MobileHud/MobileActiveToolBadge.vue
+++ b/src/components/MobileHud/MobileActiveToolBadge.vue
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { useMobileHudContext } from '@/components/MobileHud/context'
+import { feedbackTransition } from '@/theme/motion/styles'
const hud = useMobileHudContext()
</script>
@@ -8,11 +9,7 @@ const hud = useMobileHudContext()
<div
class="flex size-8 items-center justify-center rounded-full border border-accent/20 bg-panel/70 shadow-md backdrop-blur-xl transition-colors duration-200"
>
- <Transition
- mode="out-in"
- enter-active-class="animate-in fade-in zoom-in-75 duration-150"
- leave-active-class="animate-out fade-out zoom-out-75 duration-150"
- >
+ <Transition mode="out-in" v-bind="feedbackTransition">
<component
:is="hud.activeToolIcon"
:key="hud.store.state.activeTool"
diff --git a/src/components/Toolbar/MobileToolbar.vue b/src/components/Toolbar/MobileToolbar.vue
index 995fe8a56..178108084 100644
--- a/src/components/Toolbar/MobileToolbar.vue
+++ b/src/components/Toolbar/MobileToolbar.vue
@@ -9,6 +9,8 @@ import type { EditorToolDef } from '@open-pencil/core/editor'
import { getToolbarToolSelection, toolbarToolTestId, ToolbarItem } from '@open-pencil/vue'
import type { Tool } from '@open-pencil/vue'
+import { animationsEnabled } from '@/app/shell/motion'
+import { useMotionTransitions } from '@/app/shell/motion/transitions'
import ToolbarActionGroup from '@/components/Toolbar/ToolbarActionGroup.vue'
import ToolButton from '@/components/Toolbar/ToolButton.vue'
import ToolFlyout from '@/components/Toolbar/ToolFlyout.vue'
@@ -60,6 +62,8 @@ const emit = defineEmits<{
action: [item: ToolbarActionItem]
}>()
+const { quick: itemTransition, layout: layoutTransition } = useMotionTransitions()
+
const slideVariants = {
initial: (dir: unknown) => ({ opacity: 0, x: (dir as number) * 20 }),
animate: { opacity: 1, x: 0 },
@@ -86,7 +90,7 @@ function navigationClass(disabled: boolean) {
:data-disabled="!hasPrev || undefined"
:class="navigationClass(!hasPrev)"
:animate="{ opacity: hasPrev ? 1 : 0 }"
- :transition="{ duration: 0.15 }"
+ :transition="itemTransition"
@click="emit('prev')"
>
<IconChevronLeft :class="styles.navigationIcon({ class: ui?.navigationIcon })" />
@@ -94,10 +98,10 @@ function navigationClass(disabled: boolean) {
<ToolbarRoot as-child>
<motion.div
- layout
+ :layout="animationsEnabled"
data-test-id="mobile-toolbar-container"
class="relative flex h-11 items-center overflow-hidden rounded-[8px] border border-border bg-panel px-2 shadow-lg"
- :transition="{ layout: { type: 'spring', damping: 30, stiffness: 500 } }"
+ :transition="layoutTransition"
>
<AnimatePresence mode="popLayout" :custom="slideDirection">
<motion.div
@@ -109,7 +113,7 @@ function navigationClass(disabled: boolean) {
initial="initial"
animate="animate"
exit="exit"
- :transition="{ duration: 0.15 }"
+ :transition="itemTransition"
>
<template v-for="tool in tools" :key="tool.key">
<ToolFlyout
@@ -151,7 +155,7 @@ function navigationClass(disabled: boolean) {
initial="initial"
animate="animate"
exit="exit"
- :transition="{ duration: 0.15 }"
+ :transition="itemTransition"
>
<ToolbarActionGroup
:actions="editActions"
@@ -170,7 +174,7 @@ function navigationClass(disabled: boolean) {
initial="initial"
animate="animate"
exit="exit"
- :transition="{ duration: 0.15 }"
+ :transition="itemTransition"
>
<ToolbarActionGroup
:actions="arrangeActions"
@@ -189,7 +193,7 @@ function navigationClass(disabled: boolean) {
:data-disabled="!hasNext || undefined"
:class="navigationClass(!hasNext)"
:animate="{ opacity: hasNext ? 1 : 0 }"
- :transition="{ duration: 0.15 }"
+ :transition="itemTransition"
@click="emit('next')"
>
<IconChevronRight :class="styles.navigationIcon({ class: ui?.navigationIcon })" />
diff --git a/src/components/assets-panel/AssetsPanel.vue b/src/components/assets-panel/AssetsPanel.vue
index ab742d8c1..dd433072d 100644
--- a/src/components/assets-panel/AssetsPanel.vue
+++ b/src/components/assets-panel/AssetsPanel.vue
@@ -546,7 +546,7 @@ async function insertSelectedAsset() {
<div v-else class="text-center">
<icon-lucide-loader-2
v-if="previewLoading"
- class="mx-auto size-5 animate-spin text-muted"
+ class="mx-auto size-5 animate-spin motion-reduce:animate-none text-muted"
/>
<component
v-else
diff --git a/src/components/canvas/CanvasMenu.vue b/src/components/canvas/CanvasMenu.vue
index b24eab647..03781b0b3 100644
--- a/src/components/canvas/CanvasMenu.vue
+++ b/src/components/canvas/CanvasMenu.vue
@@ -58,7 +58,8 @@ function removeSelectedGuide() {
}
const menuCls = useMenuUI({
- content: 'min-w-56 shadow-[0_8px_30px_rgb(0_0_0/0.4)] animate-in fade-in zoom-in-95',
+ content:
+ 'min-w-56 shadow-[0_8px_30px_rgb(0_0_0/0.4)] animate-in fade-in zoom-in-95 motion-reduce:animate-none',
separator: 'my-1'
})
const componentMenu = menu({ tone: 'component' })
diff --git a/src/components/chat/ChatMarkdown.vue b/src/components/chat/ChatMarkdown.vue
index 73fffbf18..418c7a0d2 100644
--- a/src/components/chat/ChatMarkdown.vue
+++ b/src/components/chat/ChatMarkdown.vue
@@ -6,6 +6,7 @@ import { IS_BROWSER } from '@open-pencil/core/constants'
import { createMarkdownHardenOptions, markdownExtensions } from '@/app/shell/markdown/config'
import { markdownRenderKey, type MarkdownSurface } from '@/app/shell/markdown/state'
+import { animationsEnabled } from '@/app/shell/motion'
import { resolvedAppTheme } from '@/app/shell/theme'
import InlineCode from '@/components/chat/markdown/InlineCode.vue'
import { chatMarkdownTheme } from '@/theme/chat/markdown'
@@ -36,6 +37,7 @@ const renderKey = computed(() => markdownRenderKey({ mode, surface }))
:components="markdownComponents"
:content="content"
:is-dark="isDark"
+ :enable-animate="animationsEnabled"
:mode="mode"
:extensions="markdownExtensions"
:harden-options="hardenOptions"
diff --git a/src/components/chat/ChatMessage.vue b/src/components/chat/ChatMessage.vue
index cc7dac948..299df0c51 100644
--- a/src/components/chat/ChatMessage.vue
+++ b/src/components/chat/ChatMessage.vue
@@ -118,7 +118,7 @@ function partKey(part: UIMessagePart<UIDataTypes, UITools>, index: number): stri
>
<icon-lucide-loader-circle
v-if="toolState(part) === 'pending'"
- class="size-3 animate-spin"
+ class="size-3 animate-spin motion-reduce:animate-none"
/>
<icon-lucide-check v-else-if="toolState(part) === 'done'" class="size-3" />
<icon-lucide-triangle-alert v-else class="size-3" />
diff --git a/src/components/chat/ChatTranscript.vue b/src/components/chat/ChatTranscript.vue
index 26821689c..0f1dde17d 100644
--- a/src/components/chat/ChatTranscript.vue
+++ b/src/components/chat/ChatTranscript.vue
@@ -78,13 +78,15 @@ const { arrivedState, resumeFollowing } = useScrollFollowing(
AI
</div>
<div class="flex items-center gap-1 py-2">
- <span class="size-1.5 animate-bounce rounded-full bg-muted" />
<span
- class="size-1.5 animate-bounce rounded-full bg-muted"
+ class="size-1.5 animate-bounce motion-reduce:animate-none rounded-full bg-muted"
+ />
+ <span
+ class="size-1.5 animate-bounce motion-reduce:animate-none rounded-full bg-muted"
:style="{ animationDelay: '150ms' }"
/>
<span
- class="size-1.5 animate-bounce rounded-full bg-muted"
+ class="size-1.5 animate-bounce motion-reduce:animate-none rounded-full bg-muted"
:style="{ animationDelay: '300ms' }"
/>
</div>
diff --git a/src/components/home/HomeWorkspace.vue b/src/components/home/HomeWorkspace.vue
index 0a38c1030..89e8c8fb7 100644
--- a/src/components/home/HomeWorkspace.vue
+++ b/src/components/home/HomeWorkspace.vue
@@ -277,7 +277,11 @@ function formattedDate(updatedAt: string): string {
class="grid grid-cols-1 gap-x-5 gap-y-6 sm:grid-cols-[repeat(auto-fill,minmax(200px,1fr))]"
:aria-label="storage.loadingWorkspace"
>
- <div v-for="index in 3" :key="index" class="min-w-0 animate-pulse">
+ <div
+ v-for="index in 3"
+ :key="index"
+ class="min-w-0 animate-pulse motion-reduce:animate-none"
+ >
<div class="aspect-video rounded-lg border border-border bg-panel-field" />
<div class="mt-2 h-3 w-2/3 rounded bg-panel-field" />
<div class="mt-1.5 h-2.5 w-1/3 rounded bg-panel-field" />
diff --git a/src/components/libraries/review/LibraryComparisonPreview.vue b/src/components/libraries/review/LibraryComparisonPreview.vue
index 956866159..c8ad32602 100644
--- a/src/components/libraries/review/LibraryComparisonPreview.vue
+++ b/src/components/libraries/review/LibraryComparisonPreview.vue
@@ -34,5 +34,5 @@ watch(
<template>
<img v-if="url" :src="url" :alt="alt" class="max-h-[60vh] max-w-[80%] object-contain" />
- <icon-lucide-loader-2 v-else class="size-5 animate-spin text-muted" />
+ <icon-lucide-loader-2 v-else class="size-5 animate-spin motion-reduce:animate-none text-muted" />
</template>
diff --git a/src/components/preparation/canvas/Overlay.vue b/src/components/preparation/canvas/Overlay.vue
index 91d921aaf..d5a1c25f8 100644
--- a/src/components/preparation/canvas/Overlay.vue
+++ b/src/components/preparation/canvas/Overlay.vue
@@ -37,7 +37,7 @@ const progressSteps = computed(() => Math.round(progressValue.value ?? 0))
>
<ProgressIndicator
v-if="progressValue === null"
- class="h-full w-2/5 animate-[slide_1s_ease-in-out_infinite] rounded-full bg-surface/25"
+ class="h-full w-2/5 animate-[slide_1s_ease-in-out_infinite] motion-reduce:animate-none rounded-full bg-surface/25"
/>
<div v-else class="flex h-full w-full">
<span
diff --git a/src/components/preparation/tab/Indicator.vue b/src/components/preparation/tab/Indicator.vue
index f9879683c..a68d23121 100644
--- a/src/components/preparation/tab/Indicator.vue
+++ b/src/components/preparation/tab/Indicator.vue
@@ -3,6 +3,7 @@ import { computed } from 'vue'
import type { EditorPreparationProgress } from '@/app/editor/preparation/types'
import { preparationPercent } from '@/components/preparation/presentation'
+import { motionStyles } from '@/theme/motion/styles'
const { progress } = defineProps<{
progress: EditorPreparationProgress | null
@@ -20,6 +21,6 @@ const percent = computed(() => preparationPercent(progress))
aria-label="Preparing document"
class="relative flex size-3 shrink-0 items-center justify-center text-accent"
>
- <icon-lucide-loader-circle class="size-3 animate-spin" />
+ <icon-lucide-loader-circle class="size-3" :class="motionStyles.spinner" />
</span>
</template>
diff --git a/src/components/properties/component-properties/instance-update/InstanceUpdateAction.vue b/src/components/properties/component-properties/instance-update/InstanceUpdateAction.vue
index e31a7ab17..e66e6abef 100644
--- a/src/components/properties/component-properties/instance-update/InstanceUpdateAction.vue
+++ b/src/components/properties/component-properties/instance-update/InstanceUpdateAction.vue
@@ -43,7 +43,10 @@ const { available, updating, updateSelectedInstance } = useInstanceUpdate(
:disabled="updating"
:aria-label="panels.updateSelectedInstance"
>
- <icon-lucide-refresh-cw class="size-3.5" :class="updating ? 'animate-spin' : ''" />
+ <icon-lucide-refresh-cw
+ :data-loading="updating"
+ class="size-3.5 data-[loading=true]:animate-spin motion-reduce:data-[loading=true]:animate-none"
+ />
</button>
</DropdownMenuTrigger>
</Tip>
diff --git a/src/components/settings/general/GeneralSettingsPanel.vue b/src/components/settings/general/GeneralSettingsPanel.vue
index 6c102efc8..87351ea65 100644
--- a/src/components/settings/general/GeneralSettingsPanel.vue
+++ b/src/components/settings/general/GeneralSettingsPanel.vue
@@ -6,6 +6,7 @@ import { type Locale, useI18n } from '@open-pencil/vue'
import { recoveryEnabled, setRecoveryEnabled } from '@/app/document/recovery/preferences'
import { setSnappingPreference } from '@/app/settings/preferences/apply'
import { appPreferences } from '@/app/settings/preferences/store'
+import { animationPreference } from '@/app/shell/motion'
import CredentialSettingsSection from '@/components/settings/credentials/CredentialSettingsSection.vue'
import RenderingSettingsSection from '@/components/settings/general/RenderingSettingsSection.vue'
import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'
@@ -66,6 +67,21 @@ const snapToPixelGrid = computed({
</label>
</div>
+ <SettingsGroup>
+ <label class="flex items-center justify-between gap-4 px-3 py-2.5">
+ <span class="text-xs text-surface">{{ settings.animations }}</span>
+ <AppSelect
+ v-model="animationPreference"
+ :label="settings.animations"
+ :options="[
+ { value: 'system', label: settings.animationsSystem },
+ { value: 'off', label: settings.animationsOff }
+ ]"
+ class="w-44"
+ />
+ </label>
+ </SettingsGroup>
+
<SettingsSectionHeader>
{{ recovery.settingsTitle }}
<template #description>{{ recovery.settingsDescription }}</template>
diff --git a/src/components/ui/button/AppButton.vue b/src/components/ui/button/AppButton.vue
index 578083abf..f444857e8 100644
--- a/src/components/ui/button/AppButton.vue
+++ b/src/components/ui/button/AppButton.vue
@@ -8,6 +8,7 @@ import {
type AppButtonSize,
type AppButtonVariant
} from '@/theme/button/button'
+import { motionStyles } from '@/theme/motion/styles'
const {
color = 'neutral',
@@ -56,7 +57,7 @@ const isDisabled = computed(() => disabled || loading)
:class="styles.base"
>
<span v-if="loading" data-slot="loading-icon" :class="styles.icon">
- <icon-lucide-loader-2 class="animate-spin" />
+ <icon-lucide-loader-2 :class="motionStyles.spinner" />
</span>
<span v-else-if="$slots.leading" data-slot="leading-icon" :class="styles.icon">
<slot name="leading" />
diff --git a/src/components/ui/feedback/toast.ts b/src/components/ui/feedback/toast.ts
index 7e0778c0e..dce3a8bf3 100644
--- a/src/components/ui/feedback/toast.ts
+++ b/src/components/ui/feedback/toast.ts
@@ -4,7 +4,7 @@ import { tv } from 'tailwind-variants'
export type ToastVariant = 'default' | 'warning' | 'error'
const toast = tv({
- base: 'flex max-w-sm items-start gap-1.5 rounded-md px-2.5 py-1.5 text-xs shadow-md data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:slide-out-to-top-1 data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:slide-in-from-top-1 data-[swipe=cancel]:translate-y-0 data-[swipe=cancel]:transition-transform data-[swipe=move]:translate-y-[var(--reka-toast-swipe-move-y)]',
+ base: 'motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none flex max-w-sm items-start gap-1.5 rounded-md px-2.5 py-1.5 text-xs shadow-md data-[state=closed]:animate-out data-[state=closed]:fade-out data-[state=closed]:slide-out-to-top-1 data-[state=open]:animate-in data-[state=open]:fade-in data-[state=open]:slide-in-from-top-1 data-[swipe=cancel]:translate-y-0 data-[swipe=cancel]:transition-transform data-[swipe=move]:translate-y-[var(--reka-toast-swipe-move-y)]',
variants: {
tone: {
default: 'bg-accent text-white',
diff --git a/src/components/ui/overlay/Tip.vue b/src/components/ui/overlay/Tip.vue
index e8dd660bf..d1f4cd896 100644
--- a/src/components/ui/overlay/Tip.vue
+++ b/src/components/ui/overlay/Tip.vue
@@ -5,6 +5,7 @@ import type { ComponentPublicInstance } from 'vue'
import { computed, nextTick, ref, watch } from 'vue'
import { useTooltipUI } from '@/components/ui/overlay/tooltip'
+import { motionStyles } from '@/theme/motion/styles'
const TOOLTIP_OPEN_DELAY_MS = 400
const TOOLTIP_SIDE_OFFSET = 4
@@ -13,7 +14,7 @@ const TOOLTIP_CLAIM_EVENT = 'open-pencil:tooltip-claim'
type TooltipSide = 'top' | 'bottom' | 'left' | 'right'
-const cls = useTooltipUI({ content: 'animate-in zoom-in-95 fade-in' })
+const cls = useTooltipUI({ content: motionStyles.popup })
const {
asChild = false,
diff --git a/src/theme/collaboration.ts b/src/theme/collaboration.ts
index becafc509..65b9589e2 100644
--- a/src/theme/collaboration.ts
+++ b/src/theme/collaboration.ts
@@ -23,7 +23,7 @@ const collaborationTheme = {
idle: { shareButton: 'bg-accent text-white hover:bg-accent/90' },
joining: {
shareButton:
- 'animate-pulse border border-[var(--color-warning-border)] bg-[var(--color-warning-bg)] text-[var(--color-warning-text)]'
+ 'animate-pulse motion-reduce:animate-none border border-[var(--color-warning-border)] bg-[var(--color-warning-bg)] text-[var(--color-warning-text)]'
},
connected: {
shareButton:
diff --git a/src/theme/dialog/index.ts b/src/theme/dialog/index.ts
index eb0713771..4d3b37524 100644
--- a/src/theme/dialog/index.ts
+++ b/src/theme/dialog/index.ts
@@ -1,12 +1,11 @@
-const dialogMotion =
- 'data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-180 data-[state=open]:ease-out data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-120 data-[state=closed]:ease-in motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none'
+import { motionStyles } from '@/theme/motion/styles'
export default {
slots: {
- overlay: `fixed inset-0 z-40 bg-black/50 ${dialogMotion}`,
+ overlay: ['fixed inset-0 z-40 bg-black/50', motionStyles.overlay],
content: [
'fixed top-1/2 left-1/2 z-50 flex max-h-[min(90vh,48rem)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-xl bg-panel shadow-[0_8px_30px_rgb(0_0_0/0.4)] outline-none data-[state=open]:zoom-in-98 data-[state=closed]:zoom-out-98',
- dialogMotion
+ motionStyles.overlay
],
header: 'flex shrink-0 items-start justify-between gap-3 border-b border-border px-4 py-3',
heading: 'min-w-0',
diff --git a/src/theme/motion/styles.ts b/src/theme/motion/styles.ts
new file mode 100644
index 000000000..9853b1b1c
--- /dev/null
+++ b/src/theme/motion/styles.ts
@@ -0,0 +1,12 @@
+export const motionStyles = {
+ overlay:
+ 'data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-180 data-[state=open]:ease-out data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-120 data-[state=closed]:ease-in motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none',
+ popup: 'animate-in fade-in zoom-in-95 motion-reduce:animate-none',
+ spinner: 'animate-spin motion-reduce:animate-none',
+ pulse: 'animate-pulse motion-reduce:animate-none'
+} as const
+
+export const feedbackTransition = {
+ enterActiveClass: 'animate-in fade-in duration-150 motion-reduce:animate-none',
+ leaveActiveClass: 'animate-out fade-out duration-150 motion-reduce:animate-none'
+} as const
diff --git a/src/theme/motion/transitions.ts b/src/theme/motion/transitions.ts
new file mode 100644
index 000000000..25d27c9c6
--- /dev/null
+++ b/src/theme/motion/transitions.ts
@@ -0,0 +1,12 @@
+import type { Transition } from 'motion-v'
+
+/** Motion uses seconds; CSS timing remains in the owning theme treatment. */
+export const motionTransitions = {
+ immediate: { duration: 0 },
+ quick: { duration: 0.15 },
+ layout: { type: 'spring', damping: 30, stiffness: 500 }
+} as const satisfies Record<string, Transition>
+
+export function resolveMotionTransition(enabled: boolean, transition: Transition): Transition {
+ return enabled ? transition : motionTransitions.immediate
+}
diff --git a/tests/e2e/settings/motion.spec.ts b/tests/e2e/settings/motion.spec.ts
new file mode 100644
index 000000000..efdb91808
--- /dev/null
+++ b/tests/e2e/settings/motion.spec.ts
@@ -0,0 +1,27 @@
+import { expect, test } from '@playwright/test'
+
+import { CanvasHelper } from '#tests/helpers/canvas'
+
+test('animation preference follows live system changes and persists the Off override', async ({
+ page
+}) => {
+ await page.emulateMedia({ reducedMotion: 'no-preference' })
+ await page.goto('/?test')
+ await new CanvasHelper(page).waitForInit()
+ await expect(page.locator('html')).toHaveAttribute('data-motion', 'full')
+ await page.emulateMedia({ reducedMotion: 'reduce' })
+ await expect(page.locator('html')).toHaveAttribute('data-motion', 'off')
+ await page.emulateMedia({ reducedMotion: 'no-preference' })
+ await page.getByTestId('app-settings-trigger').click()
+ await page.getByRole('combobox', { name: 'Animations', exact: true }).click()
+ await page.getByRole('option', { name: 'Off', exact: true }).click()
+ await expect(page.locator('html')).toHaveAttribute('data-motion', 'off')
+ await expect(page.getByTestId('app-settings-dialog')).toHaveCSS('animation-name', 'none')
+ await page.reload()
+ await new CanvasHelper(page).waitForInit()
+ await expect(page.locator('html')).toHaveAttribute('data-motion', 'off')
+ await page.getByTestId('app-settings-trigger').click()
+ await page.getByRole('combobox', { name: 'Animations', exact: true }).click()
+ await page.getByRole('option', { name: 'Follow system', exact: true }).click()
+ await expect(page.locator('html')).toHaveAttribute('data-motion', 'full')
+})
diff --git a/tests/e2e/settings/tabs.spec.ts-snapshots/settings-tabs-general-openpencil-darwin.png b/tests/e2e/settings/tabs.spec.ts-snapshots/settings-tabs-general-openpencil-darwin.png
index 42413a458..0dc25a0ed 100644
Binary files a/tests/e2e/settings/tabs.spec.ts-snapshots/settings-tabs-general-openpencil-darwin.png and b/tests/e2e/settings/tabs.spec.ts-snapshots/settings-tabs-general-openpencil-darwin.png differ
diff --git a/tests/engine/app/settings/motion.test.ts b/tests/engine/app/settings/motion.test.ts
new file mode 100644
index 000000000..408a13bb8
--- /dev/null
+++ b/tests/engine/app/settings/motion.test.ts
@@ -0,0 +1,14 @@
+import { expect, test } from 'bun:test'
+
+import { motionTransitions, resolveMotionTransition } from '@/theme/motion/transitions'
+
+test('motion presets preserve enabled intent and remove duration, delays and springs when off', () => {
+ for (const transition of [
+ motionTransitions.quick,
+ motionTransitions.layout,
+ { type: 'spring' as const, stiffness: 800, damping: 50, delay: 2 }
+ ]) {
+ expect(resolveMotionTransition(true, transition)).toBe(transition)
+ expect(resolveMotionTransition(false, transition)).toEqual({ duration: 0 })
+ }
+})
diff --git a/tools/i18n/translation-baseline.txt b/tools/i18n/translation-baseline.txt
index 4981e9af9..24828ce7f 100644
--- a/tools/i18n/translation-baseline.txt
+++ b/tools/i18n/translation-baseline.txt
@@ -123,6 +123,7 @@ fr:panels.radialGradient
fr:panels.rotation
fr:panels.saturation
fr:panels.variables
+fr:settings.animations
fr:settings.diagnostics
fr:settings.notifications
fr:storage.bucket