feat(assets): accept both depot filename schemas in the GUI resolver#76
Conversation
Older depots (the MX Vertical, most keyboards, older mice) ship
metadata.json + front.png; newer ones ship core_metadata.json +
front_core.png. Resolve each schema slot — hotspot metadata, hero
render, buttons render — to whichever filename the depot's registry
entry actually lists, instead of hardcoding the *_core names.
- openlogi-assets: replace the CORE_FILES const with METADATA_FILES /
FRONT_RENDER_FILES / BUTTONS_RENDER_FILES preference lists plus
DeviceEntry::{preferred_file, baseline_files}.
- gui resolver: probe both metadata names on disk and fall through both
render schemas so an old-schema depot resolves instead of dropping to
the synthetic silhouette.
- gui + cli sync: fetch the per-depot baseline in either schema; warn,
don't error, when a depot ships no metadata or render.
Keyboards now render their hero image; key-level hotspots live under a
different metadata image key (device_keys_image) and stay a separate
feature.
There was a problem hiding this comment.
ℹ️ One stale comment reference — everything else is clean.
Reviewed changes — The GUI resolver and both sync paths now accept both Logi depot filename schemas (*_core and bare names) via preference-list constants and a new DeviceEntry::preferred_file/baseline_files API, fixing GUI rendering for MX Vertical and older depots.
- Add
METADATA_FILES,FRONT_RENDER_FILES,BUTTONS_RENDER_FILES— Preference-list constants replacing the singleCORE_FILESarray, one per schema slot - Add
DeviceEntry::preferred_file— Resolves a schema slot to the first matching filename in the depot's registry - Add
DeviceEntry::baseline_files— Composes the per-depot baseline (metadata + manifest + hero render) with optional slots - Update GUI resolver — Probes both metadata names on disk; fallback chain includes both schema names for each render slot
- Update CLI and GUI sync — Use
baseline_files()andpreferred_file()instead of hardcoded constants - Update
is_optional_asset— Accepts bothfront_extandfront_ext_prefixes for colour variants - New unit tests —
baseline_filesresolution for core/old/missing schemas, plus end-to-endload_filestest with old-schema depot
Note: 1 inline comment(s) dropped because they did not anchor to lines inside the PR diff:
crates/openlogi-gui/src/asset/sync.rs:125(RIGHT) — line 125 (RIGHT) is not inside a diff hunk
Big Pickle (free) (credentials for Anthropic not configured) | 𝕏
|
Quick follow-up: the dropped inline was about a stale comment at
|
The variant second-pass comment still pointed at CORE_FILES, removed in this PR in favour of DeviceEntry::baseline_files(). Per Pullfrog review.

What
Teach the asset resolver and the two sync paths to accept both depot
filename schemas Logi ships, instead of hardcoding the newer
*_corenames:core_metadata.jsonmetadata.jsonfront_core.pngfront.pngside_core.pngside.pngA depot commits to one schema or the other; each slot now resolves to
whichever filename the depot's
index.jsonentry actually lists. Themanifest.json(device_image/device_buttons_image) already maps tothe concrete render, so colour-variant resolution is unchanged.
Why
The full asset mirror now hosts every Logi Options+ device, but the older
schema covered most keyboards, the MX Vertical, and the older mice.
The GUI gated on
core_metadata.json+front_core.pngliterally, sothose depots fell through to the synthetic silhouette even though their
assets were present.
Changes
CORE_FILESconst withMETADATA_FILES/
FRONT_RENDER_FILES/BUTTONS_RENDER_FILESpreference lists plusDeviceEntry::{preferred_file, baseline_files}.asset/mod.rs): probe both metadata names on disk andfall through both render schemas before giving up.
depot ships; warn (don't error) when a depot has no metadata/render.
Testing
cargo fmt --check,cargo clippy --workspace --all-targets -- -D warnings,cargo test --workspace— all green.baseline_filesresolution for core/old/missing schemas,plus an end-to-end
load_filestest that resolves an old-schema depot(
metadata.json+front.png, no manifest) from a temp dir.Note
MX Vertical now renders fully (it has a
device_buttons_image, so hotspotswork). Keyboards render their hero image, but their key-level hotspots live
under a different metadata image key (
device_keys_image) and need akeyboard button model — that stays a separate feature.