Repository navigation
perf(app): keep still what nobody watches - #78
Merged
Merged
Conversation
Every mascot in the sidebar and the crew cards morphed its flame outline forever, a clip path the browser repaints every frame, even for bots doing nothing; and with the window hidden near the clock the animations, the status poll and the file scans went on for nobody. - ListAvatar: in the sidebar and the crew cards, a bot at rest (idle or sleeping) keeps its look but does not move; working, waiting and tired bots still do. The header and the reply being written are as before. - shell/visibility.ts follows whether the window is in sight: the page's visibility, plus a mark the app sets when it hides its own window or opens hidden at sign-in, cleared when the window comes to the front. Out of sight, paused.css pauses every animation, and the status poll waits and reads once when the window is back. - A working bot's files are scanned every 4 s only while the files panel is open and in sight; otherwise when the turn ends, as before.
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.
Fifth slice of the performance round. It is independent of the others.
What changes
d: path()morph on the flame outline, which is also theclipPathof the blurred shading. The browser repaints that every frame, one per bot, even for bots doing nothing.ListAvatarkeeps the mood's look (closed eyes, small ember) withdata-still, and moves only when the bot works, waits for the owner or is at its usage limit.shell/visibility.ts).closing.ts), or it opened hidden at sign-in. The window coming to the front clears it.paused.csspauses every animation (in the preview, 99 paused while hidden, back to running when shown);system.statuspoll waits, and runs once when the window comes back.files.listscan (it walks the bot's folders) runs every 4 s only with the files panel open and in sight. With the panel closed, the new-files counter updates when the turn ends, when the list is already read once more.paused.css);motion.cssdid not grow.Not done here:
animate-attentionlimited to cards that just arrived. It runs only once (1.4 s), so it isn't worth it.Tests
visibility.test.tsx:data-hidden;files.listpolls only with the panel open and the window in sight.avatar.test.tsx:ListAvataris still when idle or asleep, and moves when working.pnpm checkpasses.Manual check (real app)