Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

fix(web): scroll truncated sidebar titles into view on hover / keyboard focus (#328)

Yaowei Zheng27d343b1a6df
diff --git a/changelog/unreleased/2026-08-18-sidebar-title-scroll-reveal.md b/changelog/unreleased/2026-08-18-sidebar-title-scroll-reveal.md
new file mode 100644
index 00000000..84eb6194
--- /dev/null
+++ b/changelog/unreleased/2026-08-18-sidebar-title-scroll-reveal.md
@@ -0,0 +1,25 @@
+# Web App: truncated sidebar titles scroll their full text into view
+
+- **Date:** 2026-08-18
+- **Type:** fix
+- **Scope:** `web`
+- **PR:** [#328](https://github.com/Prism-Shadow/penguin-harness/pull/328)
+- **Issue:** [#309](https://github.com/Prism-Shadow/penguin-harness/issues/309)
+
+[中文版](2026-08-18-sidebar-title-scroll-reveal.zh.md)
+
+Conversation titles in the chat sidebar are clipped to one line, and the only way past the clipping was a native tooltip that is easy to miss — conversations sharing a long prefix were indistinguishable from one another. Hovering a row, or reaching it with keyboard focus, now scrolls the clipped title's hidden tail into view, on session rows and parked-draft rows alike.
+
+## The reveal
+
+- The title holds still for 0.3s before anything moves, then slides left by the measured overflow at a constant reading speed (60 px/s, so short and long titles skim at the same pace) over a duration clamped between 0.35s and 4s. It rests at the end for as long as the hover or focus lasts, and snaps back in a single frame the moment either ends.
+- Nothing changes during the hold, the ellipsis included, so a pointer crossing the sidebar on its way elsewhere leaves every row exactly as it found it. Every declaration that alters the rendering sits inside the `title-scroll-reveal` keyframes with a `forwards`-only fill — among them the `inline-block` that makes the text transformable, which is also what retires the ellipsis, so the "…" survives right up to the frame the slide starts on.
+- `:focus-visible` scopes the keyboard trigger to actual keyboard focus rather than to any focus landing in the row, and it sits inside a forgiving `:is()`, so an engine without `:has()` still gets the hover trigger.
+- The animation is pure CSS, driven by two custom properties (`--title-scroll-shift`, `--title-scroll-ms`) that `Truncated` measures and publishes: no timers, no per-row media-query subscriptions. The transform is clipped inside the row's existing box, so there is no layout shift, and the row's click, drag-reorder and hover action buttons are untouched.
+- A title that fits is measured as fitting and stays perfectly still — no class, no variables, no tooltip. The measurement re-runs on resize and when the title or its styling changes, and a 1px subpixel tolerance keeps a rounding artifact from producing either a spurious tooltip or a 1px scroll.
+
+## Reduced motion and assistive technology
+
+- Under `prefers-reduced-motion` the repo's global `animation: none !important` block disables the reveal outright, with no override of its own. The title then renders exactly as it does at rest: the plain ellipsis, plus the `title` tooltip that a truncated title already carried for pointer hover.
+- The full title stays in the DOM whether or not it is visually clipped, so screen readers announce all of it.
+- Touch has neither hover nor keyboard focus, and mobile browsers do not surface `title` on long-press; there the full text is reached by opening the Session.
diff --git a/changelog/unreleased/2026-08-18-sidebar-title-scroll-reveal.zh.md b/changelog/unreleased/2026-08-18-sidebar-title-scroll-reveal.zh.md
new file mode 100644
index 00000000..03ef5220
--- /dev/null
+++ b/changelog/unreleased/2026-08-18-sidebar-title-scroll-reveal.zh.md
@@ -0,0 +1,25 @@
+# Web App:侧边栏被截断的标题会滚动显出完整文字
+
+- **Date:** 2026-08-18
+- **Type:** fix
+- **Scope:** `web`
+- **PR:** [#328](https://github.com/Prism-Shadow/penguin-harness/pull/328)
+- **Issue:** [#309](https://github.com/Prism-Shadow/penguin-harness/issues/309)
+
+[English](2026-08-18-sidebar-title-scroll-reveal.md)
+
+聊天侧边栏里的对话标题会被裁成一行,而越过这层裁剪的唯一办法是一个很容易被忽略的原生 tooltip——前缀相同的一批对话因此彼此难以分辨。现在把指针悬停到某一行、或用键盘把焦点移到它上面,被裁掉的标题尾部就会滚动进视野,session 行与停放的草稿行一视同仁。
+
+## 滚动揭示
+
+- 标题会先静止 0.3s,什么都不动,随后以恒定的阅读速度(60 px/s,因此长短标题掠过的节奏一致)向左滑动实测的溢出宽度,时长夹在 0.35s 到 4s 之间。滑到尾端后只要悬停或焦点还在就一直停住,二者一旦结束,一帧之内弹回原位。
+- 这 0.3s 静止期内没有任何变化,省略号也在其内,所以指针只是路过侧边栏时,每一行都保持原样。这是因为所有会改变渲染的声明都写在 `title-scroll-reveal` 关键帧里、且填充模式只有 `forwards`——其中就包括那条让文本可被 transform 的 `inline-block`,而它同时也是让省略号消失的原因,于是「…」会一直留到滑动开始的那一帧。
+- `:focus-visible` 把键盘触发限定为真正的键盘焦点,而不是落进该行的任意焦点;它又写在宽容匹配的 `:is()` 内部,因此不支持 `:has()` 的引擎仍然保有悬停触发。
+- 动画是纯 CSS 的,由 `Truncated` 实测并写出的两个自定义属性(`--title-scroll-shift`、`--title-scroll-ms`)驱动:没有定时器,也不需要为每一行订阅媒体查询。transform 被裁在该行原有的盒子内,因此不产生布局位移,该行的点击、拖拽排序与悬停操作按钮也都未受影响。
+- 放得下的标题会被测出「放得下」,从而纹丝不动——不加类、不写变量、不挂 tooltip。这项测量会在尺寸变化时、以及标题或其样式变化时重新执行;1px 的亚像素容差则避免了舍入误差既生出多余的 tooltip、又带来 1px 的滚动。
+
+## 减弱动效与辅助技术
+
+- 在 `prefers-reduced-motion` 下,仓库全局的 `animation: none !important` 区块直接把这段揭示动效整个关掉,无需为它单写覆盖规则。此时标题的渲染与静止状态完全一致:朴素的省略号,外加被截断标题本就为指针悬停带上的 `title` tooltip。
+- 无论视觉上是否被裁,完整标题始终留在 DOM 中,因此屏幕阅读器会把它整句读出。
+- 触摸既没有悬停也没有键盘焦点,而移动端浏览器并不会在长按时给出 `title`;在那里,完整文字要通过打开该 Session 来看到。
diff --git a/packages/web/src/components/layout/sidebar.tsx b/packages/web/src/components/layout/sidebar.tsx
index 87535627..6bdc672b 100644
--- a/packages/web/src/components/layout/sidebar.tsx
+++ b/packages/web/src/components/layout/sidebar.tsx
@@ -2038,6 +2038,8 @@ function DraftRow({
return (
<li>
<div
+ // Same truncated-title scroll reveal as the session rows (#309).
+ data-title-reveal
className={`group flex items-center rounded-md pr-1 transition-colors duration-150 ${
active
? "bg-gray-200/70 dark:bg-gray-800"
@@ -2050,6 +2052,7 @@ function DraftRow({
className="flex min-w-0 flex-1 items-center gap-1.5 px-2.5 py-1.5 text-left"
>
<Truncated
+ scrollReveal
text={title}
className={`min-w-0 flex-1 text-sm ${
active
@@ -2114,7 +2117,8 @@ function GroupPinButton({ pinned, onToggle }: { pinned: boolean; onToggle: () =>
* instead (the menu trigger overlays the exact same slot; the old rename / archive /
* delete hover icons live inside the menu now, joined by pin — one glyph instead of a
* row of three). The menu panel goes through the Dropdown body portal so the sidebar
- * scroller can't clip it.
+ * scroller can't clip it. A truncated title scrolls its tail into view while the row
+ * is hovered or keyboard-focused (#309; Truncated's scrollReveal + data-title-reveal).
*/
function SessionRow({
s,
@@ -2184,6 +2188,9 @@ function SessionRow({
/>
)}
<div
+ // data-title-reveal: hovering the row / keyboard-focusing its button scrolls a
+ // truncated title's tail into view (the Truncated below; styles.css #309 rules).
+ data-title-reveal
className={`group flex items-center rounded-md pr-1 transition-colors duration-150 ${
draggable ? "cursor-grab " : ""
}${
@@ -2204,8 +2211,13 @@ function SessionRow({
<span className="sr-only">{agentHint}</span>
</span>
)}
- {/* Only attach a title attribute when the title is actually truncated (hover to see full text); don't duplicate the text otherwise. */}
+ {/* Truncated titles reveal their full text on row hover / keyboard focus by
+ scrolling the tail into view (#309; scrollReveal, no-op when the title fits).
+ The conditional `title` stays as the pointer-hover fallback under
+ prefers-reduced-motion — not as a touch path: mobile browsers do not surface
+ `title` on long-press. Touch reaches the full text by opening the Session. */}
<Truncated
+ scrollReveal
text={s.title ?? S.chat.defaultSessionTitle}
className={`min-w-0 flex-1 text-sm ${
active
diff --git a/packages/web/src/components/ui/truncated.tsx b/packages/web/src/components/ui/truncated.tsx
index 02ce67cc..07885e9a 100644
--- a/packages/web/src/components/ui/truncated.tsx
+++ b/packages/web/src/components/ui/truncated.tsx
@@ -7,12 +7,37 @@
* this is the one exception. Whether it overflows must be measured
* (`scrollWidth > clientWidth`), and re-measured whenever the container's size
* changes (sidebar collapse / window resize).
+ *
+ * `scrollReveal` additionally scrolls the clipped tail into view (#309): while
+ * the nearest `data-title-reveal` ancestor (the sidebar conversation row) is
+ * hovered or holds keyboard focus, the text slides left by the measured overflow
+ * at a constant reading speed, holds at the end, and snaps back the instant the
+ * hover/focus ends. The animation itself is pure CSS (styles.css
+ * `title-scroll-reveal` keyframes) driven by the two custom properties set here:
+ * this component only measures and publishes numbers. There are no timers and no
+ * media-query subscriptions to leak — reduced motion is handled by the global
+ * `animation: none !important` block in styles.css, which disables the keyframes
+ * outright and leaves the plain ellipsis plus the `title` tooltip. The full text
+ * also always stays in the DOM, so screen readers announce it regardless of the
+ * visual clipping.
*/
import { useLayoutEffect, useRef, useState } from "react";
+import type { CSSProperties } from "react";
+import { revealDistancePx, revealDurationMs } from "../../lib/title-reveal";
-export function Truncated({ text, className = "" }: { text: string; className?: string }) {
+export function Truncated({
+ text,
+ className = "",
+ scrollReveal = false,
+}: {
+ text: string;
+ className?: string;
+ /** Scroll the clipped tail into view while a `data-title-reveal` ancestor is hovered / keyboard-focused (sidebar conversation rows). */
+ scrollReveal?: boolean;
+}) {
const ref = useRef<HTMLSpanElement>(null);
- const [overflowing, setOverflowing] = useState(false);
+ /** Measured overflow in px (0 = fits): > 0 drives both the `title` tooltip and the scroll distance. */
+ const [overflowPx, setOverflowPx] = useState(0);
// className is also a dependency: when the caller switches to font-medium in the
// selected state, the font weight changes and content width (scrollWidth) changes
@@ -20,11 +45,14 @@ export function Truncated({ text, className = "" }: { text: string; className?:
// parent, so clientWidth doesn't move -> ResizeObserver won't fire. Without
// re-measuring, this would under-report (should have `title` but doesn't) or
// over-report (should remove `title` but keeps it).
+ // Measuring while the reveal is mid-scroll is safe: the animation only transforms
+ // the inner span, which leaves the outer span's scrollWidth at its layout value.
useLayoutEffect(() => {
const el = ref.current;
if (!el) return;
- // Subpixel rounding can make even monospace text off by 1px; allow a 1px tolerance to avoid a spurious title.
- const measure = () => setOverflowing(el.scrollWidth > el.clientWidth + 1);
+ // The subpixel tolerance lives in revealDistancePx (title-reveal.ts) so a 1px
+ // rounding artifact produces neither a spurious title nor a 1px scroll.
+ const measure = () => setOverflowPx(revealDistancePx(el.scrollWidth, el.clientWidth));
measure();
if (typeof ResizeObserver === "undefined") return;
const ro = new ResizeObserver(measure);
@@ -32,9 +60,29 @@ export function Truncated({ text, className = "" }: { text: string; className?:
return () => ro.disconnect();
}, [text, className]);
+ const overflowing = overflowPx > 0;
+ // The scroll class and variables are attached only while there is something to
+ // scroll: without them the styles.css rules match nothing, leaving exactly the
+ // pre-#309 rendering (native ellipsis + conditional title) for titles that fit.
+ const scrolling = scrollReveal && overflowing;
return (
- <span ref={ref} className={`truncate ${className}`} {...(overflowing ? { title: text } : {})}>
- {text}
+ <span
+ ref={ref}
+ className={`truncate ${className}${scrolling ? " title-scroll" : ""}`}
+ {...(scrolling
+ ? {
+ style: {
+ "--title-scroll-shift": `-${overflowPx}px`,
+ "--title-scroll-ms": `${revealDurationMs(overflowPx)}ms`,
+ } as CSSProperties,
+ }
+ : {})}
+ {...(overflowing ? { title: text } : {})}
+ >
+ {/* The scroll needs a child the keyframes can turn into an inline-block and
+ transform; at rest it renders inline, i.e. exactly like the bare text node
+ every other caller keeps (native ellipsis included). */}
+ {scrollReveal ? <span className="title-scroll-text">{text}</span> : text}
</span>
);
}
diff --git a/packages/web/src/lib/title-reveal.ts b/packages/web/src/lib/title-reveal.ts
new file mode 100644
index 00000000..5dfb2578
--- /dev/null
+++ b/packages/web/src/lib/title-reveal.ts
@@ -0,0 +1,43 @@
+/**
+ * Pure math of the truncated-title scroll reveal (#309): whether a clipped title
+ * actually overflows, how far it must travel to bring its tail into view, and how
+ * long that travel should take. Kept out of truncated.tsx so the logic is
+ * unit-testable (vitest runs node-only, no DOM) — the component feeds in the live
+ * scrollWidth/clientWidth and writes the results into CSS custom properties.
+ */
+
+/**
+ * Subpixel rounding can report scrollWidth 1px over clientWidth on text that
+ * actually fits (even monospace text can be off by 1px); treat that as "fits" so
+ * neither a spurious `title` tooltip nor a 1px scroll ever appears.
+ */
+export const OVERFLOW_TOLERANCE_PX = 1;
+
+/** Reading speed of the scroll: hidden pixels revealed per second (a comfortable skim pace for one sidebar row). */
+export const REVEAL_SPEED_PX_PER_S = 60;
+
+/** Duration floor: a tiny overflow finishing in under this reads as a glitch rather than a scroll. */
+export const REVEAL_MIN_MS = 350;
+
+/** Duration ceiling: an absurdly long title speeds up rather than holding the hover hostage for 10+ seconds. */
+export const REVEAL_MAX_MS = 4000;
+
+/**
+ * Pixels the text must translate to reveal its clipped tail; 0 = the text fits
+ * (within the subpixel tolerance) and there is nothing to reveal or tooltip.
+ */
+export function revealDistancePx(scrollWidth: number, clientWidth: number): number {
+ const overflow = scrollWidth - clientWidth;
+ return overflow > OVERFLOW_TOLERANCE_PX ? overflow : 0;
+}
+
+/**
+ * Scroll duration for a reveal distance: proportional to the distance (constant
+ * reading speed, so short and long titles feel the same), clamped to the
+ * floor/ceiling above. 0 for "fits" — no distance, no animation.
+ */
+export function revealDurationMs(distancePx: number): number {
+ if (distancePx <= 0) return 0;
+ const proportional = (distancePx / REVEAL_SPEED_PX_PER_S) * 1000;
+ return Math.round(Math.min(REVEAL_MAX_MS, Math.max(REVEAL_MIN_MS, proportional)));
+}
diff --git a/packages/web/src/styles.css b/packages/web/src/styles.css
index f549ad5c..ac7f3164 100644
--- a/packages/web/src/styles.css
+++ b/packages/web/src/styles.css
@@ -297,6 +297,47 @@
animation: drawer-in-right 240ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
+/* Truncated-title scroll reveal (#309, sidebar conversation rows; truncated.tsx attaches the
+ class and the two variables only when the title measurably overflows). While the row — the
+ [data-title-reveal] ancestor — is hovered or holds keyboard focus, the title slides its
+ clipped tail into view: the inner span becomes transformable (inline-block) and translates
+ by the measured overflow (--title-scroll-shift) over a duration proportional to it
+ (--title-scroll-ms), then holds at the end for as long as the hover/focus lasts. The base
+ state is a plain inline span — not transformable — so leaving the row drops the animation
+ and restores the text and its ellipsis in the same frame, with nothing to transition back.
+
+ Everything that alters the rendering lives INSIDE the keyframes, and the fill is `forwards`
+ only: during the 0.3s start delay there is no fill, so the row paints exactly as at rest and
+ a mouse merely passing across the sidebar leaves every title alone, ellipsis included. A
+ plain `display: inline-block` declaration on the hover rule would NOT hold that line — Blink
+ paints no ellipsis for an overflowing atomic inline, so the "…" would vanish the instant the
+ pointer touched the row, 0.3s before anything moved. That same suppression is why no
+ `text-overflow: clip` is needed: inline-block already retires the ellipsis for the duration.
+ Leaving it out is also what makes the degradation clean — an engine that ignores `display`
+ in keyframes gets a no-op (ellipsis kept, `title` tooltip still there) instead of a
+ clipped-but-motionless title.
+
+ Being an animation rather than a transition is what makes the reduced-motion path free: the
+ global `animation: none !important` block below disables the reveal outright, leaving the
+ ellipsis and the `title` tooltip — no JS media query to subscribe to per row, nothing to go
+ stale between render and effect.
+
+ :focus-visible (not :focus-within) scopes the keyboard trigger to actual keyboard focus;
+ inside :is() its selector is forgiving, so engines without :has() keep the hover trigger. */
+@keyframes title-scroll-reveal {
+ from {
+ display: inline-block;
+ transform: translateX(0);
+ }
+ to {
+ display: inline-block;
+ transform: translateX(var(--title-scroll-shift, 0px));
+ }
+}
+[data-title-reveal]:is(:hover, :has(:focus-visible)) .title-scroll > .title-scroll-text {
+ animation: title-scroll-reveal var(--title-scroll-ms, 0ms) linear 0.3s forwards;
+}
+
/* Login page circuit traces (login-circuit.tsx): pathLength=1 normalization, draw-in -> hold -> fade-out
loop. Base state is fully hidden: the positive animation-delay wait keeps the first paint blank, and
lines only start growing after load; once reduced-motion globally disables animation, the override below
@@ -363,6 +404,10 @@
.login-via {
opacity: 1;
}
+ /* The truncated-title scroll reveal (#309) needs no override here: it is delivered
+ entirely by the `title-scroll-reveal` keyframes above — including the inline-block
+ that makes the text transformable at all — so `animation: none` leaves the title
+ exactly as it renders at rest, ellipsis and `title` tooltip included. */
}
/* ---------- Minimal typography for Markdown body content (no typography plugin) ---------- */
diff --git a/packages/web/test/title-reveal.test.ts b/packages/web/test/title-reveal.test.ts
new file mode 100644
index 00000000..f599f25a
--- /dev/null
+++ b/packages/web/test/title-reveal.test.ts
@@ -0,0 +1,134 @@
+/**
+ * title-reveal.ts unit tests: the pure math behind the sidebar's truncated-title
+ * scroll reveal (#309). Distance: only a real overflow (beyond the 1px subpixel
+ * tolerance) counts — it drives both the `title` tooltip and the scroll, so "fits"
+ * must be exactly 0. Duration: proportional to the distance (constant reading
+ * speed), clamped between a floor (a sub-350ms hop reads as a glitch) and a
+ * ceiling (a huge title speeds up instead of holding the hover hostage), and 0
+ * when there is nothing to scroll.
+ *
+ * The second half pins the CSS contract. The arithmetic was never the fragile
+ * part: the reveal only works while three files agree on four names, and nothing
+ * else in the suite notices if one side is renamed. vitest runs node-only here
+ * (`environment: "node"`, no jsdom), so these assert against the source text
+ * rather than a rendered DOM.
+ */
+import { readFileSync } from "node:fs";
+import { dirname, resolve } from "node:path";
+import { fileURLToPath } from "node:url";
+import { describe, expect, it } from "vitest";
+import {
+ OVERFLOW_TOLERANCE_PX,
+ REVEAL_MAX_MS,
+ REVEAL_MIN_MS,
+ REVEAL_SPEED_PX_PER_S,
+ revealDistancePx,
+ revealDurationMs,
+} from "../src/lib/title-reveal";
+
+describe("revealDistancePx", () => {
+ it("reports 0 when the text fits", () => {
+ expect(revealDistancePx(180, 200)).toBe(0);
+ expect(revealDistancePx(200, 200)).toBe(0);
+ });
+
+ it("treats the 1px subpixel rounding artifact as fitting", () => {
+ expect(revealDistancePx(200 + OVERFLOW_TOLERANCE_PX, 200)).toBe(0);
+ });
+
+ it("reports the full overflow once past the tolerance", () => {
+ expect(revealDistancePx(202, 200)).toBe(2);
+ expect(revealDistancePx(350, 200)).toBe(150);
+ });
+});
+
+describe("revealDurationMs", () => {
+ it("is 0 when there is nothing to scroll", () => {
+ expect(revealDurationMs(0)).toBe(0);
+ expect(revealDurationMs(-5)).toBe(0);
+ });
+
+ it("clamps a tiny overflow up to the floor", () => {
+ // 2px at 60px/s would be ~33ms — far below the floor.
+ expect(revealDurationMs(2)).toBe(REVEAL_MIN_MS);
+ });
+
+ it("is proportional to the distance between the clamps", () => {
+ // Exactly one second's worth of travel.
+ expect(revealDurationMs(REVEAL_SPEED_PX_PER_S)).toBe(1000);
+ // Double the distance, double the duration.
+ expect(revealDurationMs(REVEAL_SPEED_PX_PER_S * 2)).toBe(2000);
+ });
+
+ it("clamps a huge overflow down to the ceiling", () => {
+ // 1500px at 60px/s would be 25s — capped so the reveal stays usable.
+ expect(revealDurationMs(1500)).toBe(REVEAL_MAX_MS);
+ });
+
+ it("rounds to whole milliseconds", () => {
+ // 100px at 60px/s = 1666.66…ms.
+ expect(revealDurationMs(100)).toBe(1667);
+ });
+});
+
+const src = resolve(dirname(fileURLToPath(import.meta.url)), "../src");
+const read = (rel: string) => readFileSync(resolve(src, rel), "utf8");
+const truncated = read("components/ui/truncated.tsx");
+const sidebar = read("components/layout/sidebar.tsx");
+/** styles.css with comments stripped and whitespace collapsed, so the assertions survive reformatting. */
+const css = read("styles.css")
+ .replace(/\/\*[\s\S]*?\*\//g, "")
+ .replace(/\s+/g, " ");
+/** The keyframes that carry the whole reveal. */
+const keyframes = css.match(/@keyframes title-scroll-reveal \{.*?\} \}/)?.[0] ?? "";
+/** The hover/focus rule that starts them. */
+const trigger = css.match(/\[data-title-reveal\][^{]*\{[^}]*\}/)?.[0] ?? "";
+
+describe("the truncated-title reveal's CSS contract", () => {
+ it("triggers on the row attribute the sidebar rows actually render", () => {
+ expect(sidebar).toContain("data-title-reveal");
+ expect(trigger).toContain("[data-title-reveal]:is(:hover, :has(:focus-visible))");
+ // Scoped to the inner span, so a title that fits (no class, no variables) matches nothing.
+ expect(trigger).toContain(".title-scroll > .title-scroll-text");
+ });
+
+ it("selects the class names truncated.tsx emits", () => {
+ expect(truncated).toContain('" title-scroll"');
+ expect(truncated).toContain('className="title-scroll-text"');
+ });
+
+ it("reads the custom properties truncated.tsx writes", () => {
+ for (const prop of ["--title-scroll-shift", "--title-scroll-ms"]) {
+ expect(truncated).toContain(prop);
+ expect(`${keyframes}${trigger}`).toContain(`var(${prop},`);
+ }
+ });
+
+ it("moves the text with an animation, which is what reduced motion disables", () => {
+ // The reduced-motion guarantee is the global `animation: none !important` block —
+ // it does not gate on any JS state, but it only reaches animations. Rewriting this
+ // as a transition would keep the visuals and silently lose reduced-motion support.
+ expect(trigger).toMatch(/animation: title-scroll-reveal var\(--title-scroll-ms/);
+ expect(trigger).not.toContain("transition:");
+ expect(css).toMatch(
+ /@media \(prefers-reduced-motion: reduce\) \{[^@]*animation: none !important/,
+ );
+ });
+
+ it("makes the text transformable inside the keyframes, never on the trigger rule", () => {
+ // `transform` is inert on a non-replaced inline box, so the reveal needs the inner
+ // span to become inline-block. It has to happen in the keyframes: as a declaration
+ // on the trigger it would apply the moment the pointer touches the row, and Blink
+ // paints no ellipsis for an overflowing atomic inline — so every long title would
+ // drop its "…" 0.3s before anything moved, which is the flicker the delay exists
+ // to prevent.
+ expect(keyframes).toContain("display: inline-block");
+ expect(keyframes).toContain("transform: translateX(var(--title-scroll-shift");
+ expect(trigger).not.toContain("display:");
+ expect(trigger).not.toContain("transform:");
+ });
+
+ it("holds the revealed tail with a forwards fill after a start delay", () => {
+ expect(trigger).toMatch(/animation:[^;}]*\blinear\b[^;}]*\b0\.3s\b[^;}]*\bforwards\b/);
+ });
+});