Repository navigation
fix(ui): make states and warnings readable, add rule actions - #68
Open
harryisfish wants to merge 2 commits into
Open
harryisfish wants to merge 2 commits into
harryisfish wants to merge 2 commits into
Conversation
## Summary - Add `theme_ext` color roles (`warning_text`, `chip_bg`/`chip_fg`, `selection_border`, `row_hover`) with contrast tests against the shipped Light/Dark palettes. Warning text was the amber fill color (1.8:1 on the light card surface), badges used `accent` as a foreground (about 1.0:1 in Light, 1.3:1 in Dark), and card hover used a fill equal to the card surface, so hover, selection and warning copy were invisible or unreadable. - Badges are neutral now (text carries the state); a card being edited is shown by a `primary` selection border, which matches the documented "border only means editing" behaviour. - Every rule card carries inline 编辑 / 上移 / 下移 buttons next to 删除, so editing and reordering no longer depend on a right-click context menu and are reachable by keyboard. - Consistency: drop the duplicate `open-login-items` button and id, drop the overview status metric that repeated the hero, translate `kept`, stop styling the reversible 断开 action as danger, name the tray item 应用. - AGENTS.md records the rule-card buttons and the `theme_ext` color-role rule. ## Test plan - [x] `cargo test --lib theme_ext` (5 tests: warning text reaches 4.5:1 in both appearances, badge text and selection border reach their ratios, hover separates from the card surface, and the WCAG math is checked against the known 4.74:1 pair) - [x] `cargo test` (76 passed) - [x] `cargo check --bins` - [x] `grep`: no `theme.accent` left in `src/ui.rs`; no raw warning text color; one `open-login-items`; no `kept` - [ ] Rendered check in Light and Dark (blocked: the release app is running and its window reports off-screen, so screenshots are unavailable)
🤖 LeoCode Review⏳ 等待审查... 最后更新: 2026-09-11 13:32 · 087a307 |
- List the AGENTS.md contract edits in the task plan's change paths. - Record preflight Phase 1/1.5/2 results and the main-agent review findings (0 critical/high) in progress.md.
harryisfish
added a commit
that referenced
this pull request
Sep 15, 2026
releaseIfSystemDNSIsClear already withholds a bare swallow. The probe comment on that function keeps the polarity. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
背景
对界面做了一次 better-interface full 评审(只读),确认 3 项 HIGH:告警文字与选中态在浅色/深色外观下不可读;规则卡的编辑与排序只有右键菜单通路,键盘/读屏不可达;另有一批一致性缺陷。本 PR 只修 HIGH 与不改变行为契约的一致性缺陷。设置页信息架构、12px 长文案、选择器搜索、状态分级类型化留后续任务(见
.planning/ui-ux-review-fixes-2026-09-11_19-07-30/task_plan.md非目标)。改动
src/theme_ext.rs:按角色取色(warning_text/chip_bg/chip_fg/selection_border/row_hover)+ WCAGluminance/contrast_ratio,并对内置 Light/Dark 取值写 5 个对比度单测。warning_text。原实现直接用theme.warning(填充色):浅色下yellow-500落在卡片底#f5f5f5上约 1.8:1。pill去掉颜色参数)。原实现以theme.accent(悬停背景 token)同时当底色与文字色:浅色约 1.0:1、深色约 1.3:1,规则卡的via徽章因此读不出。primary描边,与文案「卡片边框仅表示编辑中」一致;悬停底色改用与卡片底不同的取值(浅色下muted与group_box同值,原本没有悬停反馈)。open-login-items按钮与重复 id;总览删掉与 hero 重复的「状态」指标;kept→保留;断开不再用 danger;托盘「更新配置」→「应用」。AGENTS.md补两句契约:规则卡行内按钮、UI 文字色走theme_ext角色。验证
cargo test --lib theme_ext(5 passed,含用已知 4.74:1 对照校验 WCAG 计算)cargo test(76 passed)cargo check --binssrc/ui.rs无theme.accent、无原始 warning 文字色;open-login-items1 处;kept0 处;规则卡edit-rule-/up-rule-/down-rule-各 1 处需要确认
徽章从彩色底改成中性底(状态语义由文字承载)是本次的设计取舍;若希望保留彩色徽章,需要另选满足对比度的文字色。