Skip to content

fix: selection translate broken on macOS Tahoe 26.x - #1265

Open
aayjaa wants to merge 1 commit into
pot-app:masterfrom
aayjaa:fix/macos-tahoe-selection-translate
Open

fix: selection translate broken on macOS Tahoe 26.x#1265
aayjaa wants to merge 1 commit into
pot-app:masterfrom
aayjaa:fix/macos-tahoe-selection-translate

Conversation

@aayjaa

@aayjaa aayjaa commented Apr 30, 2026

Copy link
Copy Markdown

Problem

Selection translate (划词翻译) fails on macOS Tahoe 26.x:

Fix

  1. New macos_compat.rs: Tahoe-compatible text selection

    • AX API retry logic (3 attempts × 50ms delay)
    • Improved clipboard fallback (150ms delay vs 100ms)
    • Comprehensive logging for debugging
  2. window.rs: Use macos_compat on macOS, keep selection crate for other platforms

  3. main.rs: Enhanced accessibility check with warning when not trusted

  4. Cargo.toml: Bump macos-accessibility-client 0.0.1 → 0.0.2

Testing

Requires macOS Tahoe 26.x machine:

  1. Build: cd src-tauri && cargo build --release
  2. Grant accessibility permission in System Settings
  3. Select text in any app, press hotkey
  4. Check logs for [macos_compat] prefix messages
  5. Repeat 5+ times without restart to verify consistency

- Add macos_compat.rs: Tahoe-compatible text selection with retry logic
  - AX API retries up to 3 times with 50ms delays (handles timing issues)
  - Improved clipboard fallback with 150ms delay
  - Comprehensive logging for debugging
- Update window.rs: use macos_compat on macOS, keep selection crate for others
- Update main.rs: enhanced accessibility permission check with warning
- Update Cargo.toml: bump macos-accessibility-client 0.0.1 -> 0.0.2

Fixes pot-app#1128, pot-app#1138
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant