Repository navigation
fix: stop the sidebar's working glyphs from keeping bb redrawing at the refresh rate - #30
Merged
Merged
Conversation
… the refresh rate Any endless animation keeps Chromium redrawing bb's window at the display's refresh rate. On a 120 Hz MacBook Pro the working spinner alone kept bb's renderer, GPU process and WindowServer near a full core while a thread worked; a wrapper rotation, steps(8), an 8 fps image or a JS timer still cost 37-87% of a core, and only a still glyph brought it back to idle. - StatusGlyph: the runtime spinner and the activity glyphs keep their shapes and tones but no longer spin or shine - the Working shelf header icon holds still - the empty-Active typist plays for about 4 s, then rests on its at-rest pose - bb's ThreadStatusGlyph, drawn for other plugins' row statuses, is wrapped so its pulse and shine mask are removed - short-lived loading spinners keep turning and now honour reduced motion - motion.test.ts fails on any new looping animation outside an allowlist Refs get-bb/bb#7233
Reconciling against a loading or failed list cleared every stamp, so a reload restarted every "Working · 5m" from zero. Reconcile only once the list is ready, as usePinnedProjects already does.
A spinner held still reads as frozen. A pulse in a rounded box says "running" without promising motion, matches the enclosed circle-x and circle-question, and stays distinct from the Active shelf's bare pulse. The Working shelf header uses it too.
A T3 Code-style pulse (pingdotgg/t3code#3978): a 2 s cycle with long holds and steps(6) ramps on an HTML wrapper's opacity, pinned to the document timeline on start so every working row changes in the same frames, and held still under reduced motion. Measured on a 120 Hz Mac with Home open, it cost 2-4 points of a core above a still glyph, where the old spin cost a full core. motion.test.ts lists it with that reason.
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
While a thread worked, the sidebar's glyphs animated forever: the working spinner (
animate-spin), the activity glyphs (animate-shine-icon), the Working shelf header, and the empty-Active typist. In Chromium any running animation redraws the window at the display's refresh rate. On a 120 Hz MacBook Pro that kept bb's renderer, GPU process and WindowServer at about one core while bb was on screen, however small the glyph. bb's built-in sidebar has the same cost (get-bb/bb#7233).Measured with bb frontmost, one thread working, 15–20 s windows, at least two runs each:
steps(8), 8 fps image, or JS timerWhat changed
PulseRectangle01, registered asWorking) instead of a spinner; a spinner held still reads as frozen. It breathes like T3 Code's status dot (pingdotgg/t3code#3978): a 2 s opacity cycle with long holds andsteps(6)ramps, on an HTML wrapper rather than the SVG. Each pulse'sstartTimeis pinned to 0 onanimationstart, so working rows change in the same frames (#12962). It holds still under reduced motion. The Active shelf keeps the bare pulse.ThreadStatusGlyph, drawn for other plugins' row statuses, is wrapped so its pulse and shine mask are removed.settings-ui,OpenPorts).ready, asusePinnedProjectsalready does, so a loading or failed list no longer wipes every duration.How I verified
npm run checkpasses: lint, format, Knip, typecheck, 1081/1081 tests, build and the bundle check.motion.test.tsscans shipped source for looping utilities andinfinitekeyframes outside a listed set, each with a reason. Puttinganimate-spinback on the working glyph fails it.working-pulse.test.tschecks that the pulse sits on an HTML wrapper, that only the working glyph pulses, and that the sync pinsstartTimeto 0 while leaving other animations alone.useWorkingSince.test.tsfails without thereadycheck.document.getAnimations()shows no endless animation in the sidebar except the working pulse, atstartTime0.