Spinner
ui.widgets.Spinner短时加载状态的紧凑动画。A compact animation for short waits.
BEHAVIOR CONTRACT
尺寸、颜色和持续帧调度由动画管理器统一驱动。Size, color and frame scheduling are driven by the animation manager.
RECORDED INTERACTION
录像保留动态帧,证明不是静态占位图。Keeps live frames — proof it isn’t a static placeholder.
// ── Spinner ──
pub fn buildSpinner(scope: *ui.Scope, cx: *ui.Cx) anyerror!*ui.Node {
const a = cx.allocator;
const r = try row(cx, 20);
// e2e 墨量断言要框到 spinner 本身:story.<key> 的 rect 还含标题/描述文字,
// 那些文字的像素会把 spinner 画不出来这件事完全盖住(实测 7600+ dark)。
r.meta.ownership.meta.test_id = "story.spinner.row";
try r.appendChild(a, try W.Spinner(.{ .size = 16 }).mount(scope, cx));
try r.appendChild(a, try W.Spinner(.{ .size = 24 }).mount(scope, cx));
try r.appendChild(a, try W.Spinner(.{ .size = 36 }).mount(scope, cx));
return r;
}这是 Storybook 中该 story 的原样代码(zenit 5f9add5+wip 2026-09-30)。其中 W 即 ui.widgets,col / row / label 是 Storybook 内的布局小工具。The story's verbatim source from the Storybook (zenit 5f9add5+wip 2026-09-30). W is ui.widgets; col / row / label are small Storybook layout helpers.