I/O Physics Countdown
An AI Studio countdown export that shipped as a physics sandbox — Matter.js characters bouncing off Google-colored pegs with pentatonic collision audio.
Pulled an AI Studio countdown out of the zip and found something unexpected — a 2D physics sandbox hiding under a broken timer. The countdown was dead on arrival (Google I/O happened two months ago), and the Matter.js engine was destroying itself every second thanks to a React re-render cascade. But the bones were interesting: characters falling through slanted shelves, bouncing off color-coded pegs, generating pentatonic synth notes on every collision.
Three inflection points shaped the rescue. First, tracing the re-render chain through four files to find why the physics world lasted exactly one second before self-destructing. Second, discovering that nine AI Studio dependencies — including the Gemini SDK — had zero imports in the actual source. Third, admitting the countdown was a lie and the physics was the point, so freezing the timer at "3 days, 7 hours, 42 minutes" to keep the sandbox perpetually interesting.
From recon to GitHub push: one afternoon, 651 packages removed, one critical bug fixed, and a creative demo that sounds as good as it looks.
Timeline
Dropped into an AI Studio export and found a physics engine committing suicide every second. The countdown hook ticks, React re-renders, playCharSound gets a new identity, handleCollision follows, the prop changes, and Matter.js tears down its entire world and rebuilds from scratch. Characters fall for exactly one second, vanish, then nothing happens until the next minute boundary. The fix was three lines — useRef for the collision callback, useCallback on the audio functions — but finding it required tracing a re-render cascade through four files. Classic case of a canvas app fighting React's render cycle instead of working with it.
This app had @google/genai in its dependencies and a GEMINI_API_KEY in its env template. Not a single line of code imported either one. AI Studio exports come with nine scaffolded dependencies you never asked for — hookform resolvers, class-variance-authority, canvas-record, firebase-tools, the whole shadcn starter kit. Grepped every import, found zero hits, ripped all nine. Install went from 1,100 packages to 456. The lesson that keeps repeating: trust the grep, not the package.json.
Google I/O 2026 happened in May. It's August. The countdown shows negative days, and minus signs make terrible physics objects. The initial assessment offered four paths — ship as-is (boring), generic countdown tool (too much work), count-up mode (quirky but niche), or freeze a demo moment. I went with frozen: Date.now() + 3d 7h 42m so there are always interesting characters dropping through the pegs. The countdown is a lie and the physics is the point. Sometimes the best design decision is admitting your app is a toy and leaning into it.