Introducing a new way to review your PRs.

Read the announcement

aprilnea / openlogi

⚡️A native, local-first alternative to Logitech Options+, written in Rust 🦀 — remap buttons, DPI, and SmartShift over HID++. No account, no telemetry.

View on GitHub

25 documents · Updated Nov 23, 2026

docs / user-interface-foundation

Reusable user interface foundation

The openlogi-ui crate is the shared presentation layer for OpenLogi's settings app and Actions Ring overlay. It keeps common brand cues, action artwork, and product language aligned while each desktop experience keeps its own layout and interaction model. The shared action set now includes numbered Easy-Switch channel artwork, and the English catalog covers the product's Flow, pairing, and headset sidetone state flows.

This page complements Shared platform services, Core domain and configuration, Permissions and assets, and Desktop application.

Shared presentation boundary

The shared presentation boundary contains visual resources and message identities that both desktop-facing experiences can use. Each consumer supplies its own screens and interaction rules, so the overlay can stay small while the settings app can cover the wider product.

The boundary supports two related experiences:

  • The settings app presents device controls, setup, and configuration.
  • The Actions Ring overlay presents short-lived actions near the cursor.

This separation lets both experiences use the same visual meaning without forcing them to share all presentation code. The common layer stays small enough for the overlay while still covering the settings app's shared product terms.

The presentation flow moves common resources into two different desktop consumers.

flowchart LR
    U[openlogi-ui] --> C[Brand accent]
    U --> I[Action icon assets]
    U --> L[Locale catalogs]
    C --> D[Settings app]
    C --> O[Actions Ring overlay]
    I --> D
    I --> O
    L --> D
    L --> O

Consumer roles

The settings app combines shared icons and color with its own theme and app artwork. The overlay uses the common resources for its ring while keeping its panel, placement, and interaction state local. A visual rule belongs in openlogi-ui when both consumers need the same rule.

References: crates/…/lib.rs• L1-10 crates/…/app_assets.rs• L1-6 crates/…/main.rs• L1-5

Visual primitives

The visual primitives provide a shared action vocabulary without imposing one full theme on both products. Common artwork is embedded in the shared layer so development and packaged builds use the same source.

Brand accent

The brand accent is one shared blue value for the settings app and overlay. accent_at_lightness derives overlay shades by changing only lightness, so the hue and saturation remain part of the same brand color. The shared layer also provides a hue-free neutral color shape for overlay surfaces, while the settings app gets its greys from its active theme.

This keeps the selected-action signal consistent across both experiences without making the overlay depend on the settings app's theme system.

References: crates/…/color.rs• L15-55 crates/…/theme.rs• L30-42 crates/…/ring.rs• L126-180

Action icon set

The action icon set gives action choices and the Actions Ring a common visual vocabulary. The assets are embedded in the shared layer, so packaged and development builds use the same asset source. The action model maps each ring icon, including the cancel target and Easy-Switch channel actions, to a shared asset path. The source also provides dedicated artwork paths for the low-battery notice and lock-key indicator, plus command, directional, and product glyphs used by shared binding and settings surfaces.

The shared source serves only the embedded action-icons/ paths. The settings app adds its logo and app-only widget icons to its own asset composition, while the overlay registers only the shared action source. This keeps settings artwork out of the lightweight overlay while allowing both consumers to show the same ring actions. The numbered channel glyphs give Easy-Switch Channel 1, 2, and 3 actions a stable shared visual form in both the binding editor and the ring.

References: crates/…/action_icons.rs• L1-12 crates/…/action_icons.rs• L20-35 crates/…/action_icons.rs• L32-115 crates/…/action_icons.rs• L117-143 crates/…/action_icons.rs• L186-214 crates/…/square-1.svg• L1-14 crates/…/square-2.svg• L1-14 crates/…/square-3.svg• L1-15 crates/…/icon.rs• L181-194 crates/…/icon.rs• L303-318 crates/…/binding_editor.rs• L103-113 crates/…/app_assets.rs• L22-40 crates/…/main.rs• L47-53

Localized product language

The locale catalogs give the settings app and Actions Ring one set of product messages. A locale is a language and regional variant such as en or zh-TW; a semantic key is the stable name used to request a message even when its wording changes.

The catalogs cover the full product path rather than only shared controls:

Message groupUser-facing purpose
Common and appBasic actions, navigation, app behavior, and product identity
Device, profiles, pointer, and actionsDevice state, bindings, pointer behavior, and action choices
Pairing, permissions, and agentDevice setup, access needs, and background-service state
Updates, assets, about, and appearanceMaintenance, optional resources, product information, and theme or language choices
Diagnostics, camera, lighting, and keyboardDevice health, camera and light controls, and keyboard-facing surfaces
Actions RingRing setup, slots, target paths, and custom shortcuts
Flow and audioCross-computer pointer and keyboard handoff, plus headset sidetone controls and state messages

This shared message set keeps product terms stable as a user moves from device setup to action editing or cross-computer control. The overlay uses the subset needed during a short action session.

Catalog structure

crates/…/en.toml is the English source catalog. It groups messages by product area and defines placeholder shapes for values such as device names, counts, versions, and errors. The regional catalogs provide the same semantic message identities so either desktop process can request a message by key.

The catalogs include device-removal outcomes that distinguish a failed removal from a busy receiver and a missing receiver. They also provide old-pairing cleanup messages, including confirmation, success, and failure states, in every shipped catalog. The English catalog defines shared terms for Flow status, computer pairing, and headset sidetone controls, including loading, offline, and unsupported states. Easy-Switch Channel 1, 2, and 3 also have stable action labels that match the numbered shared glyphs. The supported catalog set includes Czech (cs) and regional Chinese variants. Translation wording can vary by locale, but the key and placeholder contract remains shared across the catalogs. The catalog parity check protects this contract by comparing shipped catalogs with English and checking the supported-locale set.

References: crates/…/en.toml• L1-12 crates/…/en.toml• L88-120 crates/…/en.toml• L398-513 crates/…/en.toml• L909-1016 crates/…/cs.toml• L108-120 crates/…/de.toml• L108-120 crates/…/ja.toml• L108-120 crates/…/zh-CN.toml• L108-120 crates/…/zh-TW.toml• L108-120 crates/…/ko.toml• L1006-1016 crates/…/zh-HK.toml• L1006-1016 crates/…/catalog_parity.rs• L10-93

Locale selection

Locale selection is shared policy, while the message catalogs remain in openlogi-ui. openlogi-core first uses an explicit user choice, then the system locale, and finally English. It keeps regional choices distinct where the product supports them, such as simplified and traditional Chinese.

Each desktop process loads the common catalogs at build time. The settings app applies its resolved locale before it creates menus or windows. The overlay applies the language carried by each ring invocation.

References: crates/…/locale.rs• L1-80 crates/…/main.rs• L37-41 crates/…/i18n.rs• L1-19 crates/…/main.rs• L12-15 crates/…/main.rs• L55-72

Live language changes

The desktop app stores the selected language in app settings and applies it to the process-wide locale. Existing windows need a refresh because rendered views do not change language by themselves. The overlay has a shorter session life, so it activates the invocation language before opening or replacing the ring.

References: crates/…/i18n.rs• L14-19 crates/…/locale.rs• L137-146 crates/…/main.rs• L91-105 crates/…/main.rs• L108-120 crates/…/main.rs• L123-140

Desktop-facing consumption

The common layer is consumed at the edge of each desktop experience. Product code supplies state and interaction behavior, while openlogi-ui supplies the shared visual resources and message identities that make the experiences agree.

Settings app presentation

The settings app uses shared action icons in device and Actions Ring controls, then adds its own logo and widget-kit icons. Its theme uses the shared accent but keeps surfaces, text colors, spacing, and appearance behavior local. This lets light and dark settings views change without changing the accent used by the overlay.

The app's localized messages describe the wider user path from setup to feature editing. The shared layer does not own device state, configuration, or service calls; the desktop process turns those domain results into screens.

References: crates/…/action_ring.rs• L16-42 crates/…/binding_editor.rs• L103-113 crates/…/app_assets.rs• L22-35 crates/…/theme.rs• L1-13 crates/…/main.rs• L86-106

Actions Ring presentation

