Repository navigation
perf(app): the mascots' eyes move in moments, not forever - #163
Merged
Merged
Conversation
Blinking and glancing ran as infinite animations, which keep the WebView drawing every frame. A scheduler now picks, every two seconds, which mascots on screen blink (each about every 7 s, a little apart) and now and then lets one idle mascot look around; in between the eyes stand still. Measured in the dev app with the flame running: 1.0-1.2 cores instead of 1.35-1.5.
httpsphl
enabled auto-merge
October 4, 2026 19:24
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.
Follow-up of #162, as the owner chose: the eyes blink and look around in random moments instead of running an animation forever.
features/bots/eyeMoments.ts, started once inmain.tsx: every 2 s it picks which awake mascots on screen blink (each about every 7 s, up to 0.6 s apart, so they do not blink together; 260 ms blink, 800 ms droop for tired lids), and every 9-16 s one idle mascot glances around (4.4 s). Nothing while the window is hidden, unfocused (perf(app): mascots stand still while another app has the focus #162'sdata-blurred), or with less motion.mascot.css: blink, glance and tired droop only run whiledata-blink/data-lookis on the mascot; keyframes rescaled to those short moments. The glance toward another bot (data-glance) is unchanged.Measured (dev app over CDP, same session, flame running in both):
What is left is the flame's continuous morph, which keeps frames coming at the screen's rate.
Test plan
pnpm check(neweyeMoments.test.ts: blink and release, sleeping/still never, glance pacing, nothing while unfocused)