Skip to content

fix(linux): 收敛平台契约错配与 best-effort 降级#180

Merged
appergb merged 1 commit into
mainfrom
fix/issue-165-linux-contract-alignment
May 2, 2026
Merged

fix(linux): 收敛平台契约错配与 best-effort 降级#180
appergb merged 1 commit into
mainfrom
fix/issue-165-linux-contract-alignment

Conversation

@appergb
Copy link
Copy Markdown
Collaborator

@appergb appergb commented May 2, 2026

摘要

Closes #165

这不是“完整 Linux 支持重写”,而是先把当前平台契约收回到更诚实、更可用的状态:前端显式识别 Linux,快捷键 UI 不再错配,Wayland 的主听写热键会明确失败而不是静默失灵,划词追问改成 best-effort 抓 PRIMARY selection,Linux 的 clipboard restore 延迟也和 Windows 对齐。

改动

  • detectOS() 新增 linux 分支,避免 Linux UI 落回 mac/win 假象
  • SelectionAsk 新增 Super+Shift+... 预设,并把浮窗热键 / 录音热键文案改成动态参数
  • History 的 copied fallback 文案在 Linux 改为 Ctrl+V
  • Linux 选区抓取从“永远 None”改为 best-effort:依次尝试 wl-paste --primary / xclip / xsel
  • Linux 主听写热键在 Wayland 下明确报 wayland_unsupported,不再悄悄卡死
  • Linux clipboard restore delay 从 150ms 提高到 750ms
  • Linux hotkey capability hint 更新为 X11 / Wayland 分流说明

验证

  • npm run build
  • cargo check --manifest-path src-tauri/Cargo.toml
  • 当前机器没有 Linux Rust target,Linux cfg 分支需 CI / 实机继续兜底

@codex review

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @appergb, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@appergb appergb merged commit 13d9d29 into main May 2, 2026
2 checks passed
@appergb appergb deleted the fix/issue-165-linux-contract-alignment branch May 2, 2026 03:53
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

[linux] Linux 平台契约缺口:UI 错配 / 选区永远 None / 仍用 rdev / 剪贴板延迟未升

1 participant