The Actions Ring overlay receives an already prepared action session from the agent and renders it near the cursor. It uses shared icon paths and common action language while keeping its panel, neutral colors, placement, and interaction state local.

The settings app edits the ring configuration, while the overlay gives quick access to the resulting actions. Both experiences therefore share the action vocabulary without sharing each other's window or widget code.

References: crates/…/ring.rs• L14-89 crates/…/action_ring.rs• L27-42

Change checklist

When these files or sections are changed, remember to consider these:

  • Add every new message key and placeholder shape to all locale catalogs. Keep the supported-locale list and parity checks aligned with the catalogs.
  • Keep action icon variants, their asset paths, and the embedded shared asset list aligned. A valid action icon or shared glyph without embedded bytes can render as a blank action or control.
  • Keep Easy-Switch action labels, icon mappings, and numbered SVG assets aligned. A mismatch can leave a channel action with the wrong name or no artwork.
  • Keep shared cancel and notice paths valid when their consumers change.
  • Keep the shared accent source shared. Do not add a second blue for a role already covered by the common color.
  • Review both desktop consumers when changing the common presentation boundary. Settings-only artwork or UI dependencies must not cross into the overlay.
  • After changing locale activation, preserve the desktop window refresh and the overlay's per-session language update.

Important failure modes

TriggerConsequenceGuard
A locale has a different key, order, or placeholder set from EnglishA desktop surface can show a raw key or format a message incorrectlyCatalog parity checks compare each supported catalog with English
A new catalog message is added in only one languageOne experience falls back or shows a missing message for that product stateAdd the semantic key to every shipped catalog
An Easy-Switch action label, icon path, and SVG asset are not updated togetherA channel action can show the wrong label or a blank glyphKeep the action model, locale key, and embedded asset table aligned
An action icon maps to an asset path that is not embeddedThe action, notice, or cancel target appears blankKeep icon mappings and shared asset registration aligned
The desktop app omits the shared action asset sourceRing artwork works in the overlay but not in the settings previewCompose desktop assets with the shared action source
The desktop locale changes without a window refreshExisting menus and views keep the old languageRefresh open desktop windows after locale activation
The overlay opens before its invocation language is activeA ring session can show text from an older session or default localeApply the session language before opening the ring
The common layer takes a settings-only UI dependencyThe lightweight overlay inherits a dependency it cannot use or should not carryKeep the shared crate limited to common presentation needs

Key files

FileWhy to read it
crates/…/lib.rsDefines the shared presentation boundary.
crates/…/color.rsDefines the common brand accent, its derived shades, and the shared neutral color shape.
crates/…/action_icons.rsDefines the embedded action and shared product icon source, including numbered Easy-Switch glyphs.
crates/…/square-1.svgIllustrates the numbered Easy-Switch channel artwork used by shared action surfaces.
crates/…/square-2.svgIllustrates the second numbered Easy-Switch channel artwork.
crates/…/square-3.svgIllustrates the third numbered Easy-Switch channel artwork.
crates/…/en.tomlDefines the English message keys and placeholder shapes, including Easy-Switch labels, Flow, pairing, and sidetone states.
crates/…/cs.tomlIllustrates a translated catalog in the supported locale set.
crates/…/zh-TW.tomlIllustrates a regional catalog and its shared key contract.
crates/…/catalog_parity.rsDefines the locale catalog contract across supported languages.
crates/…/locale.rsDefines locale choice and regional fallback behavior.
crates/…/action.rsDefines the user-facing Easy-Switch channel actions and their message identities.
crates/…/icon.rsDefines the action icon vocabulary and its shared asset paths.
crates/…/app_assets.rsShows how the settings app combines shared and app-only artwork.
crates/…/i18n.rsShows how the desktop applies and refreshes the shared language.
crates/…/theme.rsShows how the desktop uses the shared accent with its own theme.
crates/…/action_ring.rsShows how the settings app presents the shared ring vocabulary.
crates/…/binding_editor.rsShows how the settings app presents shared Easy-Switch channel artwork.
crates/…/main.rsShows how the overlay loads shared assets and applies each session's language.
crates/…/ring.rsShows how the overlay consumes shared icons while keeping local ring styling.