Conversation
- Changed ClipboardMenuItem to inherit from Gtk.MenuItem for better functionality. - Added focus management and explicit size requests for images in the clipboard menu. - Implemented caching mechanisms in ImageClipboardItem to speed up retrieval of image data. - Optimized clipboard data serving by using cached PNG bytes to reduce processing time.
- Added 'image-cache.vala' to implement a global LRU cache for PNG data, replacing the previous two-tier caching system. - Updated 'zeitgeist-clipboard-storage.vala' to utilize the new caching mechanism, improving performance during image pasting and menu display. - Introduced lightweight loading of thumbnails for menu display, significantly reducing memory usage and improving responsiveness. - Enhanced the overall architecture to eliminate feedback loops and reduce CPU usage during clipboard operations. - Documented the new implementation in 'IMPLEMENTATION.md', detailing the image lifecycle, caching strategy, and performance improvements.
…p thumbnails - Release clipboard ownership to avoid lingering pixbuf references after clearing history. - Implement debounce for speculative decoding to optimize performance during rapid item scrolling. - Add methods to delete individual and all thumbnail files to prevent orphaned data accumulation.
…oop and enhance thumbnail saving with atomic writes
|
Thanks for bringing up this issue. What AI did you use to generate this? The change is quite invasive, so can you explain in your own words, what the actual issue/bug is you would like to solve? e.g. steps to reproduce the bug and what you would expect instead. |
|
Thank you for the review. Here is the full story behind this patch: The Goal (The Journey Begins): I wanted to modernize Diodon to behave like the Windows 11 Clipboard Manager — specifically, to show actual image previews in the history menu instead of just file icons. The Failure (The Bug): When I first implemented the UI changes, the application effectively broke.
The Solution (This PR): I realized I could not ship the UI changes without fixing the underlying performance architecture. That is why this patch is invasive.
rearding AI, yes got help from opus 4.6. Steps to Reproduce the Issue (without this patch):
Result: The UI lags significantly or the application becomes unresponsive. The cpu utilization increases and in my laptp the fans usually start, i have an amd 7430U processor. Expected: Instant menu opening and zero-delay pasting (which this patch achieves). If you have any questions do ask |
…tions added delete orphan method to make ensure that orphan thumbnails are deleted after an expiry of 24 hours
Title: Improve Image Handling, Performance, and Memory Usage in Diodon
Description:
This pull request enhances Diodon’s image clipboard functionality by improving performance, reducing memory usage, and fixing bugs in image pasting and history management. Key changes include: