Repository navigation
GPUI: faster persistent artwork, any-format grid art, chrome bars and new icons - #709
Merged
Merged
Conversation
Steam Art Manager keeps the source file's extension when it writes grid art (and renames .webp to .jpg without converting it), so custom covers saved as .gif, .jpeg, .webp, .svg, .ico, and similar were never found: /art/grid only looked for .png and .jpg. Match <appid>p.*, <appid>_hero.*, and <appid>.* against an allowlist of image extensions, case-insensitively, which also skips the <appid>.json logo-position files that share the folder. Unknown extensions elsewhere keep the image/jpeg default.
Artwork used to live only in memory: every launch re-downloaded each card and hero, retried known misses, and any grid art change threw the whole cache away. Fetch chains also ran blocking HTTP on GPUI's background executor, queueing image decodes behind network timeouts. - Record resolved art in cache/gpui-artwork/index.json so relaunches show it immediately. Entries revalidate in the background without blanking the screen: every session for local sources, weekly for remote art, and when candidates change. Misses are kept for a day. - Run fetches on a dedicated six-thread pool with urgent and background queues, and reuse one HTTP agent. - Normalize stored art: rasterize SVG with resvg, convert formats GPUI can't decode (AVIF, HEIC, ICNS, ...) with sips, downscale oversized stills to a pixel budget, and keep animated GIF/WebP/APNG as is. - Refresh only the appids whose grid files changed, including changes made while MetalSharp was closed (signature saved with the index). - Name tilted dock variants after their card file so they are reused across launches, and sweep orphaned files from earlier sessions.
- Header and footer use the website's ink surface with a hue wash and a spectrum hairline. Dark keeps the site's cyan, blue, and violet; other themes re-hue it around their accent, as does the footer Stream icon. - Start Steam gets a Steam-style mark and Launch Ubisoft a Ubisoft Connect-style swirl (original drawings, not the trademarks). - The tab switcher uses a gamepad for Play and a sharp sign for the Sharp Library, with matching Collection and Logs icons. - The theme menu gets a fuller moon, a sun, and a dragonfruit.
GPUI only advances an image's frames when the img has an element id to keep frame state in, and none of the artwork images had one, so animated covers from Steam Art Manager showed their first frame. Give library, dock, hero, uninstalled, and Sharp Library art a stable id per file. Pre-rendered tilted dock cards are a single still frame and GPUI can't rotate raster images, so the cache now records animated art and the dock shows those covers straight (the arch only tilts 3-6 degrees).
The hero drew its art at 62% opacity under a full-frame 31% black wash plus an 85%-to-15% left scrim, so even the right side of the art showed at about a third of its real brightness. Draw the art opaque and keep only a left scrim behind the title and Play button that clears by 72% of the width; the bottom fade into the dock is unchanged.
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
Artwork loading and caching
~/.metalsharp/cache/gpui-artwork/index.json, so relaunches show cards and heroes immediately instead of re-downloading them.Any artwork format
/art/gridserves any image extension Steam Art Manager writes (.gif,.jpeg,.webp,.svg,.ico,.avif, …), not just.png/.jpg. Steam Art Manager keeps the source extension (and renames.webpto.jpg), so those covers were never found.sips, and animated GIF/WebP/APNG are kept as-is so they animate.Chrome header and footer
Icons (original drawings in the existing 24px style, not the trademarks)
Testing
make -C app/src-c testcargo fmt --check && cargo testinapp-gpui(75 passed). New tests cover byte-for-byte storage, downscaling, SVG rasterization, animated GIF preservation, rejection of error pages, and fingerprint stability.python3 app-gpui/inventory-backend-routes.py --check(regenerated; only line numbers and the router hash moved)clang-format --dry-run --Werroronbackend.c/Applications/MetalSharp.app(Developer ID re-signed) and checked against a real library: the tilted dock cards and themed bars render, and the artwork index (14 entries plus the grid signature) persists across quit.