diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index deac0d172..b547006aa 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -179,7 +179,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE. ## loading.dev Blocks and Ring — loading animations (MIT) - **Source**: https://github.com/jakubkrehel/loading/tree/48ff9a1cd5f0446901ff1a8a3d5d5f906d3e36ff -- **Adapted**: the diagonal Blocks sweep in `webui/src/components/thread/ThreadHistoryStatus.tsx` and `webui/src/globals.css`, and the circular Ring in `webui/src/components/ChatList.tsx` and `webui/src/globals.css`. +- **Adapted**: the diagonal Blocks sweep in `webui/src/components/thread/ThreadHistoryStatus.tsx` and `webui/src/globals.css`, and the circular Ring in `webui/src/components/ui/loading-ring.tsx` and `webui/src/globals.css`. - **Bundled**: `nanobot/web/dist/assets/index-*.{js,css}` ``` diff --git a/webui/browser/composer-action-fixture.tsx b/webui/browser/composer-action-fixture.tsx new file mode 100644 index 000000000..cb6edb965 --- /dev/null +++ b/webui/browser/composer-action-fixture.tsx @@ -0,0 +1,22 @@ +import { useState } from "react"; +import { ThreadComposer } from "@/components/thread/ThreadComposer"; + +export function ComposerActionFixture({ parameters }: { parameters: URLSearchParams }) { + const [running, setRunning] = useState(false); + const [stopRequested, setStopRequested] = useState(false); + return + "Voice draft"} + onSend={() => { setStopRequested(false); setRunning(true); }} + onStop={() => setStopRequested(true)} + /> + + {stopRequested ? "Stop requested" : running ? "Working" : "Idle"} + { setRunning(false); setStopRequested(false); }}>Finish response + document.documentElement.classList.toggle("dark")}>Toggle theme + + ; +} diff --git a/webui/browser/composer-action.spec.ts b/webui/browser/composer-action.spec.ts new file mode 100644 index 000000000..a9e468df7 --- /dev/null +++ b/webui/browser/composer-action.spec.ts @@ -0,0 +1,150 @@ +import { expect, test } from "@playwright/test"; + +for (const width of [1280, 390]) { + for (const variant of ["hero", "thread"]) { + test(`composer edge presses send and stop without losing the click (${width}px, ${variant})`, async ({ page }) => { + await page.setViewportSize({ width, height: 844 }); + await page.goto(`/browser/fixture.html?case=composer-action&composerVariant=${variant}`); + await page.getByRole("textbox").fill("An edge press"); + const action = page.locator(".composer-primary-action"); + await expect(action).toHaveAccessibleName("Send message"); + for (const status of ["Working", "Stop requested"]) { + const bounds = (await action.boundingBox())!; + await page.mouse.move(bounds.x + bounds.width - 0.5, bounds.y + bounds.height / 2); + await page.mouse.down(); + // Let the press animation settle before releasing at the same edge point. + await page.waitForTimeout(200); + await page.mouse.up(); + await expect(page.getByLabel("Execution status")).toHaveText(status); + expect(await action.boundingBox()).toEqual(bounds); + } + }); + + test(`composer actions crossfade without shifting or delaying Stop (${width}px, ${variant})`, async ({ page }) => { + await page.setViewportSize({ width, height: 844 }); + await page.goto(`/browser/fixture.html?case=composer-action&composerVariant=${variant}`); + const input = page.getByRole("textbox"); + const action = page.locator(".composer-primary-action"); + await expect(action).toHaveAccessibleName("Voice input"); + const bounds = await action.boundingBox(); + const pillBounds = await page.locator(".composer-model-pill").boundingBox(); + expect(bounds!.height).toBe(pillBounds!.height); + expect(bounds!.y + bounds!.height / 2).toBe(pillBounds!.y + pillBounds!.height / 2); + const model = page.getByText("Preview", { exact: true }); + const modelBounds = await model.boundingBox(); + await input.fill("Please work"); + await expect(action).toHaveAccessibleName("Send message"); + const samples = await action.evaluate((button) => new Promise((resolve) => { + const values: number[] = []; + const start = performance.now(); + const sample = () => { + values.push(Number(getComputedStyle(button.querySelector('[data-action-icon="send"]')!).opacity)); + if (performance.now() - start < 200) requestAnimationFrame(sample); + else resolve(values); + }; + requestAnimationFrame(sample); + })); + expect(samples.some((opacity) => opacity > 0 && opacity < 1)).toBe(true); + expect(await action.boundingBox()).toEqual(bounds); + expect(await model.boundingBox()).toEqual(modelBounds); + + // Reverse mid-transition, then send before the new icon has settled. + await input.fill(""); + await input.fill("A newer draft"); + await action.click(); + await expect(action).toHaveAccessibleName("Stop response"); + const stop = action.locator('[data-action-icon="stop"]'); + const ring = stop.locator(".loading-ring-arc"); + await expect.poll(() => ring.evaluate((node) => node.getAnimations().length)).toBe(1); + const phase = await ring.evaluate((node) => Number(node.getAnimations()[0].currentTime)); + await expect.poll(() => ring.evaluate((node) => Number(node.getAnimations()[0].currentTime))).toBeGreaterThan(phase); + await action.click(); + await expect(page.getByLabel("Execution status")).toHaveText("Stop requested"); + await expect(action).toHaveAccessibleName("Stop response"); + await expect.poll(() => stop.evaluate((node) => getComputedStyle(node).opacity)).toBe("1"); + expect(await action.boundingBox()).toEqual(bounds); + await page.getByRole("button", { name: "Finish response" }).click(); + await expect(action).toHaveAccessibleName("Voice input"); + await expect.poll(() => stop.evaluate((node) => getComputedStyle(node).opacity)).toBe("0"); + expect(await ring.evaluate((node) => node.getAnimations().length)).toBe(0); + expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true); + }); + } +} + +test("composer activity follows both themes and live reduced-motion preferences", async ({ page }) => { + await page.goto("/browser/fixture.html?case=composer-action"); + await page.getByRole("textbox").fill("Run a task"); + await page.getByRole("button", { name: "Send message", exact: true }).click(); + const action = page.getByRole("button", { name: "Stop response", exact: true }); + const ring = action.locator('[data-action-icon="stop"] svg:has(.loading-ring-arc)'); + const colors: string[] = []; + for (const dark of [false, true]) { + await page.evaluate((enabled) => document.documentElement.classList.toggle("dark", enabled), dark); + colors.push(await ring.evaluate((node) => getComputedStyle(node).color)); + } + expect(colors[0]).not.toBe(colors[1]); + for (const reducedMotion of ["reduce", "no-preference"] as const) { + await page.emulateMedia({ reducedMotion }); + await expect.poll(() => ring.evaluate((node) => node.getAnimations({ subtree: true }).length)) + .toBe(reducedMotion === "reduce" ? 0 : 1); + } + await page.emulateMedia({ reducedMotion: "reduce" }); + await action.hover(); + await page.mouse.down(); + expect(await action.evaluate((node) => getComputedStyle(node).transform)).toBe("none"); + expect(await action.locator(".composer-action-icons").evaluate((node) => getComputedStyle(node).transform)).toBe("none"); + await page.mouse.up(); + await page.getByRole("button", { name: "Finish response" }).click(); + await page.getByRole("textbox").fill("Another draft"); + await expect(page.getByRole("button", { name: "Send message", exact: true })).toBeEnabled(); + expect(await action.count()).toBe(0); +}); + + +test("idle voice and ready send remain distinct from the composer in both themes", async ({ page }) => { + const measurements = []; + for (const variant of ["hero", "thread"]) { + for (const theme of ["light", "dark"]) { + await page.goto(`/browser/fixture.html?case=composer-action&composerVariant=${variant}`); + await page.locator("html").evaluate((element, dark) => element.classList.toggle("dark", dark), theme === "dark"); + const action = page.locator(".composer-primary-action"); + for (const [state, value] of [["voice", ""], ["send", "A ready message"]]) { + await page.getByRole("textbox").fill(value); + await expect(action).toBeEnabled(); + await expect(action).toHaveAccessibleName(state === "voice" ? "Voice input" : "Send message"); + await page.waitForTimeout(250); + const contrast = await action.evaluate((button) => { + const parse = (color: string) => color.match(/[\d.]+/g)!.map(Number); + const composite = (foreground: number[], background: number[]) => { + const alpha = foreground[3] ?? 1; + return background.map((channel, index) => foreground[index] * alpha + channel * (1 - alpha)); + }; + const luminance = (color: number[]) => { + const channels = color.map((value) => { + const channel = value / 255; + return channel <= 0.04045 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4; + }); + return 0.2126 * channels[0] + 0.7152 * channels[1] + 0.0722 * channels[2]; + }; + const ratio = (first: number[], second: number[]) => { + const a = luminance(first), b = luminance(second); + return (Math.max(a, b) + 0.05) / (Math.min(a, b) + 0.05); + }; + const ancestors: Element[] = []; + for (let node = button.parentElement; node; node = node.parentElement) ancestors.unshift(node); + let background = [255, 255, 255]; + for (const node of ancestors) background = composite(parse(getComputedStyle(node).backgroundColor), background); + const style = getComputedStyle(button); + const surface = composite(parse(style.backgroundColor), background); + const glyph = composite(parse(style.color), surface); + return { surface: ratio(surface, background), glyph: ratio(glyph, surface) }; + }); + expect(contrast.surface, `${variant}/${theme}/${state} button boundary`).toBeGreaterThanOrEqual(3); + expect(contrast.glyph, `${variant}/${theme}/${state} icon`).toBeGreaterThanOrEqual(4.5); + measurements.push({ variant, theme, state, ...contrast }); + } + } + } + await test.info().attach("action-contrast", { body: JSON.stringify(measurements, null, 2), contentType: "application/json" }); +}); diff --git a/webui/browser/fixture.tsx b/webui/browser/fixture.tsx index 533786cd4..a07f2fc5b 100644 --- a/webui/browser/fixture.tsx +++ b/webui/browser/fixture.tsx @@ -34,6 +34,7 @@ import { IdleCompactionFixture, installIdleCompactionApi } from "./idle-compacti import { FileEditPathFixture } from "./file-edit-path-fixture"; import { QueuedGuidanceFixture } from "./queued-guidance-fixture"; import { WorkspaceAlignmentFixture } from "./workspace-alignment-fixture"; +import { ComposerActionFixture } from "./composer-action-fixture"; const history: UIMessage[] = [ { id: "question", role: "user", content: "Earlier question", createdAt: 1_700_000_000_000 }, @@ -185,7 +186,9 @@ if (parameters.get("case") === "skeleton-additions") installSkeletonPreviewApi() if (parameters.get("case") === "idle-compaction") installIdleCompactionApi(); await initializeI18n(); createRoot(document.getElementById("root")!).render( - {parameters.get("case") === "workspace-alignment" + {parameters.get("case") === "composer-action" + ? + : parameters.get("case") === "workspace-alignment" ? : parameters.get("case") === "queued-guidance" ? diff --git a/webui/src/components/ChatList.tsx b/webui/src/components/ChatList.tsx index 1d3bdb563..9f6808c2c 100644 --- a/webui/src/components/ChatList.tsx +++ b/webui/src/components/ChatList.tsx @@ -49,6 +49,7 @@ import { import { MAX_WORKBENCH_PANES } from "@/components/workbench/workbench-model"; import { SidebarTopicRename } from "@/components/SidebarTopicRename"; import { SkeletonStatus } from "@/components/settings/shared/SkeletonStatus"; +import { LoadingRing } from "@/components/ui/loading-ring"; import { SIDEBAR_SELECTION_ITEM_CLASS, SidebarSelectionHighlight, @@ -1880,12 +1881,6 @@ function ChatsFoldFooter({ ); } -function synchronizeRunningRing(element: SVGCircleElement | null) { - if (!element) return; - // Align pending animations before their first frame, not only after animationstart. - for (const animation of element.getAnimations()) animation.startTime = 0; -} - function SessionActivityIndicator({ state, }: { @@ -1919,18 +1914,7 @@ function SessionActivityIndicator({ aria-label={label} className="grid h-4 w-4 shrink-0 place-items-center" > - - - synchronizeRunningRing(event.currentTarget)} - /> - + ); diff --git a/webui/src/components/thread/ComposerActionIcon.tsx b/webui/src/components/thread/ComposerActionIcon.tsx new file mode 100644 index 000000000..98b564589 --- /dev/null +++ b/webui/src/components/thread/ComposerActionIcon.tsx @@ -0,0 +1,37 @@ +import { ModelsIcon, StopIcon } from "@/components/icons/product-icons"; +import { LoadingRing } from "@/components/ui/loading-ring"; + +export type ComposerActionState = "voice" | "recording" | "busy" | "stop" | "setup" | "send"; + +export function ComposerActionIcon({ state }: { state: ComposerActionState }) { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} diff --git a/webui/src/components/thread/ThreadComposer.tsx b/webui/src/components/thread/ThreadComposer.tsx index 5e74c1226..3a1c5d873 100644 --- a/webui/src/components/thread/ThreadComposer.tsx +++ b/webui/src/components/thread/ThreadComposer.tsx @@ -16,7 +16,6 @@ import { HelpIcon, HistoryIcon, ConversationIcon, - VoiceIcon, AttachIcon, RestartIcon, RestrictedAccessIcon, @@ -53,7 +52,6 @@ import { } from "@/lib/composer-mention-text"; import { INLINE_TOKEN_HIGHLIGHT_COLOR } from "@/components/InlineTokenHighlight"; import { - ArrowUp, ChevronDown, ChevronUp, CornerDownRight, @@ -69,6 +67,7 @@ import { import { useTranslation } from "react-i18next"; import { Button } from "@/components/ui/button"; +import { ComposerActionIcon, type ComposerActionState } from "@/components/thread/ComposerActionIcon"; import { floatingItemClassName, floatingItemFocusClassName, @@ -2480,6 +2479,9 @@ export function ThreadComposer({ : t("thread.composer.voice.hint"); // Touch users need an explicit send action; keep Stop while sending is unavailable. const showStopButton = isStreaming && !!onStop && !canSend; + const actionState: ComposerActionState = showVoiceButton + ? voiceRecorder.state === "transcribing" ? "busy" : voiceRecorder.isRecording ? "recording" : "voice" + : showStopButton ? "stop" : modelNeedsSetup ? "setup" : canSend || !isStreaming ? "send" : "busy"; const relaxedHeroInput = isHero && images.length === 0 && !isStreaming; const compactIdle = compactWhenIdle && !compactControls && !isHero && !composerFocused && value.length === 0 && images.length === 0 && !inlineError @@ -2864,31 +2866,18 @@ export function ThreadComposer({ }} onClick={showVoiceButton ? voiceRecorder.handleClick : showStopButton ? handleStop : modelNeedsSetup ? onModelBadgeClick : undefined} className={cn( - "thread-composer-action thread-composer-round-action touch-target rounded-full", - showStopButton && !showVoiceButton - ? "border border-border/70 bg-card text-foreground/85 hover:text-foreground disabled:text-muted-foreground/50" - : "border border-foreground bg-foreground text-background disabled:border-foreground disabled:bg-foreground disabled:text-background", - showVoiceButton && voiceRecorder.isRecording && "border-red-500 bg-red-500 text-white hover:bg-red-500 hover:text-white", + "composer-primary-action thread-composer-action thread-composer-round-action touch-target rounded-full bg-clip-padding", + actionState === "stop" + ? "border border-transparent bg-foreground/[0.045] text-foreground/85 hover:bg-foreground/[0.08] hover:text-foreground disabled:text-muted-foreground/50" + : actionState === "voice" + ? "border border-transparent bg-foreground/75 text-background hover:bg-foreground/[0.85] hover:text-background disabled:bg-foreground/[0.12] disabled:text-muted-foreground" + : "border border-transparent bg-foreground text-background hover:bg-foreground/90 hover:text-background disabled:border-foreground disabled:bg-foreground disabled:text-background", + actionState === "send" && "disabled:border-transparent disabled:bg-foreground/[0.12] disabled:text-muted-foreground", + showVoiceButton && voiceRecorder.isRecording && "border-transparent bg-red-500 text-white hover:bg-red-500 hover:text-white", isHero ? "h-8 w-8" : "h-9 w-9", )} > - {showVoiceButton ? ( - voiceRecorder.state === "transcribing" ? ( - - ) : voiceRecorder.isRecording ? ( - - ) : ( - - ) - ) : showStopButton ? ( - - ) : modelNeedsSetup ? ( - - ) : canSend || !isStreaming ? ( - - ) : ( - - )} + {showVoiceButton ? ( diff --git a/webui/src/components/ui/loading-ring.tsx b/webui/src/components/ui/loading-ring.tsx new file mode 100644 index 000000000..58e002674 --- /dev/null +++ b/webui/src/components/ui/loading-ring.tsx @@ -0,0 +1,21 @@ +import type { SVGProps } from "react"; + +function synchronizeRing(element: SVGCircleElement | null) { + if (!element) return; + // Align the first frame and animations restarted by a live motion preference change. + for (const animation of element.getAnimations()) animation.startTime = 0; +} + +export function LoadingRing({ track = true, strokeDasharray = "16 46.8", ...props }: SVGProps & { track?: boolean }) { + return ( + + {track ? : null} + synchronizeRing(event.currentTarget)} + /> + + ); +} diff --git a/webui/src/dev/gallery/foundations.tsx b/webui/src/dev/gallery/foundations.tsx index 17acf15ae..64e24042f 100644 --- a/webui/src/dev/gallery/foundations.tsx +++ b/webui/src/dev/gallery/foundations.tsx @@ -18,6 +18,7 @@ import { HoverHint, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Tr import { Disclosure } from "@/components/ui/disclosure"; import { ExpandableText } from "@/components/ui/expandable-text"; import { StreamingLabelSheen } from "@/components/ui/streaming-label-sheen"; +import { LoadingRing } from "@/components/ui/loading-ring"; import { ImageViewport } from "@/components/ui/image-viewport"; import { Sample, type ComponentExample } from "./example"; import { useGalleryTranslation } from "./i18n"; @@ -302,6 +303,13 @@ export const foundationExamples: ComponentExample[] = [ { title: "controls.imageViewport.title", files: ["image-viewport"], Preview: ImageViewports, description: "controls.imageViewport.description", options: "controls.imageViewport.options", code: '' }, + { title: "controls.loadingRing.title", files: ["loading-ring"], + Preview: () => + + + , + description: "controls.loadingRing.description", options: "controls.loadingRing.options", + code: '\n' }, { title: "controls.streaming.title", files: ["streaming-label-sheen"], Preview: StreamingLabels, description: "controls.streaming.description", options: "controls.streaming.options", code: 'Working…' }, diff --git a/webui/src/dev/gallery/locales/controls/en.json b/webui/src/dev/gallery/locales/controls/en.json index fd0c55126..da745c236 100644 --- a/webui/src/dev/gallery/locales/controls/en.json +++ b/webui/src/dev/gallery/locales/controls/en.json @@ -166,6 +166,11 @@ "description": "Image-local fit, zoom, pan and pinch controls.", "options": "Supply a bounded className and remount for a different image identity. Set panWithArrows=false when a gallery owns arrow navigation." }, + "loadingRing": { + "title": "Loading ring", + "description": "A shared activity ring with an optional track.", + "options": "className sets size and color. track=false hides the track; strokeWidth and strokeDasharray adjust the arc. Respects reduced-motion settings." + }, "streaming": { "title": "Animated labels", "description": "A shared text animation for active thinking and tool labels.", diff --git a/webui/src/dev/gallery/locales/controls/es.json b/webui/src/dev/gallery/locales/controls/es.json index 151ed1453..5ab25f313 100644 --- a/webui/src/dev/gallery/locales/controls/es.json +++ b/webui/src/dev/gallery/locales/controls/es.json @@ -166,6 +166,11 @@ "description": "Ajuste, zoom, desplazamiento y pellizco propios de cada imagen.", "options": "Proporciona una className con límites y vuelve a montar si cambia la identidad de la imagen. Usa panWithArrows=false cuando una galería gestione las flechas." }, + "loadingRing": { + "title": "Anillo de actividad", + "description": "Un indicador de actividad compartido con pista opcional.", + "options": "className define el tamaño y el color. track=false oculta la pista; strokeWidth y strokeDasharray ajustan el arco. Respeta la preferencia de movimiento reducido." + }, "streaming": { "title": "Etiquetas animadas", "description": "Una animación de texto compartida para la reflexión activa y las etiquetas de herramientas.", diff --git a/webui/src/dev/gallery/locales/controls/fr.json b/webui/src/dev/gallery/locales/controls/fr.json index c6a488adf..9ff62cc22 100644 --- a/webui/src/dev/gallery/locales/controls/fr.json +++ b/webui/src/dev/gallery/locales/controls/fr.json @@ -166,6 +166,11 @@ "description": "Commandes d’ajustement, zoom, déplacement et pincement propres à l’image.", "options": "Fournissez une className délimitant la zone et remontez le composant si l’identité de l’image change. Définissez panWithArrows=false si une galerie gère les flèches." }, + "loadingRing": { + "title": "Anneau d’activité", + "description": "Un indicateur d’activité partagé avec une piste facultative.", + "options": "className définit la taille et la couleur. track=false masque la piste ; strokeWidth et strokeDasharray ajustent l’arc. Respecte la préférence de réduction des animations." + }, "streaming": { "title": "Libellés animés", "description": "Une animation de texte partagée pour la réflexion et les libellés d’outils actifs.", diff --git a/webui/src/dev/gallery/locales/controls/id.json b/webui/src/dev/gallery/locales/controls/id.json index 6c82643fc..2b604100b 100644 --- a/webui/src/dev/gallery/locales/controls/id.json +++ b/webui/src/dev/gallery/locales/controls/id.json @@ -166,6 +166,11 @@ "description": "Kontrol penyesuaian, zoom, geser, dan cubit untuk setiap gambar.", "options": "Sediakan className dengan batas area dan pasang ulang untuk identitas gambar yang berbeda. Atur panWithArrows=false jika galeri mengelola navigasi panah." }, + "loadingRing": { + "title": "Cincin aktivitas", + "description": "Indikator aktivitas bersama dengan jalur opsional.", + "options": "className mengatur ukuran dan warna. track=false menyembunyikan jalur; strokeWidth dan strokeDasharray mengatur busur. Mengikuti preferensi pengurangan gerakan." + }, "streaming": { "title": "Label beranimasi", "description": "Animasi teks bersama untuk proses berpikir aktif dan label alat.", diff --git a/webui/src/dev/gallery/locales/controls/ja.json b/webui/src/dev/gallery/locales/controls/ja.json index 7ef84cc54..e8cbb687a 100644 --- a/webui/src/dev/gallery/locales/controls/ja.json +++ b/webui/src/dev/gallery/locales/controls/ja.json @@ -166,6 +166,11 @@ "description": "画像単位のフィット、ズーム、移動、ピンチ操作。", "options": "className で領域を制限し、画像の識別情報が変わったら再マウントします。ギャラリーが矢印キー操作を管理する場合は panWithArrows=false にします。" }, + "loadingRing": { + "title": "処理リング", + "description": "背景リングを省略できる共通の処理インジケーター。", + "options": "className でサイズと色を設定します。track=false で背景リングを非表示にし、strokeWidth と strokeDasharray で円弧を調整します。視差効果を減らす設定に従います。" + }, "streaming": { "title": "アニメーションラベル", "description": "思考中や実行中のツールラベルで共有するテキストアニメーション。", diff --git a/webui/src/dev/gallery/locales/controls/ko.json b/webui/src/dev/gallery/locales/controls/ko.json index d1d349474..55635eb53 100644 --- a/webui/src/dev/gallery/locales/controls/ko.json +++ b/webui/src/dev/gallery/locales/controls/ko.json @@ -166,6 +166,11 @@ "description": "이미지별 맞춤, 확대/축소, 이동, 핀치 컨트롤입니다.", "options": "className으로 영역을 제한하고 이미지 식별 정보가 달라지면 다시 마운트합니다. 갤러리가 방향키 탐색을 관리하면 panWithArrows=false로 설정합니다." }, + "loadingRing": { + "title": "진행 링", + "description": "배경 링을 선택적으로 표시하는 공용 진행 표시기입니다.", + "options": "className으로 크기와 색상을 설정합니다. track=false는 배경 링을 숨기고, strokeWidth와 strokeDasharray는 호를 조절합니다. 동작 줄이기 설정을 따릅니다." + }, "streaming": { "title": "애니메이션 레이블", "description": "진행 중인 사고와 도구 레이블이 공유하는 텍스트 애니메이션입니다.", diff --git a/webui/src/dev/gallery/locales/controls/pt-BR.json b/webui/src/dev/gallery/locales/controls/pt-BR.json index 7790f7b9a..0bf9a8406 100644 --- a/webui/src/dev/gallery/locales/controls/pt-BR.json +++ b/webui/src/dev/gallery/locales/controls/pt-BR.json @@ -166,6 +166,11 @@ "description": "Controles de ajuste, zoom, deslocamento e pinça locais à imagem.", "options": "Forneça uma className com limites e remonte o componente se a identidade da imagem mudar. Use panWithArrows=false quando uma galeria gerenciar as setas." }, + "loadingRing": { + "title": "Anel de atividade", + "description": "Um indicador de atividade compartilhado com trilha opcional.", + "options": "className define o tamanho e a cor. track=false oculta a trilha; strokeWidth e strokeDasharray ajustam o arco. Respeita a preferência por movimento reduzido." + }, "streaming": { "title": "Rótulos animados", "description": "Uma animação de texto compartilhada para raciocínio ativo e rótulos de ferramentas.", diff --git a/webui/src/dev/gallery/locales/controls/vi.json b/webui/src/dev/gallery/locales/controls/vi.json index 16ac885a4..ac9110dbd 100644 --- a/webui/src/dev/gallery/locales/controls/vi.json +++ b/webui/src/dev/gallery/locales/controls/vi.json @@ -166,6 +166,11 @@ "description": "Điều khiển vừa khung, thu phóng, di chuyển và chụm ngón cho từng ảnh.", "options": "Dùng className để giới hạn vùng và gắn kết lại khi danh tính ảnh thay đổi. Đặt panWithArrows=false nếu thư viện ảnh quản lý điều hướng bằng phím mũi tên." }, + "loadingRing": { + "title": "Vòng hoạt động", + "description": "Chỉ báo hoạt động dùng chung với vòng nền tùy chọn.", + "options": "className đặt kích thước và màu sắc. track=false ẩn vòng nền; strokeWidth và strokeDasharray điều chỉnh cung tròn. Tuân theo tùy chọn giảm chuyển động." + }, "streaming": { "title": "Nhãn động", "description": "Hiệu ứng văn bản dùng chung cho trạng thái suy nghĩ và nhãn công cụ đang hoạt động.", diff --git a/webui/src/dev/gallery/locales/controls/zh-CN.json b/webui/src/dev/gallery/locales/controls/zh-CN.json index ca3c500d4..91b449460 100644 --- a/webui/src/dev/gallery/locales/controls/zh-CN.json +++ b/webui/src/dev/gallery/locales/controls/zh-CN.json @@ -166,6 +166,11 @@ "description": "单张图片的适应、缩放、平移与双指缩放控件。", "options": "用 className 限定边界;更换图片身份时重新挂载。图库管理方向键导航时设置 panWithArrows=false。" }, + "loadingRing": { + "title": "运行圆环", + "description": "可选底环的共享运行指示器。", + "options": "className 设置尺寸和颜色。track=false 隐藏底环;strokeWidth 和 strokeDasharray 调整圆弧。遵循减少动态效果设置。" + }, "streaming": { "title": "流光文字", "description": "思考中与工具标签共用的文字动画。", diff --git a/webui/src/dev/gallery/locales/controls/zh-TW.json b/webui/src/dev/gallery/locales/controls/zh-TW.json index 7417a2771..2a27be077 100644 --- a/webui/src/dev/gallery/locales/controls/zh-TW.json +++ b/webui/src/dev/gallery/locales/controls/zh-TW.json @@ -166,6 +166,11 @@ "description": "單張圖片的適應、縮放、平移與雙指縮放。", "options": "用 className 限定邊界;更換圖片身分時重新掛載。圖庫管理方向鍵導覽時設定 panWithArrows=false。" }, + "loadingRing": { + "title": "執行圓環", + "description": "可選底環的共用執行指示器。", + "options": "className 設定尺寸和顏色。track=false 隱藏底環;strokeWidth 和 strokeDasharray 調整圓弧。遵循減少動態效果設定。" + }, "streaming": { "title": "流光文字", "description": "思考中與工具標籤共用的文字動畫。", diff --git a/webui/src/globals.css b/webui/src/globals.css index 5ced905e9..9b7ea5edd 100644 --- a/webui/src/globals.css +++ b/webui/src/globals.css @@ -1054,17 +1054,56 @@ } /* loading.dev Ring, Copyright (c) 2026 Jakub Krehel (MIT); THIRD_PARTY_NOTICES.md. */ -.sidebar-running-ring { +.loading-ring-arc { transform-origin: center; - animation: sidebar-running-ring 800ms linear infinite; + animation: loading-ring-spin 800ms linear infinite; } -@keyframes sidebar-running-ring { +@keyframes loading-ring-spin { to { transform: rotate(360deg); } } + +.composer-primary-action { + transition: color 160ms ease-out, background-color 160ms ease-out, border-color 160ms ease-out; +} +.composer-action-icons { + transition: transform 120ms ease-out; +} +.composer-primary-action:active:not(:disabled) .composer-action-icons { + transform: scale(0.94); +} +.composer-action-glyph { + position: absolute; + inset: 0; + display: grid; + place-items: center; + opacity: 0; + transform: scale(0.72); + transition: opacity 140ms ease-out, transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1); +} +.composer-action-glyph[data-active] { + opacity: 1; + transform: scale(1); +} +.composer-action-icons[data-state="stop"] [data-action-icon="send"] { + transform: translateY(-3px) scale(0.8); +} +.composer-action-glyph:not([data-active]) .loading-ring-arc { + animation: none; +} @media (prefers-reduced-motion: reduce) { - .sidebar-running-ring { + .loading-ring-arc { animation: none; } + .composer-primary-action, + .composer-action-icons, + .composer-primary-action:active:not(:disabled) .composer-action-icons { + transition: none; + transform: none; + } + .composer-action-icons[data-state] .composer-action-glyph { + transform: none; + transition: opacity 80ms linear; + } } @media (pointer: coarse) {