fix(windows): 修复翻译态 Capsule 宿主标题条重新出现#191
Conversation
There was a problem hiding this comment.
Sorry @Cooper-X-Oak, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
There was a problem hiding this comment.
💡 Codex Review
https://github.com/appergb/openless/blob/c5cdc8dabf0f17268988bd220a537d4589c6abd0/openless-all/app/scripts/windows-ui-config.test.mjs#L80-L81
Update Windows UI config test to match refactored capsule layout
This assertion still expects the old Windows host metrics (220/118/84 with bottomInset: 12) even though this commit changes getCapsuleHostMetrics to 196/92/52 with bottomInset: 0, so the script now fails immediately (node scripts/windows-ui-config.test.mjs). Keeping this stale check makes the regression test unusable and masks future config regressions.
ℹ️ 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".
| if let Err(e) = window.set_decorations(false) { | ||
| log::warn!("[main] disable native decorations failed: {e}"); | ||
| } | ||
| if let Err(e) = apply_mica(window, None) { | ||
| log::warn!("[main] mica failed: {e}"); | ||
| } | ||
| apply_windows_rounded_frame(window); |
There was a problem hiding this comment.
Guard Windows-only main-window calls with cfg blocks
configure_main_window_for_platform now calls apply_mica and apply_windows_rounded_frame outside any #[cfg(target_os = "windows")] block, so non-Windows builds hit Windows-specific symbols in a function compiled for all targets. This breaks macOS/Linux compilation paths (and also applies set_decorations(false) unconditionally), so the change is not portable across the repo’s supported platforms.
Useful? React with 👍 / 👎.
摘要
Fixes #190.
这个 PR 解决的单一目标是:
修复 Windows 在翻译态(显示“● 正在翻译” badge)时,Capsule 宿主标题条 / 原生 chrome 重新暴露的问题。
说明:
cad8536叠加最小增量提交c5cdc8d修复 / 新增 / 改进
configure_capsule_window_for_platform(...)中显式调用window.set_decorations(false)兼容
测试计划
命令:
npm exec tsc; npx vite build结果:通过
证据路径:clean worktree
codex/issue-190-translation-delivery本地终端构建记录命令:
Set-Location src-tauri; cargo check --manifest-path Cargo.toml结果:通过
证据路径:clean worktree
openless-all/app/src-tauri本地检查记录命令:本地 debug 运行 + WebView2 remote debugging + 翻译态复现
结果:通过
证据路径:翻译态复现下,可见 Capsule 原生样式不再包含
WS_CAPTION;对应 issue 证据已补充到 [windows] Capsule 宿主标题条仍然可见,用户没有只看到胶囊本体 #190