Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
fix(ui): read the real reduced-motion preference in v3 Loader (#7927)
claude[bot]a7605e2c5e61
diff --git a/DESIGN.md b/DESIGN.mdindex 90d91adeca..1f6b58ddda 100644--- a/DESIGN.md+++ b/DESIGN.md@@ -244,6 +244,12 @@ variants, sizes, and class lists, open the source or its `*.stories.tsx`| [`Loader`](frontend/src/components/v3/generic/Loader/Loader.tsx) | Branded loading animation — pending controls and page waits. || [`PageLoader`](frontend/src/components/v3/platform/PageLoader/PageLoader.tsx) | Centered Lottie spinner for full-page loading. |+**Reduced motion.** When the operating system requests reduced motion, `Loader`+and `PageLoader` hold the animation on its first frame instead of looping. The+mark stays fully visible either way, because these Lotties animate only a+trim-path offset over an always-drawn mark. `role="status"` is present in both+states, so the wait is still announced.+#### Atoms & domain| Component | Reach for this when… |diff --git a/frontend/src/components/v3/generic/Loader/Loader.stories.tsx b/frontend/src/components/v3/generic/Loader/Loader.stories.tsxindex 1eeec6bc49..89d1cde5da 100644--- a/frontend/src/components/v3/generic/Loader/Loader.stories.tsx+++ b/frontend/src/components/v3/generic/Loader/Loader.stories.tsx@@ -1,5 +1,4 @@import type { Meta, StoryObj } from "@storybook/react-vite";-import { MotionConfig } from "framer-motion";import { RefreshCwIcon, Trash2Icon } from "lucide-react";import { Button } from "../Button";@@ -27,9 +26,15 @@ import { Loader } from "./Loader";* height follows the asset. `className` merges through `cn` and wins, so a* call site sitting between steps (`w-24` for `PageLoader`) can set its own* width without a new size.- * When the operating system requests reduced motion, the player remains on the- * fully drawn first frame while the status semantics continue to announce the- * pending state.+ *+ * When the operating system requests reduced motion, the player holds the fully+ * drawn first frame instead of looping, and the `role="status"` semantics keep+ * announcing the pending state. There is no story for that state, because the+ * component reads the `prefers-reduced-motion` media query directly and this+ * Storybook has no addon that can emulate a media feature, so no decorator can+ * force it. Review it either by turning on the operating system's reduce-motion+ * setting, or in Chrome DevTools: open the command menu, run "Show Rendering",+ * and set "Emulate CSS media feature prefers-reduced-motion" to `reduce`.*/const meta = {title: "Generic/Loader",@@ -127,25 +132,6 @@ export const VariantBrand: Story = {}};-export const ReducedMotion: Story = {- name: "State: Reduced Motion",- decorators: [- (Story) => (- <MotionConfig reducedMotion="always">- <Story />- </MotionConfig>- )- ],- parameters: {- docs: {- description: {- story:- "Forces the operating system's reduced-motion state so the loader can be reviewed without changing local accessibility settings. The mark remains on its fully drawn first frame while the loading status semantics stay available to assistive technology."- }- }- }-};-export const Sizes: Story = {parameters: {docs: {diff --git a/frontend/src/components/v3/generic/Loader/Loader.tsx b/frontend/src/components/v3/generic/Loader/Loader.tsxindex bade089e25..b0ead37ad0 100644--- a/frontend/src/components/v3/generic/Loader/Loader.tsx+++ b/frontend/src/components/v3/generic/Loader/Loader.tsx@@ -1,6 +1,6 @@import { type ComponentProps, useEffect, useRef } from "react";import { type DotLottie, DotLottieReact } from "@lottiefiles/dotlottie-react";-import { useReducedMotionConfig } from "framer-motion";+import { useReducedMotion } from "framer-motion";import { cn } from "../../utils";@@ -36,7 +36,7 @@ function Loader({variant = "default",...props}: LoaderProps) {- const prefersReducedMotion = Boolean(useReducedMotionConfig());+ const prefersReducedMotion = Boolean(useReducedMotion());const animationRef = useRef<DotLottie | null>(null);useEffect(() => {