Visual overlay feedback
The visual overlay is a small, short-lived helper process that gives the user on-screen feedback for device actions and agent events. It shows the Actions Ring, transient keyboard-backlight and lock-key indicators, and notices such as low battery. The agent controls the meaning and lifetime of each display, while the overlay renders the current state and reports user intent.
System role
Overlay boundary
The Actions Ring is a cursor-centred menu with eight fixed positions. A separate helper process displays it over the user's current application without taking ownership of device state or action execution. The helper also displays compact keyboard-backlight and lock-key indicators, plus notice cards when the agent reports information that needs the user's attention. The parent page, Input and on-screen controls, describes how these displays fit with input hooks and other control paths.
The overlay is a pure IPC client. It receives display data from the agent and returns ring intent through a local IPC connection. It does not receive executable actions or device commands. This keeps action choice, device context, and transient feedback policy in the agent while the overlay remains focused on short-lived visual feedback. See Global input hooks for the input source and Synthetic input injection for the separate output path.
References: crates/…/main.rs• L1-7 crates/…/ipc.rs• L51-68 crates/…/ipc.rs• L556-625
Agent-owned session
An overlay session is the agent's record of one open ring. The agent creates a session from the active device and the effective layout for the foreground application. It takes a copy of that layout at open time, so later focus or configuration changes do not change a ring that is already on screen.
The session contains the action meaning, while the overlay receives only labels and icons. A session identifier ties every response to the ring that produced it. A stale response can therefore be rejected without affecting a newer ring.
The application can control whether the ring is enabled, whether haptic feedback is used, and which layout applies. A per-application layout replaces the default layout when the foreground application has a matching entry. The camera page, Camera control integration, is a separate control path and does not own this overlay session.
References: crates/…/orchestrator.rs• L620-654 crates/…/action_ring.rs• L34-54 crates/…/action_ring.rs• L289-333
Feedback lifecycle
Display connection lifecycle
The overlay manages its connection to the graphical display separately from its IPC connection to the agent. On Windows it starts without a display connection because a windowless process can keep the compositor busy; it reconnects before it opens any feedback window. It releases that connection after all windows close and 30 seconds pass with no display, while other platforms stay connected.
Each display path reconnects before it opens a ring, notice, lock-key indicator, or keyboard-backlight indicator. A new connection restarts the idle wait, even when the request does not result in an open window. This keeps the helper ready for nearby feedback while limiting the cost of a warm but unused process.
The following behavior keeps the display connection aligned with visible feedback.
flowchart LR
A[Feedback requested] --> B[Connect to display if needed]
B --> C[Open feedback window]
C --> D[Window closes]
D --> E{Any window remains?}
E -->|yes| F[Keep connection]
E -->|no| G[Wait for idle period]
G --> H[Release connection on Windows]
References: crates/…/windowing.rs• L1-18 crates/…/windowing.rs• L26-66 crates/…/windowing.rs• L68-111 crates/…/main.rs• L78-86 crates/…/main.rs• L90-138 crates/…/main.rs• L213-224 crates/…/tests.rs• L31-72
Trigger and presentation
The overlay begins when an input binding resolves to ShowActionsRing. The input runtime sends the triggering device to the agent's ring manager without blocking the input callback. The agent then checks the active device and its ring settings before it publishes a session.
The overlay replaces any ring that it already shows, captures the display placement for the new session, and opens the presentation supplied by the agent. It connects to the display before opening that presentation. Most platforms use one cursor-centred window. Wayland first tries a transparent layer-surface window for each display, then falls back to compositor-placed windows when the compositor does not support that surface type.
The ring presents each available action as a directional slot. The pointer can select a slot by direction rather than by landing exactly on its icon, and the selected slot can show a translated label. Ring size comes from the agent's presentation, so the feedback can match the configured device layout.
The following flow shows how an input event becomes a temporary visual menu and how the user's choice returns to the device action system.
flowchart LR
A[Input trigger] --> B[Agent checks device and layout]
B -->|valid session| C[Agent publishes presentation snapshot]
C --> D[Overlay connects to display]
D --> E[Overlay opens at cursor or displays]
E --> F[Directional hover, activate, or cancel]
F --> G[Agent validates session]
G -->|activate| H[Agent dispatches action]
G -->|hover| I[Optional haptic feedback]
G -->|cancel| J[Session closes]
An empty, disabled, or unavailable device path produces no ring. The overlay also receives None when the agent has no ring to show. This makes opening and closing part of one state stream rather than separate display commands. If placement fails, the overlay reports cancellation. If opening the selected window or applying its final position fails, it closes the affected session and reports cancellation; if every platform window option is rejected before a window opens, no ring is shown.
References: crates/…/hook_runtime.rs• L30-79 crates/…/main.rs• L210-227 crates/…/action_ring.rs• L123-157 crates/…/main.rs• L104-209 crates/…/ring.rs• L196-214 crates/…/ring.rs• L490-614 crates/…/platform.rs• L20-95 crates/…/placement.rs• L11-71
Interaction outcomes
The overlay reports only three kinds of user intent:
- A hover selects the available slot in the pointer's direction once the pointer leaves the center dead zone. It reports no slot when that direction has no action. The agent ignores repeated reports for the same slot.
- An activation names the available slot in the click's direction. The agent checks the session and then dispatches the snapshotted action.
- A cancellation closes the session without running an action.
The overlay closes its window after an activation or cancellation. The agent remains the final decision point, so a response for an expired, replaced, or unknown session cannot run an action. The overlay keeps the newest pending report in preference to an older report. It retries terminal delivery while the ring can still accept the command, so a brief IPC delay does not lose a final click. A newer command can replace a stalled request at once. Hover and activation can also produce device haptics when the device supports them and the setting allows them. See Synthetic input injection for the action output boundary.
References: crates/…/ipc.rs• L328-519 crates/…/tests.rs• L52-225 crates/…/ring.rs• L205-223 crates/…/ring.rs• L470-483 crates/…/ring.rs• L799-823 crates/…/server.rs• L263-295 crates/…/action_ring.rs• L209-277
Dismissal and expiry
The ring is transient. Its window stays on screen for 15 seconds after it opens. A click on the center cancel control or the panel background closes it. On macOS, a native global mouse monitor also closes it when the user clicks outside the ring without consuming that click. Other platforms use the in-window paths and the timeout.
The agent session lasts slightly longer than the display window. This gives an activation that arrives at the end of the display period time to reach the agent. A second ring trigger dismisses the active session; a later trigger can then open a new one. Session IDs prevent a delayed click from closing or acting on that new ring. The overlay records the session that was visible when an outside click occurred. It therefore cannot dismiss a replacement ring after the queued click reaches the UI. On Wayland, all display windows belong to the same session and close together.
References: crates/…/main.rs• L175-181 crates/…/session.rs• L19-173 crates/…/ring.rs• L217-272 crates/…/platform.rs• L142-191 crates/…/action_ring.rs• L11-17 crates/…/action_ring.rs• L21-32
Keyboard-backlight feedback
The keyboard-backlight indicator is a separate transient display driven by the agent's backlight observations. The overlay shows the current level against the highest reported level with a short text value and a progress bar. It refreshes the same indicator when a newer observation arrives. A hidden observation removes the indicator instead of leaving stale feedback on screen.
The indicator is independent of the Actions Ring. Both observation streams run beside the ring stream, so a backlight update does not open or close a ring. The displayed level is bounded by the reported maximum, and an unavailable maximum produces an empty bar rather than invalid output. If the agent connection ends before it sends a hide event, the overlay creates a hidden observation locally and removes the indicator.
References: crates/…/backlight.rs• L21-73 crates/…/backlight.rs• L75-89 crates/…/ipc.rs• L51-60 crates/…/ipc.rs• L129-161 crates/…/main.rs• L186-224 crates/…/tests.rs• L227-230
Lock-key feedback
The lock-key indicator is a separate transient display for a keyboard lock state change. It announces whether Caps Lock, Num Lock, or Scroll Lock turned on or off, uses the active locale supplied by the agent, and gives the on and off states different visual emphasis. A newer change replaces the text in the existing window so rapid key changes remain one continuous display.
The agent owns the display timer and sends no shown change when the indicator ends. The overlay also clears the indicator when its agent connection is lost. This keeps the lock-key display independent from the ring, backlight indicator, and notices.
References: crates/…/lock_key.rs• L27-44 crates/…/lock_key.rs• L46-110 crates/…/main.rs• L95-103 crates/…/ipc.rs• L556-580
Notice feedback
Notices are agent-controlled cards for transient information that needs attention, such as a device with a low battery. The overlay keeps the current notice list and displays up to three of the newest cards at the bottom centre of the selected display. A low-battery card identifies the device and keeps a reported percentage visible when one exists. It replaces the stack when the agent's list changes and closes it when the list is empty.
The user can dismiss a card locally. The overlay remembers that dismissal while the agent still reports the notice, and a waiting notice can then take the open place. The agent remains responsible for the notice lifetime, so a reconnect shows only notices that are still current. A notice click does not change ring or indicator state.
References: crates/…/notice.rs• L28-107 crates/…/notice.rs• L158-189 crates/…/notice.rs• L192-239 crates/…/notice.rs• L250-350 crates/…/tests.rs• L43-213 crates/…/ipc.rs• L582-625
Overlay state observation
The overlay watches the agent's current ring state through a generation-based long poll. The first observation asks for the current state, so a restarted overlay can paint a ring that is already open. A changed state contains the complete current ring or no ring at all. It does not require event replay.
The overlay watches backlight, notice, and lock-key state through their own observation streams. These displays can therefore change independently, while each view is updated from the newest agent snapshot. Notices and lock-key feedback use an explicit empty value when their agent-owned timer ends.
The overlay checks the IPC protocol version and the agent run identity before it uses the connection. If the agent has been replaced, the overlay leaves its single-instance role so the matching helper can start. If no agent answers for one minute, the helper exits instead of remaining as an orphan process. While connected, command delivery reconnects after a failed request. Terminal commands retry only until the display lifetime ends. A newer pending command supersedes a stalled request, while a stalled hover stops when its command channel closes.
These rules keep the helper tied to the current agent and keep feedback bounded by the lifetime of each display. The agent poll and command paths use separate connection state, so observing a replacement agent starts from that connection's own generation cursor.
References: crates/…/ipc.rs• L81-325 crates/…/ipc.rs• L370-519 crates/…/tests.rs• L10-49 crates/…/tests.rs• L114-230 crates/…/ipc.rs• L336-349 crates/…/ipc.rs• L556-625
Build integration
Runtime packaging
The overlay is built as the openlogi-overlay binary and runs beside the always-on agent. The agent starts a warm overlay helper when it finds the binary. This removes process-start delay from the first ring trigger while keeping the helper's device and action boundaries small.
On macOS, release and development bundles place the helper inside the app as a nested login-item bundle. The development bundle builds the helper in the same profile as the desktop app. On Linux, the package build includes the overlay with the desktop, agent, and CLI binaries. The helper is a private bundled binary rather than a published package. If it is missing, the agent logs that the overlay is disabled rather than blocking the rest of the application.
References: crates/…/Cargo.toml• L1-15 crates/…/overlay.rs• L23-54 xtask/…/embed.rs• L29-45 xtask/…/dev_bundle.rs• L81-102 xtask/…/package.rs• L19-45
Platform presentation
The overlay uses borderless, transparent popup windows that do not activate the user's application. The Actions Ring centers on the cursor's display and stays inside that display. Notices use a separate bottom-centred placement above the Dock or taskbar. The platform layer supplies display geometry because each feedback surface must remain usable across multiple displays and different display scales.
macOS maps the global cursor to the native display before it clamps the ring to that display. Linux uses the runtime display list and falls back to the primary display if the cursor position is unknown. On Wayland, the ring first tries a transparent layer-shell window for each display. If the compositor refuses layer-shell, the overlay remembers that refusal for the process and uses compositor-placed windows instead. Notices use the same preferred layer-shell path with a positioned-window fallback. The ring and notices do not take keyboard focus.
Windows samples the physical cursor and monitor together. It creates a one-pixel bootstrap on that monitor, lets the window adopt the monitor's DPI, and then applies the final physical bounds. This keeps mixed display scales from moving the feedback away from the cursor or placing the notice outside the taskbar-free work area. The native path also removes the default popup frame and system corner decoration so transparent pixels remain the visible boundary. It marks the window as non-activating, so selecting a ring slot keeps keyboard focus in the application below the overlay.
The macOS window policy also keeps the helper out of the Dock and app switcher. Other platforms use the shared popup policy without that application-level change.
The build gives the helper a product identity as well as usable windows. Windows builds embed the OpenLogi icon and version data. The overlay build also tracks the shared locale catalog so catalog edits rebuild the embedded translations. If the Windows resource compiler is missing, local builds can continue with a warning and an icon-less helper; release builds provide the compiler so the helper keeps its icon and version resources. macOS bundles copy the shared app icon into the nested helper and stamp its bundle identity before signing. These steps affect how the helper appears to the operating system. They do not change the feedback state or interaction contract.
References: crates/…/main.rs• L65-81 crates/…/ring.rs• L228-306 crates/…/notice.rs• L113-159 crates/…/platform.rs• L20-191 crates/…/placement.rs• L21-53 crates/…/placement.rs• L198-235 crates/…/windows.rs• L15-123 crates/…/native.rs• L1-300 crates/…/build.rs• L1-83 xtask/…/embed.rs• L47-68
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the shared display lifetime aligned with the ring command retry deadline and the agent session grace period. Keep notice and lock-key end signals aligned with their agent timers.
- Keep the IPC presentation fields separate from the agent's executable action state. A change to one side can silently break activation, localization, or transient notice rendering.
- Keep command coalescing limited to the same session. A new ring's first hover must not be swallowed by the prior ring's terminal command.
- Keep the session identity on the ring view and on click-away events. A queued outside click must not close a replacement ring.
- Keep all windows opened for one Wayland ring tied to the same session and close them as one unit.
- Keep backlight, notice, and lock-key visibility updates independent from ring updates. A lost agent must still clear every visible display it owns.
- Keep Windows cursor and monitor selection in the same physical coordinate space. Do not reintroduce logical display containment for mixed-DPI layouts.
- Keep the Windows monitor-specific bootstrap before the final position and reveal. Applying final bounds before the window adopts target DPI can move or resize the feedback.
- Keep Windows overlay windows non-activating when native styles change. A click on a ring slot must leave focus in the underlying application so the action shortcut reaches the intended application.
- Keep the overlay helper name and nested macOS bundle paths aligned across agent discovery, development bundles, release bundles, and package checks.
- Treat changes to the IPC service method order or wire types as protocol changes. The overlay and agent must still reject mismatched builds safely.
- Keep the overlay build's explicit locale directory input and shared locale catalog available. Missing tracking can leave changed labels stale until an unrelated source change rebuilds the helper.
- Keep reconnect give-up timing scoped to each outage. A reachable replacement agent must reset the overlay's one-minute exit clock.
- Keep Windows resource inputs and product metadata aligned with the helper name. A release build must not silently ship a generic or icon-less helper.
- Keep the preferred Wayland layer-shell path and its fallback as one ordered choice. A permanent compositor refusal must not cause repeated failed surface creation.
- Keep every window-opening path preceded by display connection setup. On Windows, bypassing this step makes GPUI reject the window request while the helper is headless.
- Keep the idle release tied to the last window rather than to one view. A ring closing must not release the display while a notice or indicator is still visible.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Overlay binary is not packaged or cannot be found | Ring and transient feedback have no visual result | Agent discovery logs the disabled state; bundle and package steps check for the helper binary |
| Agent and overlay use different IPC versions | The helper cannot safely read or send feedback state | The overlay checks the reported protocol version and stands down |
| Delayed command names an old session | A stale click cannot activate a replacement ring | The agent validates the session identifier and consumes a session on activation |
| Ring display lifetime and command retry lifetime drift | A visible final click can be abandoned before delivery | Terminal commands use the shared display lifetime and the agent adds session grace time |
| Click-away session identity is cleared by an older view | An outside click can fail to dismiss the current ring or target the wrong ring | The view lifetime guard clears the shared identity only when it still owns that identity |
| One Wayland display window closes while others remain | Transparent windows can continue to cover displays after the ring is gone | Ring teardown closes every window with the matching session identifier |
| macOS click-away monitor is not installed | Outside clicks do not dismiss the ring | The overlay logs the loss and retains center, background, activation, and timeout dismissal paths |
| Wayland layer-shell is refused but the overlay keeps retrying it | Every ring or notice open adds a failed surface request and delays fallback | The platform remembers the compositor refusal and moves to the next window set |
| Windows bootstrap bounds are not expressed for the selected monitor | GPUI can place the initial feedback window on the wrong display or use its large default size | The helper requests a one-pixel bootstrap in the selected monitor's logical space |
| Windows final bounds are applied before the bootstrap adopts target DPI | Feedback can appear at the wrong size or away from the cursor | The native path pins the bootstrap, lets the window update its DPI, then applies final physical bounds without activation |
| Windows cursor and monitor samples use different coordinate spaces or times | The ring can open on the wrong monitor or at the wrong point | The native placement path uses one physical cursor sample for monitor choice and placement |
| Windows overlay does not use a non-activating window style | Selecting a ring slot can move focus to the overlay, so the action shortcut reaches the wrong window | The native path applies the non-activating style before the window is shown |
| Shared localization catalog is not wired to the overlay | Ring, indicator, or notice labels silently fall back to English keys | The overlay build tracks the locale directory, and each view uses the shared catalog |
| Notice dismissal state outlives the agent's notice | A new notice with a reused identity can stay hidden | The shelf retains dismissal only while the current agent list contains that identity |
| Agent disconnects while a notice or lock-key indicator is visible | Feedback can remain on screen after its source has stopped | Lost observation values clear notices and lock-key state locally |
| Agent remains unavailable for one minute | The warm helper exits and no longer provides feedback until the agent starts a replacement helper | Reconnection has a bounded give-up period, and each successful connection resets that period |
| Terminal IPC request stalls while a newer command arrives | The newer activation or cancellation can be delayed behind an obsolete request | The command path supersedes the stalled request and keeps the latest session command |
| Agent disconnects while a backlight indicator is visible | The indicator can remain on screen after its source has stopped | The backlight observer sends a hidden observation when its connection fails |
| A feedback path opens a window while Windows is headless | The requested feedback window cannot open | Each ring, notice, lock-key, and backlight path calls windowing::connect first |
| The last window closes but the idle release is not scheduled | The helper keeps the display connection for its full process lifetime | The windowing policy starts the release wait only when the final window closes |
Key files
| File | Why to read it |
|---|---|
| crates/…/main.rs | Shows the overlay process lifetime and the path from observed agent state to visible ring, notices, and indicators. |
| crates/…/ipc.rs | Shows the independent IPC state streams and the reliable return path for ring hover, activation, and cancel events. |
| crates/…/tests.rs | Shows the connection, generation, coalescing, bounded delivery, and lost-agent guarantees that keep feedback current. |
| crates/…/windowing.rs | Shows when the helper connects to or releases the graphical display on each platform. |
| crates/…/tests.rs | Shows the guarantees for last-window release and platform-specific connection behavior. |
| crates/…/backlight.rs | Shows the compact keyboard-backlight level display and its window policy. |
| crates/…/lock_key.rs | Shows the transient lock-key announcement, localized state text, and in-place update behavior. |
| crates/…/notice.rs | Shows notice list state, local dismissal, card limits, low-battery content, and notice window presentation. |
| crates/…/tests.rs | Shows the guarantees for notice selection, dismissal lifetime, layout, and readable battery details. |
| crates/…/ring.rs | Shows the user-facing ring, directional selection, labels, display placement, and window dismissal behavior. |
| crates/…/platform.rs | Defines the cross-platform window policy, fallback selection, and macOS click-away boundary. |
| crates/…/placement.rs | Shows display selection, Wayland layer-shell fallback, and cursor or bottom-centred placement for macOS and Linux. |
| crates/…/windows.rs | Shows the Windows physical-coordinate placement model, bootstrap window, taskbar-free notice placement, and display-edge clamping. |
| crates/…/native.rs | Shows the Windows monitor sample, DPI handoff, borderless and non-activating window setup, and final feedback placement. |
| crates/…/session.rs | Shows click-away session ownership, multi-window lifetime, and the single-overlay relationship to one agent run. |
| crates/…/build.rs | Shows the build inputs for embedded locale changes and Windows helper identity resources. |
| crates/…/Cargo.toml | Defines the helper binary's product role and its platform build dependencies. |
| crates/…/overlay.rs | Shows how the agent finds, warms, replaces, and stops the helper. |
| crates/…/ipc.rs | Defines the cross-process ring, backlight, notice, and lock-key observation contracts. |
| crates/…/action_ring.rs | Defines the shared ring display lifetime used by the helper and the agent session. |
| crates/…/action_ring.rs | Defines the eight-slot layout and the application-controlled ring settings. |
| xtask/…/embed.rs | Shows how the release app embeds the overlay helper. |
| xtask/…/package.rs | Shows that Linux packages include the overlay binary. |