From 3c0271bae8c465b083559d0510fc299e898bb395 Mon Sep 17 00:00:00 2001 From: Huarch Date: Mon, 20 Jul 2026 18:47:26 +0800 Subject: [PATCH] fix: disable fullscreen table token animation --- app/globals.css | 7 +++++++ features/agent/table-fullscreen-animation.test.ts | 13 +++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 features/agent/table-fullscreen-animation.test.ts diff --git a/app/globals.css b/app/globals.css index aaa49f0..fb3a348 100644 --- a/app/globals.css +++ b/app/globals.css @@ -354,6 +354,13 @@ input:focus-visible { --sd-easing: cubic-bezier(0.16, 1, 0.3, 1); } +[data-streamdown="table-fullscreen"] [data-sd-animate] { + animation: none; + filter: none; + opacity: 1; + transform: none; +} + .agent-chart-line { animation: agent-chart-line-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both; transform-origin: center; diff --git a/features/agent/table-fullscreen-animation.test.ts b/features/agent/table-fullscreen-animation.test.ts new file mode 100644 index 0000000..8c928c6 --- /dev/null +++ b/features/agent/table-fullscreen-animation.test.ts @@ -0,0 +1,13 @@ +import { readFileSync } from "node:fs"; +import { join } from "node:path"; +import { describe, expect, it } from "vitest"; + +describe("Streamdown fullscreen table", () => { + it("disables inherited token animations only inside the fullscreen copy", () => { + const styles = readFileSync(join(process.cwd(), "app/globals.css"), "utf8"); + + expect(styles).toMatch( + /\[data-streamdown="table-fullscreen"\] \[data-sd-animate\] \{\s*animation: none;\s*filter: none;\s*opacity: 1;\s*transform: none;\s*\}/ + ); + }); +});