Repository navigation
refactor(settings): merge font slots into three rows and trim filler hints - #169
Merged
Merged
Conversation
…hints The appearance page rendered six rows for three font slots, each carrying its own gray hint line — the same two sentences repeated three times. Content that was noise: - "12–20px, set independently; defaults: UI 14px, content 14px, code 12px, applies immediately" restated what the Select, the current value, the reset button and the preview row already show, and repeated the other slots' defaults under each slot's own row. - "applies on Enter" was simply wrong: a family commits on Enter, blur, ~600ms idle and unmount, so Enter is never required. Layout: - Merge each slot into one row (interface / content / code): family input and size Select side by side, one preview below. The old two previews per slot rendered the identical sample (same family + same size), so one of them was pure duplication. - Both controls keep their own anchor (ui.font_<slot> / ui.font_size_<slot>), so settings search still locates either one. - Left column drops from 50% to a fixed narrow column now that the label is two characters; the reclaimed space goes to the controls. - Height mismatch fixed at the source: the size Select no longer carries size="small", which made it shorter than the Input beside it. - One reset per row, at the far right, clearing both the family and the size of that slot. It submits once — the two commitFont* calls are chained but only the final state is persisted, avoiding two rounds through the serial queue. - Shared guidance (comma-separated families, empty = default) now says it once in the section header instead of per row. Dimensions live in SETTINGS_VISUAL so page CSS carries no literals.
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.
背景
外观页的字体分组把三个槽拆成六行,每行都挂一行灰字说明 —— 实际只有两句话,各重复三遍。
其中有一处不只是废话,而是错的:
字体提交有四条路径 —— 回车 / 失焦 / 停手约 600ms / 卸载。按不按回车都会存,这句会让用户以为必须敲回车。
另一条
12–20px,三组独立;默认界面 14px、内容 14px、代码 12px,改即生效则是纯重复:范围点开下拉自明、默认值当前选中值与还原按钮都在,还专门在「内容字号」下复述另外两槽的默认值。改动
去掉冗余说明
fontSizeHint,改写fontHint三槽合并成三行
ui.font_<slot>/ui.font_size_<slot>),设置搜索仍能分别定位三处布局问题
size="small",antd 给它更小的上下内边距,比同行 Input 矮一截、下边线对不齐尺寸统一收进
SETTINGS_VISUAL,页体 CSS 不留字面量。验证
pnpm prepr全部硬步骤通过(合并origin/main后重跑过一次):ui-test1905 用例全通过。改动只涉及前端,rust-*为回归确认。测试侧新增了一条「一次点击 = 一次落盘」的断言,以及两条反模式契约(Select 不得挂
size="small"、重置不得藏在 suffix 里),防止这两个问题在后续改动中被改回去。未在本 PR 内验收
界面改动按项目纪律不做 GUI 自动点验,以下需手动确认:三行结构与左侧标签垂直居中、三个控件等高、行末重置一次清两项、搜索跳转锚点、窄窗口堆叠、英文界面文案。另:本地仅覆盖 macOS,Windows 分支与 GUI 视觉仍以 CI / 人工验收为准。