import React from 'react' import { flushSync } from 'react-dom' import { createRoot } from 'react-dom/client' import { AgentStateDot } from '../../../../src/renderer/src/components/AgentStateDot' import { UI_ZOOM_MIN, UI_ZOOM_MAX } from '../../../../src/shared/ui-zoom-level' import './fixture.css' type FixtureOptions = { count: number; baseline?: boolean; offset?: number; paired?: boolean } function anchorBaseline(event: React.AnimationEvent): void { const animation = event.currentTarget.getAnimations()[0] if (animation) { animation.startTime = 0 } } function Fixture({ count, baseline = false, offset = 0, paired = false }: FixtureOptions) { return (
{Array.from({ length: count }, (_, index) => { const size = index % 4 < 2 ? 'size-2' : 'size-1.5' return (
{baseline || (paired && index % 2 === 0) ? ( ) : ( )}
) })}
) } const root = createRoot(document.getElementById('root')!) let generation = 0 Object.assign(window, { spinnerBenchmark: { zoomExtremes: [1.2 ** UI_ZOOM_MIN, 1.2 ** UI_ZOOM_MAX], render(options: FixtureOptions) { flushSync(() => root.render()) } } })