Skip to content

fix(mac): reduce GIF preview memory retention - #55

Open
ZephyrKeXiner wants to merge 1 commit into
AhakeyAI:mainfrom
ZephyrKeXiner:fix/memory-retention
Open

fix(mac): reduce GIF preview memory retention#55
ZephyrKeXiner wants to merge 1 commit into
AhakeyAI:mainfrom
ZephyrKeXiner:fix/memory-retention

Conversation

@ZephyrKeXiner

Copy link
Copy Markdown
Member

Summary / 修改概述

  • This pull request refactors and optimizes the OLED GIF preview functionality in the app, focusing on memory efficiency and improving the user experience when displaying and interacting with animated GIFs. The main changes include replacing the previous all-frames-in-memory GIF preview implementation with a new, on-demand frame decoder, passing the correct frame rate (fps) throughout the preview components, and making minor UI and logic improvements elsewhere.

OLED GIF Preview Refactor and Optimization:

  • Replaced the old AnimatedGIFPreview (which loaded all frames into memory) with a new AnimatedGIFView and AnimatedGIFPlayer that only decodes and displays the current frame at the required size, greatly reducing memory usage when previewing large GIFs. [1] [2]
  • Updated all usages of the GIF preview to pass the correct fps value, ensuring playback speed matches the asset’s intended frame rate. [1] [2] [3] [4]
  • Updated the draggable GIF preview to use the new efficient GIF player and support larger previews without excessive memory use.

UI and Logic Improvements:

  • Disabled the default Command-N shortcut to prevent users from opening multiple main windows, since the app is designed for a single workspace.
  • In VibeBarBridge, ensured old subscriptions are removed before rebinding to prevent duplicate callbacks and memory leaks when views are recreated.

Minor and Cleanup:

  • Removed the now-unused currentOLEDPreviewImage and related image-loading code. [1] [2]
  • Adjusted the onboarding logic so that the main workspace (and its resource-heavy previews) are not created until onboarding is complete, saving resources during the onboarding phase. [1] [2]
  • Added missing import ImageIO for GIF decoding.

These changes collectively improve performance, reduce memory usage, and make the OLED GIF preview more robust and responsive.

@ZephyrKeXiner ZephyrKeXiner self-assigned this Aug 25, 2026
@ZephyrKeXiner ZephyrKeXiner added bug Something isn't working desktop labels Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working desktop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant