Skip to content

Fix macOS capsule monitor targeting#649

Merged
appergb merged 1 commit into
Open-Less:betafrom
aron-76:codex/macos-capsule-input-monitor
Jun 13, 2026
Merged

Fix macOS capsule monitor targeting#649
appergb merged 1 commit into
Open-Less:betafrom
aron-76:codex/macos-capsule-input-monitor

Conversation

@aron-76

@aron-76 aron-76 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

User description

Summary

  • Add macOS focused-input monitor detection for the recording capsule using Accessibility caret/input bounds.
  • Use the same target monitor snapshot for capsule layout caching so moving focus to another display triggers repositioning.
  • Keep the existing Windows foreground-window monitor path and fall back to the previous current_monitor() behavior when macOS AX data is unavailable.

Root Cause

The capsule fallback path used window.current_monitor(), which describes where the capsule window currently lives. When the capsule was hidden or had last appeared on a different display, the layout cache could decide nothing changed and skip moving the capsule to the screen that actually contains the active input field.

Validation

  • npm ci
  • npm run build
  • npm run check:macos-capsule-spaces
  • git diff --check

Not run: cargo fmt / cargo check --manifest-path openless-all/app/src-tauri/Cargo.toml because this machine does not currently have cargo or rustc installed.


PR Type

Bug fix, Enhancement


Description

  • Add macOS focused-input monitor detection via Accessibility API

  • Use target monitor snapshot for capsule layout caching on macOS

  • Keep existing Windows path and fallback for other platforms


Diagram Walkthrough

flowchart LR
  A["Capsule positioning"] --> B{"Platform"}
  B -- "Windows" --> C["Foreground window monitor"]
  B -- "macOS" --> D["AX focused input bounds\n→ target monitor"]
  B -- "Other" --> E["current_monitor()"]
  C --> F[Set position & cache]
  D --> F
  E --> F
Loading

File Walkthrough

Relevant files
Bug fix
capsule.rs
Add macOS focused monitor to layout cache                               

openless-all/app/src-tauri/src/coordinator/capsule.rs

  • Added macOS branch in capsule_layout_snapshot to use focused input
    monitor
  • Ensures layout cache key matches actual positioning target
+18/-1   
Enhancement
lib.rs
Implement macOS AX monitor detection                                         

openless-all/app/src-tauri/src/lib.rs

  • Added full macOS AX module with caret/rect detection
  • Implemented focused_input_target_monitor function
  • Added helper functions frame_contains_point,
    frame_distance_to_point_squared
  • Added clamp_to_monitor for Windows edge clamping
  • Updated position_capsule_bottom_center with macOS branch
  • Added unit tests for frame helpers
+396/-3 

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

(Review updated until commit 601c470)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@H-Chris233

Copy link
Copy Markdown
Collaborator

Please resolve the merge conflict.We have just carried out a large-scale reconstruction.

@aron-76 aron-76 force-pushed the codex/macos-capsule-input-monitor branch from ad55c9a to 601c470 Compare June 12, 2026 13:38
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 601c470

@aron-76

aron-76 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Merge conflict has been resolved. I rebased this branch onto the latest beta and pushed the updated commit (601c470). PR-Agent is passing now.

@appergb appergb merged commit 8142cce into Open-Less:beta Jun 13, 2026
4 checks passed
appergb pushed a commit that referenced this pull request Jun 13, 2026
…能 + ASR 本地引擎可切换 + 风格页性能修复(#656) + macOS capsule 监听修复(#649)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants