fix(core): apply application selectors to Actions Ring layouts - #643
fix(core): apply application selectors to Actions Ring layouts#643AprilNEA wants to merge 1 commit into
Conversation
action_ring.per_app kept looking the foreground identifier up verbatim. Both maps are keyed by the same identifier, so on Windows a Store or self-updating app could keep its button overlay across an update while silently losing its ring layout — the versioned path the ring was keyed by no longer exists. The resolution moves to a shared app_selector module both maps use, so a selector cannot mean one thing for buttons and another for the ring. Behavior for macOS bundle ids and Linux classes is unchanged: an identifier that names no .exe never acquires a fallback.
Greptile SummaryThe PR centralizes per-application selector resolution and applies executable-name fallback matching to Actions Ring layouts, keeping exact selectors authoritative.
Confidence Score: 4/5The PR appears safe to merge, with one non-blocking selector edge case for macOS or Linux identifiers ending in The shared resolver correctly preserves exact-key precedence and existing Windows fallback behavior, but applying it to ring layouts can misclassify an uncommon Files Needing Attention: crates/openlogi-core/src/app_selector.rs, crates/openlogi-core/src/binding/action_ring.rs
|
| Filename | Overview |
|---|---|
| crates/openlogi-core/src/app_selector.rs | Introduces shared exact-then-executable selector resolution; its extension-only fallback can also reinterpret .exe-suffixed non-Windows identifiers. |
| crates/openlogi-core/src/binding/action_ring.rs | Applies shared selector resolution to complete per-application ring layouts and adds exact-precedence and fallback tests. |
| crates/openlogi-core/src/config.rs | Replaces the local selector implementation with behaviorally equivalent shared-helper calls. |
| crates/openlogi-core/src/lib.rs | Registers the new selector module privately without changing the crate’s public API. |
| docs/CONFIGURATION.md | Documents that Actions Ring per-app layouts accept the same selectors as button overlays. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Foreground application identifier] --> B{Exact per-app key exists?}
B -- Yes --> C[Use exact layout]
B -- No --> D{Trailing component ends in .exe?}
D -- Yes --> E[Build lowercase exe selector]
E --> F{Fallback key exists?}
F -- Yes --> G[Use executable-specific layout]
F -- No --> H[Use default layout]
D -- No --> H
Reviews (1): Last reviewed commit: "fix(core): apply application selectors t..." | Re-trigger Greptile
| /// [`crate::app_selector`]), so a Windows `exe:<filename>.exe` selector | ||
| /// covers the ring as well as the button bindings. | ||
| #[must_use] | ||
| pub fn effective_layout(&self, app_id: Option<&str>) -> ActionRingLayout { |
There was a problem hiding this comment.
Non-Windows
.exe identifiers collide
If a macOS bundle ID or Linux application ID ends in .exe, has no exact ring entry, and shares its name with an exe: entry, overlay_for treats it as a Windows executable selector and applies an unrelated Actions Ring layout.
Knowledge Base Used: openlogi-core
Summary
#572 taught
per_app_bindingsto fall back toexe:<filename>.exewhen theforeground identifier is a Windows path, but
action_ring.per_appkept lookingthat identifier up verbatim. Both maps are keyed by the same identifier, so on
Windows a Store or self-updating application could keep its button overlay
across an update while silently losing its ring layout — the versioned path the
ring was keyed by no longer exists.
The resolution moves into a shared
app_selectormodule that both maps use, soa selector cannot mean one thing for buttons and another for the ring. Behavior
for macOS bundle ids and Linux application classes is unchanged: an identifier
that names no
.exenever acquires a fallback, and an exact key still wins overthe fallback.
Changes
openlogi-coreapp_selector, a private module owning foreground-identifier resolution:overlay_for(exact key, thenexe:<filename>fallback) and theexecutable_selectorderivation, with tests for the fallback, the exact-keyprecedence, and the identifiers that must never acquire one.
ActionRingConfig::effective_layoutresolves throughoverlay_forinstead ofper_app.get(app), with tests covering a versioned Windows path matching anexe:layout and an exact path outranking it.Config::effective_bindingsandConfig::has_app_overridecall the sharedhelper;
config.rsloses its localapp_overlaycopy.Docs
docs/CONFIGURATION.md: state thataction_ring.per_apptakes the sameapplication selectors as
per_app_bindings.Testing
All green.
openlogi-coreruns 196 tests, including the four newapp_selectorcases and the two newaction_ringcases.Not runtime-tested on hardware, and not tested on Windows: the change is pure
configuration-resolution logic in
openlogi-corewith no platform-gated code.It reproduces from a hand-written
config.toml— give a device anaction_ring.per_app."exe:sharex.exe"layout and confirm it applies whileShareX is frontmost.