Port modifier overlay to Tauri preview - #507
Conversation
Greptile SummaryThe PR ports the modifier-key overlay to the Tauri preview and adds explicit modifier-release recovery across lifecycle transitions.
Confidence Score: 4/5The PR is not yet safe to merge because a failed mouse-button release is forgotten during lifecycle cleanup and can leave dragging stuck at the OS level. release_held_button deliberately retains held_button when OS injection fails, but the newly added end_control_session immediately clears that state across disconnect and accessibility-refresh paths, eliminating every later retry opportunity. Files Needing Attention: cross-platform/src-tauri/src/input.rs
|
| Filename | Overview |
|---|---|
| cross-platform/src-tauri/src/input.rs | Adds typed modifier state and release retries, but session cleanup drops failed mouse-button release state. |
| cross-platform/src-tauri/src/macos.rs | Integrates modifier-overlay cleanup and preserves the existing input object when accessibility-refresh releases fail. |
| cross-platform/src-tauri/src/windows_runtime.rs | Connects modifier overlay state to the Windows runtime and performs input-session cleanup on disconnect. |
| cross-platform/src-tauri/src/modifier_overlay.rs | Implements the dedicated overlay window, canonical labels, revisioned state, placement, and lifecycle notifications. |
| cross-platform/src/ModifierOverlay.tsx | Implements revision-aware overlay event handling and rendering for the dedicated Tauri route. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Modifier command] --> B[DesktopInput state]
B --> C[OS input injector]
B --> D[Modifier overlay notifier]
D --> E[Tauri overlay event]
E --> F[React overlay view]
G[Disconnect or runtime cleanup] --> H[release_all]
H --> I[end_control_session]
I --> D
Prompt To Fix All With AI
### Issue 1
cross-platform/src-tauri/src/input.rs:987
**Failed button releases lose state**
When an OS button-up injection fails during disconnect, accessibility refresh, Bluetooth unsubscribe, runtime reset, or shutdown, `release_held_button` retains `held_button`, but `end_control_session` immediately clears it. The OS button remains pressed while subsequent cleanup has no state with which to retry the release, leaving dragging stuck.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (6): Last reviewed commit: "Merge branch 'main' into agent/tauri-mod..." | Re-trigger Greptile
# Conflicts: # cross-platform/src-tauri/src/macos.rs
|
@greptileai please review the latest commit 7479201 and provide a full score. |
| pub fn end_control_session(&mut self) { | ||
| self.text_streams.clear(); | ||
| self.switch_session = None; | ||
| self.held_button = None; |
There was a problem hiding this comment.
Failed button releases lose state
When an OS button-up injection fails during disconnect, accessibility refresh, Bluetooth unsubscribe, runtime reset, or shutdown, release_held_button retains held_button, but end_control_session immediately clears it. The OS button remains pressed while subsequent cleanup has no state with which to retry the release, leaving dragging stuck.
Prompt To Fix With AI
This is a comment left during a code review.
Path: cross-platform/src-tauri/src/input.rs
Line: 987
Comment:
**Failed button releases lose state**
When an OS button-up injection fails during disconnect, accessibility refresh, Bluetooth unsubscribe, runtime reset, or shutdown, `release_held_button` retains `held_button`, but `end_control_session` immediately clears it. The OS button remains pressed while subsequent cleanup has no state with which to retry the release, leaving dragging stuck.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.|
Want your agent to iterate on Greptile's feedback? Try greploops. |
Summary
Closes #505.
Ports the shipping Windows modifier-key overlay behavior to the Rust/Tauri preview on macOS and Windows.
Changes
Validation
npm run lint(Node 24.13.0)npm test(8 tests)npm run buildcargo fmt --manifest-path src-tauri/Cargo.toml --checkcargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warningscargo test --manifest-path src-tauri/Cargo.toml(64 tests including config)npm run tauri -- build(macOS.appand DMG)Windows compilation and interactive modifier smoke coverage remain delegated to the repository workflow/Windows environment.