Perf & UI/UX: Animation optimization and petting refinement - #24
Conversation
- Implemented path caching in AnimationManager to reduce I/O. - Refined petting logic with movement thresholds and cooldowns. - Fixed StatsDialog layout to correctly display total points and KPS. - Removed redundant object allocations in mouse move handler.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This update focuses on performance optimizations and UX refinements as part of the Bolt agent mission.
⚡ Performance Improvements
_path_cacheinAnimationManagerto memoizeos.path.existschecks. This significantly reduces system calls when the pet is frequently changing states or selecting random animation variations.QPointinstantiation inAnimationManager.set_mouse_poswhich was being called on every mouse move event.🎨 UI/UX Refinements
InputManagerto require at least 30px of mouse movement over the pet and a 500ms cooldown for "petting" to count. This prevents passive point farming and makes the interaction feel more like a real "stroke" gesture.StatsDialogwhere total points and record KPS were not properly added to the layout, making them invisible. They are now aligned in a single horizontal row for better readability.🧪 Verification
python3 -m unittest discover tests).StatsDialogproving that the points and KPS are now visible and correctly aligned.PR created automatically by Jules for task 6615065163744060581 started by @mx57