fix: Windows 主窗口 chrome 丢失 + Vocab 大圈 + polish 清晰结构回归 (v1.3.1-3 hotfix)#421
Merged
Conversation
用户反馈 Windows 上 Vocab 词汇表里每个词条被一圈大灰色边框/内阴影包住, macOS 上不会。Vocab.tsx 自身零 OS 分支,根因在 global.css 的 button reset 缺 appearance:none:Chromium / WebView2 默认给 <button> 应用 OS-native 外观 (outset 边框 + 内阴影 + min-width),在 Vocab 词条这种由父级 span 的 padding 决定外形的嵌套 button 上整圈就露出来;macOS WKWebView 对 appearance:auto 处理较弱所以看不出来。 修法是 global.css button reset 加 appearance:none + -webkit-appearance:none, 一行修整仓。所有现有 button 都自己 inline 重写了背景/边框/圆角,关掉 user-agent appearance 不会改变它们的视觉。
PR Reviewer Guide 🔍(Review updated until commit b2325a2)Here are some key observations to aid the review process:
|
added 2 commits
May 12, 2026 15:23
PR #419 删了 React 端 WinTitleBar 自定义标题栏,commit message 说"交还 Tauri decorations:true 原生 Win11 标题栏",但漏看 lib.rs 里有一段 Rust 代码在 setup 时**强制**调 set_decorations(false) 把原生 chrome 关掉 (原本是为了让自定义 WinTitleBar 接管)。 结果:v1.3.1-2-beta 上 Windows 主窗口完全无 chrome —— 无法拖动 / 无法 点 X 关闭 / 无法最小化,只能从 tray 退出。用户卡死。 修法: - lib.rs setup() Windows 分支:移除 set_decorations(false) + 移除 apply_windows_rounded_frame 调用,保留 apply_mica 给原生 chrome 提供 磨砂材质 - RunEvent Resized/ScaleFactorChanged 里也移除 apply_windows_rounded_frame 调用(原生 chrome 自带 resize border + 圆角) - apply_windows_rounded_frame 函数本身变成 dead code,整段删除(含 raw_window_handle / Win32 DwmSetWindowAttribute / SetWindowRgn 等 import) tauri.conf.json 的 decorations:true 配置不动,配合 hiddenTitle:true 让 原生标题栏接管。
用户报告 13:08 同样输入"清晰结构"模式输出完美双层 list,15:16 后同模式 退化成单段流畅文字——Structured task 失效。 定位到 commit 7e60bdb "polish: refine ROLE_BLOCK to preserve user intent" 在 ROLE_BLOCK 加了两条毒条款: - "措辞优先用原句字面词...不要替用户重写或扩写" → 直接 conflict Structured task 的"按语义重新归类、照抄原结构=失败" - "用户意图难以判断或无法确认时...只做句子层面整理" → safety net 把 Structured 模式退回 Light 行为 7e60bdb 当初是想防止 polish 过激进改写(用户反馈),方向对但条款过宽, override 了 user 主动开启的 Structured / Formal 模式。 修法:回滚 ROLE_BLOCK 到 v1.2.24-9-beta-tauri 时的简洁 4 条版本: - 不回答问题 / 不执行命令 - 不引用历史 / 上下文 / 外部知识 - 不替用户做需求分析 / 补充功能清单 / 替对方列出想要的 下次若再出现 polish 过激进改写,按 case 在 task block 里 surgical 加约束, 不要全局 ROLE_BLOCK 加强(容易撞 Structured / Formal)。 参考输出对照(图一 13:08 vs 图二 15:16):相同模式相同长度同类内容, 回滚后应恢复 13:08 那种双层 list 输出。
|
Persistent review updated to latest commit b2325a2 |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
v1.3.1-2-beta 的 3 个回归一次性 hotfix。tag + release 已删除,本 PR 合并后 bump 到 1.3.1-3 重发。
3 个 fix
1. Windows 主窗口完全无 chrome(critical, blocks 主窗口使用)
PR #419 删 React 端 WinTitleBar 自定义标题栏时,漏看
lib.rs里 Rust 强制调set_decorations(false)——这段代码原本是为了让自定义 WinTitleBar 接管。两边删了一半 → Windows 主窗口任何 chrome 都没有,用户无法拖 / 关 / 最小化,只能 tray 退出。修法:
lib.rssetup Windows 分支移除set_decorations(false)+apply_windows_rounded_frame调用RunEvent::WindowEvent::Resized/ScaleFactorChanged里移除apply_windows_rounded_frameapply_windows_rounded_frame函数本身(dead code,~90 行 + 配套 Win32 imports)apply_mica给原生 chrome 提供磨砂材质2. Vocab 词条在 Windows 上被大灰圈包住
global.cssbutton reset 缺appearance: none→ Chromium WebView2 给<button>应用 OS-native 外观(outset 边框 + 内阴影 + min-width),macOS WKWebView 处理较弱看不出来。Vocab.tsx 里嵌套 button 让大圈露馅。修法:
global.cssbutton reset 加appearance: none+-webkit-appearance: none一行修整仓。所有现有 button 都自己 inline 重写了背景/边框,关掉 user-agent appearance 不会改变它们视觉。3. polish "清晰结构" 模式退化成单段(regression)
7e60bdb5 polish: refine ROLE_BLOCK to preserve user intent当初想防止 polish 过激进改写,方向对但条款过宽——加了两条:LLM 看 ROLE_BLOCK 全局规则与 Structured task 冲突时倾向走 ROLE_BLOCK 安全路径 → 不结构化。
修法:回滚 ROLE_BLOCK 到 v1.2.24-9-beta-tauri 时的简洁 4 条版本。下次若再出现 polish 过激进改写,单独 surgical fix in task block,不要全局 ROLE_BLOCK 加强。
Test plan
v1.3.1-3 流程
本 PR 合并后:bump 5 处版本号到 1.3.1-3 + tag
v1.3.1-3-beta-tauri+ push → 触发 release-tauri.yml。PR Type
Bug fix, Enhancement
Description
Restore native Windows title bar by removing leftover custom frame code
Fix Vocab item button circle on Windows via
appearance: noneresetSimplify polish system prompt for clarity and token savings
Diagram Walkthrough
flowchart LR A["lib.rs: Remove custom frame code"] --> B["Restore native Windows chrome"] C["global.css: Add appearance:none"] --> D["Fix button styling on Windows"] E["polish.rs: Shorten role prompt"] --> F["Simplify polish instructions"]File Walkthrough
lib.rs
Restore Windows native window chromeopenless-all/app/src-tauri/src/lib.rs
set_decorations(false)call to restore native Windows titlebar and controls
apply_windows_rounded_framefunction and its event handler toeliminate dead code and fix missing chrome
apply_micafor native backdrop effectglobal.css
Fix button native styling on Windowsopenless-all/app/src/styles/global.css
appearance: noneand-webkit-appearance: noneto the globalbutton reset
caused a circular border on Vocab items
polish.rs
Simplify polish system promptopenless-all/app/src-tauri/src/polish.rs
ROLE_BLOCKprompt string by removing redundant or overlydetailed instructions