Skip to content

Commit 83c0323

Browse files
committed
fix(thinking): in-shorthand echo delay; paused and reduced-motion tests
1 parent 5ff5ac8 commit 83c0323

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

‎src/theme.css‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,9 @@
554554
100% { transform: scale(1.35); opacity: 0; }
555555
}
556556
@media (prefers-reduced-motion: reduce) {
557+
/* Static poses land the gradient mid-stroke. These offsets mirror the SVG
558+
geometry in thinking-mark.tsx — change the rect/circle geometry there and
559+
these poses have to be re-picked to match. */
557560
.corbits-thinking-silk, .corbits-thinking-strata, .corbits-thinking-echo { animation: none; }
558561
.corbits-thinking-silk { transform: translateX(44px); }
559562
.corbits-thinking-strata { transform: translateY(30px); }

‎src/ui/thinking-indicator.test.tsx‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,16 @@ describe("ThinkingIndicator", () => {
2222
expect(html).toContain(`corbits-thinking-${variant}`);
2323
}
2424
});
25+
26+
test("paused freezes every animated node", () => {
27+
const html = renderToStaticMarkup(createElement(ThinkingMark, { paused: true }));
28+
29+
expect(html).toContain("animation-play-state:paused");
30+
});
31+
32+
test("echo hides its second wave under reduced motion", () => {
33+
const html = renderToStaticMarkup(createElement(ThinkingMark, { variant: "echo" }));
34+
35+
expect(html).toContain("motion-reduce:hidden");
36+
});
2537
});

‎src/ui/thinking-mark.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export function ThinkingMark({ variant = "silk", paused = false, className, styl
5252
{variant === "strata" && <rect className="corbits-thinking-strata [animation:corbits-thinking-rise_3.2s_cubic-bezier(.3,0,.3,1)_infinite]" x="0" y="-12" width="100" height="33" fill={`url(#${gradient})`} />}
5353
{variant === "echo" && <>
5454
<circle className="corbits-thinking-echo origin-[62px_9px] [animation:corbits-thinking-wave_3.6s_cubic-bezier(.15,.3,.3,1)_infinite]" cx="62" cy="9" r="80" fill={`url(#${gradient})`} />
55-
<circle className="corbits-thinking-echo origin-[62px_9px] [animation:corbits-thinking-wave_3.6s_cubic-bezier(.15,.3,.3,1)_infinite] [animation-delay:-1.8s] motion-reduce:hidden" cx="62" cy="9" r="80" fill={`url(#${gradient})`} />
55+
{/* The delay lives inside the shorthand — a separate animation-delay
56+
utility can be reset by the shorthand's own emission order. */}
57+
<circle className="corbits-thinking-echo origin-[62px_9px] motion-reduce:hidden [animation:corbits-thinking-wave_3.6s_cubic-bezier(.15,.3,.3,1)_-1.8s_infinite]" cx="62" cy="9" r="80" fill={`url(#${gradient})`} />
5658
</>}
5759
</mask>
5860
</defs>

0 commit comments

Comments
 (0)