docs(ui): state the inlineForm validate contract the code implements - #324
Merged
Merged
Conversation
ui/README.md:90 (the inline-components section) said an inlineForm `opts.validate` error is surfaced as "toast + 重新聚焦". That was true at birth (990cd5a, #41) but 2d492ee (#47) changed the code to `setFieldError(input, err)` and added the `## 一致性约定` section, which states at line 133 that inline-edit validation goes through `setFieldError` and explicitly does not use a toast. Only line 90 was left behind, so the same file contradicted itself and the code. Fix the wording to match line 133 and the implementation; no behaviour change, no new i18n keys.
Owner
Author
|
Self-review (Committer, |
This was referenced Sep 29, 2026
Merged
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.
Summary
ui/README.md:90(the## 行内组件约定section, "禁用原生弹窗" bullet) said aninlineFormopts.validateerror is surfaced as "toast + 重新聚焦". The code has not done that since2d492ee(#47):ui/js/app.js'sfinish()callssetFieldError(input, err)— no toast, no explicit refocus.The same file already states the correct behaviour, at line 133 (
## 一致性约定, "行内编辑校验"): "inlineForm的opts.validate失败走setFieldError(红边框+行内文案)… 不使用 toast 承载错误". So the document contradicted itself, and only line 90 was wrong.Provenance is drift, not a trade-off:
990cd5a(feat(ui): replace native confirm/prompt dialogs with inline components (v1.17 A) #41, v1.17 A) —inlineFormwas born withif (err) { toast(err, "error"); input.focus(); return; }, so line 90 was true when written.2d492ee(feat(ui): detail consistency — inline errors in editors, unified phrasing (v1.17 G) #47, v1.17 G) — the same commit changed that line tosetFieldError(input, err)and added the## 一致性约定section (line 133) stating the new rule, but did not update line 90.grep -rn "重新聚焦"over the repository matched this one line only, and no gate insrc/quotes it — it is prose nothing pins, which is exactly how it survived.Related Issue
None. Found during reconnaissance; no issue was opened for it.
Changes
ui/README.md— line 90's parenthetical now reads`opts.validate` 失败走 `setFieldError`(红边框+行内文案),不使用 toast, matching line 133 andui/js/app.js. One line; docs only. No cache-bust token:ui/README.mdis not a served asset.功能/修复说明 (prose only: one stale contract corrected to the implemented behaviour)
涉及配置/数据结构的改动已同步示例文件 (not applicable — no config/data change)
Tests
cargo test全部通过 — 426 passed; 0 failedcargo fmt --check通过doc-comment-claimsaxis, precedents docs(perf_gate): drop the stale file count from the gate header #309/docs(ui): stop restating the i18n counters and correct two stale gate claims #310/fix(admin): state the refusal a deleted model now meets, not the old zero bill #312–fix(i18n): drop the retired "shown once" claim from the generate-key toast #320) is to correct the data rather than gate it; the phrase is not an invariant a lexical gate can hold without an exemption list.Checklist
docs/)docs(ui): ...)