Repository navigation
style: keep the native select popup readable and ring-free on Windows - #4
Merged
Merged
Conversation
Contributor
Author
|
说明:CI 里 macOS 的 修复已提在 #5,本地完整跑过 36 项 UI 用例(含失败的这 3 项)全绿。#5 合并后我会把本分支 rebase 到最新 main 再确认一次,届时本 PR 的 CI 应该转绿。 本 PR 只改 |
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.
现象
Windows 上「客户端」下拉框展开后是一块系统浅色面板,选项文字却是浅色(
--text),几乎读不清;同时点开下拉时下拉框会亮起 3px 珊瑚色聚焦描边。macOS 上弹层跟随窗口深色外观,看起来正常,所以只在 Windows 暴露。原因
<select>弹层使用系统浅色菜单面板,不跟随页面的color-scheme: dark,也不受nativeTheme.themeSource影响;macOS 的弹层跟随窗口外观,因此正常。option没有自己的颜色声明时,文字继承select的color: var(--text)(#eeeef1),于是浅底浅字。button/input/select/textarea:focus-visible统一加了outline: 3px solid var(--focus),点开下拉即触发,与 Raycast Dark 的克制风格不符。改动
src/styles.css,+14 / −2:给弹层补上深色表面与对比文字,并让字号跟控件一致:
把
select从全局聚焦环规则中移除,并显式关闭它的 outline;按钮与输入框的键盘聚焦环保持不变。.provider-switcher select的右侧内边距8px → 26px,选中「WorkBuddy 国际版」这类长名称时文字不再贴住下拉箭头。验证
Windows + Electron 44.9.3 实机(真实 preload / IPC,非浏览器 mock):
optionbackgroundrgba(0, 0, 0, 0)(透出浅色面板)rgb(31, 31, 35)selectoutlinergba(255, 140, 140, 0.65) solid 3pxnonenpm run build通过;npm test206 项,204 通过,0 失败,2 跳过(与改动前一致)。UI 测试里的selectOption(...)仍走原生 select,无需改动。select,桌面工作台与菜单栏面板里的其它下拉(设置、API、用量、旅行地点等)同步受益;没有改动任何 DOM 结构或交互行为。取舍说明
按要求移除了
select的聚焦环。按钮与输入框的键盘聚焦提示保持不变;如果希望select在键盘 Tab 时仍有提示,可以改成只换边框色(border-color: var(--line-strong))而不画外圈,需要的话我调整。