Skip to content

app-list: size-aware themed lookup; CRX-aware PWA fallback (cache + theme/maskable-aware); warn-only diagnostics#1123

Open
stephanbuys wants to merge 4 commits intopop-os:masterfrom
stephanbuys:feat/dock-pwa-icon-resolution-2025-10-29
Open

app-list: size-aware themed lookup; CRX-aware PWA fallback (cache + theme/maskable-aware); warn-only diagnostics#1123
stephanbuys wants to merge 4 commits intopop-os:masterfrom
stephanbuys:feat/dock-pwa-icon-resolution-2025-10-29

Conversation

@stephanbuys
Copy link

Dock icons: crisp, correct-size themed lookup; SVG only for -symbolic.

PWA: If theme lookup fails, find best CRX export across hicolor roots; prefer dark/light by theme, prefer maskable, avoid monochrome, PNG>SVG; cache per (name, theme, size).

Logs: warn-only, include app_id/desktop_id/path inline + structured fields.

Perf: cold scan cached; hot path O(1).

@stephanbuys stephanbuys marked this pull request as ready for review October 29, 2025 11:20
stephanbuys added a commit to stephanbuys/cosmic-applets that referenced this pull request Oct 29, 2025
stephanbuys added a commit to stephanbuys/cosmic-applets that referenced this pull request Oct 29, 2025
@stephanbuys stephanbuys force-pushed the feat/dock-pwa-icon-resolution-2025-10-29 branch from c4daee7 to bd55d60 Compare November 20, 2025 09:48
stephanbuys added a commit to stephanbuys/cosmic-applets that referenced this pull request Nov 20, 2025
stephanbuys added a commit to stephanbuys/cosmic-applets that referenced this pull request Nov 20, 2025
@mmstick mmstick requested a review from a team November 24, 2025 16:20
// Helper: search common hicolor paths for a PNG named `<name>.png`, preferring larger sizes.
static ICON_FALLBACK_CACHE: OnceLock<Mutex<HashMap<(String, bool, u16), PathBuf>>> = OnceLock::new();

fn find_hicolor_png(name: &str, requested_px: u16, prefer_dark: bool) -> Option<PathBuf> {
Copy link
Member

@mmstick mmstick Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All code related to icon lookup should be in https://github.com/pop-os/freedesktop-icons so that all applications that use this will get the same icons. This crate is already providing icon caching, so the duplicate layer of caching will increase memory usage for no benefit.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, done

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched fallback roots to BASE_PATHS in src/pwa.rs (see latest head). No hardcoded paths remain

stephanbuys added a commit to stephanbuys/cosmic-applets that referenced this pull request Nov 26, 2025
stephanbuys added a commit to stephanbuys/cosmic-applets that referenced this pull request Nov 26, 2025
@stephanbuys stephanbuys force-pushed the feat/dock-pwa-icon-resolution-2025-10-29 branch from bd55d60 to 5995a7f Compare November 26, 2025 09:39
@stephanbuys stephanbuys force-pushed the feat/dock-pwa-icon-resolution-2025-10-29 branch from 5995a7f to ecffa38 Compare December 12, 2025 11:58
@stephanbuys
Copy link
Author

Removed an accidental Cargo.lock/hygiene commit so the diff is back to PR scope only. Functionality unchanged from prior review, just replayed cleanly on top of upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants