fix(ui): Windows 原生 chrome / 胶囊缩小 / 自定义下拉 (#417 #418)#419
Merged
Conversation
added 2 commits
May 12, 2026 13:34
- WindowChrome: 移除 Windows 端自定义标题栏和 resize handles, 交还 Tauri decorations:true 原生 Win11 标题栏,修复 X 按钮重叠 与圆角处的黑边/白线 - Capsule (#417): Windows pill 196×52→180×44,textWidth 104→88, 视觉密度与 macOS 对齐 - SelectLite (#418): 重写为受控下拉组件(portal popover, 键盘导航 Arrow/Enter/Esc, 视口翻转, a11y combobox/listbox),替换 11 处 native <select> 以避开 Win32 ComboBox 直角丑框 - SettingsModal: 删除"个性化"中重复的"界面语言"入口,功能保留在 "设置 → 语言"分区;5 个 locale 同步清理 modal.personalize.language - SwitchLite: 加 outline:none 解决 Windows 上点击后的黑色焦点框 - global.css: 移入 ol-select-pop 关键帧;不再用全局 outline:none, 以保留 _atoms.tsx Collapsible 的键盘 outline (pr-agent #407)
90b3505 bump 到 1.3.1-1 时漏改了 package-lock.json 的 root 与 nested version 字段(都还是 1.3.0),CI "Verify version sync across 5 files" 卡死所有平台,本 PR 的 build / check 步骤根本 没机会执行。 手动同步到 1.3.1-1,与 package.json / tauri.conf.json / Cargo.toml / Cargo.lock 对齐。本地复跑 CI 第一步的 node -p 校验 全部一致。
PR Reviewer Guide 🔍(Review updated until commit 6c7598a)Here are some key observations to aid the review process:
|
pr-agent #419 review 指出两个 button 都用 outline:none 关掉了浏览器默认 焦点 ring 却没替代——键盘 Tab 时用户看不到当前焦点在哪。和 _atoms.tsx Collapsible 的 pr-agent #407 是同一类问题。 修法:新增 .ol-focus-ring class,:focus-visible 时上 2px 半透明蓝 box-shadow(不是 outline,因为 inline style 的 outline:none 会盖掉 class 里的 outline,但盖不掉 box-shadow)。:focus-visible 只在键盘 focus 时生效,鼠标点击保持干净。
|
Persistent review updated to latest commit 8a6ac8b |
|
Persistent review updated to latest commit 70917cb |
pr-agent #419 第二轮 review 指出的两个 focus areas: 1. Keyboard scroll:长 dropdown 超过 280px 时 ArrowUp/Down 切换 highlight 不会把高亮项 scroll into view,键盘用户看不到当前选中。新增 useEffect 监听 highlight 改变,找到 data-option-index 对应 DOM 元素后 scrollIntoView({ block: 'nearest' }),已可见的项不会被强行滚动。 2. Viewport clipping:popover 用 trigger.left 作 anchor,没有横向边界 clamp。窗口右边的 select 弹出后可能溢出屏幕。positionPopover 改成测 真实 popover 宽度(首次开打用 trigger 宽度估),然后把 left clamp 到 [8, viewport - width - 8] 区间。 不动 keyboard 导航 / disabled 处理 / vertical flip 等已 verified 行为。
|
Persistent review updated to latest commit 6c7598a |
5 tasks
appergb
pushed a commit
that referenced
this pull request
May 12, 2026
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 让 原生标题栏接管。
6 tasks
appergb
pushed a commit
that referenced
this pull request
May 12, 2026
PR #422 合并后 bump。本版本相对 v1.3.1-3-beta 累积修复: - Windows 默认字号 'large'(fontScale.ts UA 检测) - Windows 原生标题栏底色刷成白色,与 sidebar 视觉统一(DWM CAPTION_COLOR) - 全平台玻璃统一:WindowChrome 撤销 PR #419 留下的"Windows 100% opaque + 无 backdropFilter"分支,两平台用同一半透明 background + blur saturate(190%), alpha 0.92 → 0.78 让玻璃感更明显但不过透 - Vocab 词条大圈再次根治:global.css button reset 补加 outline:none / min-width:0 / min-height:0 / box-sizing:border-box - polish ROLE_BLOCK 撤销 b2325a2 回滚,恢复 7e60bdb 8-条规则状态 - polish ROLE_BLOCK 「意图难判」规则改为强制结构化(用户拍板的新版)
H-Chris233
pushed a commit
to H-Chris233/openless
that referenced
this pull request
May 12, 2026
5 个用户反馈一次性收: 1. Windows 默认字号放大 fontScale.ts readFontScale() 检测 navigator UA 含 Windows 时新装默认 返回 'large'(1.1x zoom),已存 localStorage 偏好的用户不受影响。 2. Windows 顶栏白色,与左侧 sidebar 视觉统一 lib.rs 重新引入 apply_windows_caption_color,用 DWM API DwmSetWindowAttribute DWMWA_CAPTION_COLOR=35 (Win11 22H2+) 把原生标题栏底色刷成 0x00FFFFFF。 pre-22H2 Win 静默失败仅 warn。 3. 全平台玻璃效果统一 & 略浊 WindowChrome.tsx 撤销 PR Open-Less#419 留下的"Windows 100% opaque background + 去 backdropFilter"分支(那是 Win sidebar 完全无玻璃感的根因)。两个 平台改用同一份半透明 background(alpha 从 0.92 降到 0.78)+ blur var(--ol-glass-blur-strong) saturate(190%),让 sidebar 透过磨砂底板。 Windows 配合 apply_mica + tauri.conf transparent:true 透出 Mica。 4. Vocab 词条大圈再次尝试根治 global.css button reset 在 appearance:none 基础上再加 outline:none / min-width:0 / min-height:0 / box-sizing:border-box。Windows Chromium user-agent style 包含上述四项默认值,单一个 appearance:none 不够覆盖 全部。键盘焦点指示走 .ol-focus-ring + :focus-visible box-shadow, 不被 outline:0 影响。 5. polish.rs ROLE_BLOCK 撤回 b2325a2 回滚 用户确认 13:08 之前最近的 polish.rs commit(20756f7e,含 7e60bdb refine)表现正常。我之前 b2325a2 误以为 7e60bdb 是问题源把 ROLE_BLOCK 改回 v1.2.24-9-beta 状态,反而离用户认可的版本更远。改回 7e60bdb 8-条 ROLE_BLOCK 状态。
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
Summary
Windows 端 UI 一致性整理。三件事打包:
decorations:true原生 Win11 标题栏。修复用户反馈的 X 按钮重叠 + 圆角处黑边/白线(双层 chrome 之间露出的窗口背景)。macOS 路径零变化。SelectLite重写为完整受控组件——portal popover、键盘 Arrow/Enter/Esc/Tab 导航、视口边缘自动翻转、role="combobox"/role="listbox"a11y。替换全仓库 11 处 native<select>,彻底绕开 Win32 ComboBox 的直角丑框。outline:none解决 Windows 上开关黑框;保留_atoms.tsxCollapsible 的键盘 outline(pr-agent refactor(ui): Collapsible groups in Settings & Vocab #407)。Closes
Test plan
npx tsc --noEmit干净(CI 上 build 也应该绿)PR Type
Enhancement, Bug fix
Description
Replace native
<select>with portal-based customSelectLitedropdown for glass styling and keyboard a11yRemove Windows custom title bar and resize handles, restoring native Win11 decorations
Downsize Windows capsule pill to 180×44 for visual parity with macOS
Delete duplicate interface‑language picker from Personalize; keep in Language section only
Add
.ol-focus-ringclass for keyboard focus visibility across componentsDiagram Walkthrough
File Walkthrough
2 files
Remove Windows custom title bar and resize handlesReduce Windows pill to 180×44 for macOS parity7 files
Rewrite as controlled dropdown with portal popover and a11yAdd .ol-focus-ring and outline:noneSwap native for SelectLite (5 instances)Replace all native with SelectLiteReplace native target‑language with SelectLiteReplace native language with SelectLiteAdd ol-select-pop keyframe and .ol-focus-ring class1 files
Delete duplicate LanguagePicker from Personalize section5 files
Remove personalize.language keyRemove personalize.language keyRemove personalize.language keyRemove personalize.language keyRemove personalize.language key