现象
Linux 平台对外仍是一等公民(CI 出 deb/rpm/AppImage、Sparkle updater 走 linux-x86_64),但实际代码里多个 Linux 路径是占位 / 漂移到 Windows 分支:
UI 走 Windows 分支 :detectOS() 只识别 mac/win,Linux 用户看到 Windows 自绘标题栏 + Windows hotkey preset 列表(Ctrl+Shift+;),但后端按 Linux 解析 modifier(cmd → SUPER)
划词追问选区永远 None :selection.rs:79 Linux 直接 `return None`,但 SelectionAsk 设置页仍展示 hotkey 配置入口
主听写仍用 rdev :CLAUDE.md 明确 rdev 在 macOS 不可靠,项目记忆里 Wayland 下也有问题,但 Linux 仍 `hotkey.rs:653` 走 rdev
Linux 剪贴板恢复延迟未升 :Win 已升 750ms 修终端慢粘贴(fix(windows): 延后剪贴板恢复并补齐插入回归覆盖 #160 ),Linux 仍 150ms(gnome-terminal / wezterm 等同类问题)
复现
UI 错配 :在 Linux 跑 OpenLess → 看到 Windows 自绘标题栏(不该)
选区 :选段文字 → 按 Cmd+Shift+; → Option 录音 → 提问 → LLM 收到的"选区"段是空
rdev :在 Wayland session 里 OpenLess hotkey 完全不响应(rdev 在 Wayland 下没 input event)
剪贴板 :在 Linux 终端听写,文本可能"被旧剪贴板覆盖"现象(同 [windows][insertion] 终端旧剪贴板粘贴风险已收敛,当前整链路回归稳定 #159 Win 那条)
根因
子问题
文件:行
解释
UI 错配
src/components/WindowChrome.tsx:19 detectOS()
仅 `navigator.userAgent.includes('Mac')` 二叉,Linux 落到 `'win'` 分支;连带 `App.tsx:37,59,98` + `SelectionAsk.tsx:43` 全部错配
QA 选区
selection.rs:79
`#[cfg(all(not(target_os = "macos"), not(target_os = "windows")))] log::info!("platform unsupported, returning None");`
Linux hotkey
hotkey.rs:653
`#[cfg(all(not(target_os = "macos"), not(target_os = "windows")))]` 仍 import rdev
Linux 剪贴板 delay
insertion.rs:21
`#[cfg(all(not(target_os = "macos"), not(target_os = "windows")))] const CLIPBOARD_RESTORE_DELAY: Duration = Duration::from_millis(150);`
影响
平台 :Linux 用户全部
使用程度 :划词追问在 Linux 完全不可用 (选区永远空);主听写在 Wayland 下不工作;UI 错配体感不专业
CI / 分发 :Linux 包仍在产出(deb/rpm/AppImage),但跑起来体验欠佳
建议 fix(拆分子任务)
可以拆三个子 PR 分别推进:
PR-A: UI / detectOS Linux 分支
`detectOS()` 加 `'linux'` 返回值
`App.tsx` 启动 gate 给 Linux 单独路径(无 hotkey-status 轮询,参考 macOS 走 a11y/mic 轻量检查或直接 ready)
`SelectionAsk.tsx` 加 `QA_HOTKEY_PRESETS_LINUX`(Super+Shift+; 系列,跟 GNOME / KDE 默认快捷键不撞)
`WindowChrome.tsx` Linux 不渲染 Windows 自绘 titlebar,走系统 chrome
PR-B: Linux 划词追问选区捕获 + hotkey
`selection.rs` 加 X11 / Wayland 选区抓取:xdotool / wl-clipboard 调用 / X11 `PRIMARY` selection / atspi for AX
`hotkey.rs` Linux 替换 rdev(用 X11 `XGrabKey` 或 Wayland `org.gnome.Shell.Extension` / `org.freedesktop.portal.GlobalShortcuts`)
短期降级:UI 上明确"Linux 暂不支持划词追问",把 SelectionAsk 入口隐藏
PR-C: Linux 剪贴板延迟跟 Win 对齐
短期最快:先做 PR-A(前端纯改 UI),让 Linux 用户至少看到正确分支。Linux 后端补齐留长 sprint。
现象
Linux 平台对外仍是一等公民(CI 出 deb/rpm/AppImage、Sparkle updater 走 linux-x86_64),但实际代码里多个 Linux 路径是占位 / 漂移到 Windows 分支:
detectOS()只识别 mac/win,Linux 用户看到 Windows 自绘标题栏 + Windows hotkey preset 列表(Ctrl+Shift+;),但后端按 Linux 解析 modifier(cmd → SUPER)selection.rs:79Linux 直接 `return None`,但 SelectionAsk 设置页仍展示 hotkey 配置入口复现
根因
src/components/WindowChrome.tsx:19 detectOS()selection.rs:79hotkey.rs:653insertion.rs:21影响
建议 fix(拆分子任务)
可以拆三个子 PR 分别推进:
PR-A: UI / detectOS Linux 分支
PR-B: Linux 划词追问选区捕获 + hotkey
PR-C: Linux 剪贴板延迟跟 Win 对齐
短期最快:先做 PR-A(前端纯改 UI),让 Linux 用户至少看到正确分支。Linux 后端补齐留长 sprint。