Skip to content

fix(core): apply application selectors to Actions Ring layouts - #643

Open
AprilNEA wants to merge 1 commit into
masterfrom
fix/app-selector-ring-parity
Open

fix(core): apply application selectors to Actions Ring layouts#643
AprilNEA wants to merge 1 commit into
masterfrom
fix/app-selector-ring-parity

Conversation

@AprilNEA

Copy link
Copy Markdown
Owner

Summary

#572 taught per_app_bindings to fall back to exe:<filename>.exe when the
foreground identifier is a Windows path, but action_ring.per_app kept looking
that 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_selector module that both maps use, so
a 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 .exe never acquires a fallback, and an exact key still wins over
the fallback.

Changes

openlogi-core

  • Add app_selector, a private module owning foreground-identifier resolution:
    overlay_for (exact key, then exe:<filename> fallback) and the
    executable_selector derivation, with tests for the fallback, the exact-key
    precedence, and the identifiers that must never acquire one.
  • ActionRingConfig::effective_layout resolves through overlay_for instead of
    per_app.get(app), with tests covering a versioned Windows path matching an
    exe: layout and an exact path outranking it.
  • Config::effective_bindings and Config::has_app_override call the shared
    helper; config.rs loses its local app_overlay copy.

Docs

  • docs/CONFIGURATION.md: state that action_ring.per_app takes the same
    application selectors as per_app_bindings.

Testing

cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo test --workspace
RUSTDOCFLAGS="-D warnings" cargo doc -p openlogi-hid -p openlogi-hidpp \
  -p openlogi-hidpp-derive --no-deps --document-private-items

All green. openlogi-core runs 196 tests, including the four new
app_selector cases and the two new action_ring cases.

Not runtime-tested on hardware, and not tested on Windows: the change is pure
configuration-resolution logic in openlogi-core with no platform-gated code.
It reproduces from a hand-written config.toml — give a device an
action_ring.per_app."exe:sharex.exe" layout and confirm it applies while
ShareX is frontmost.

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.
Copilot AI lite review requested due to automatic review settings August 16, 2026 10:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps

greptile-apps Bot commented Aug 16, 2026

Copy link
Copy Markdown

Greptile Summary

The PR centralizes per-application selector resolution and applies executable-name fallback matching to Actions Ring layouts, keeping exact selectors authoritative.

  • Adds a shared exact-then-exe: selector resolver.
  • Reuses the resolver for button bindings, override detection, and Actions Ring layouts.
  • Documents the shared selector behavior and adds focused resolution tests.

Confidence Score: 4/5

The PR appears safe to merge, with one non-blocking selector edge case for macOS or Linux identifiers ending in .exe.

The shared resolver correctly preserves exact-key precedence and existing Windows fallback behavior, but applying it to ring layouts can misclassify an uncommon .exe-suffixed non-Windows identifier after an exact lookup miss.

Files Needing Attention: crates/openlogi-core/src/app_selector.rs, crates/openlogi-core/src/binding/action_ring.rs

Important Files Changed

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
Loading

Fix all with Greploop

Fix All in Codex Fix All in Claude Code

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 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 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

Fix in Codex Fix in Claude Code

@davidbudnick davidbudnick added type: bug Something is broken or behaves incorrectly platform: all Cross-platform issue labels Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform: all Cross-platform issue type: bug Something is broken or behaves incorrectly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants