Reduce memory usage in launcher and notification image handling - #17
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Notification image loading can fail silently when thumbnail subscription throws, leaving pictures blank without falling back to the original URI.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR targets lower steady-state and startup memory usage by deferring app-launcher initialization until first open, and by centralizing notification image lifecycle management with thumbnail generation, caching, cancellation, and cache pruning.
Changes:
- Lazily initialize the application catalog and only compute launcher results after launcher content is first shown.
- Move notification image binding/release logic into a dedicated
NotificationImageResourcesstore and introduce thumbnail generation with bounded workers and cache pruning. - Extend memory-scenario tooling with a new notification hide/retain scenario.
File summaries
| File | Description |
|---|---|
| src/widget/common/NotificationCard.tsx | Switches notification image binding to the new NotificationImageResources and uses thumbnail mode for large images. |
| src/widget/app-launcher/index.tsx | Defers mounting launcher content until first open and triggers state content loading on visibility. |
| src/widget/app-launcher/AppLauncherContent.tsx | Extracts launcher UI/content into a lazily mounted component and exposes focus/reset via a handle. |
| src/stores/notification/notificationThumbnail.ts | Adds thumbnail job queue with bounded workers, subscriber fanout, and cache pruning. |
| src/stores/notification/notificationImage.ts | Introduces centralized notification image resource management with map/unmap-based loading/release and optional thumbnail subscription. |
| src/stores/application/applicationCatalog.ts | Makes app catalog/history initialization lazy to reduce baseline memory usage. |
| src/stores/application/appLauncher.ts | Adds contentLoaded gating to avoid loading/searching applications before launcher is opened. |
| debug/run-memory-scenarios.sh | Adds a new memory scenario for hiding the panel with retained notification images. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+128
to
+130
| } catch (error) { | ||
| console.error(error); | ||
| } |
Comment on lines
+35
to
+39
| const info = file.query_info( | ||
| 'standard::size,time::modified,time::modified-usec', | ||
| Gio.FileQueryInfoFlags.NONE, | ||
| null | ||
| ); |
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.
Summary