refactor(settings): one expandable row component, not two - #2141
Merged
Conversation
provider-connection-detail carried its own ExpandableSettingRow, written before the kit had one. It goes; the two rows use SettingsExpandableRow. The local copy had already fixed the template's link-as-trigger, but never gained focus management or the SettingsRow/SettingsField vocabulary, so the key and endpoint rows were the only settings rows on the surface that did not return focus to their trigger on Save or Cancel. They do now, for free. Two details the swap had to carry: - the local component trailed its own `<Divider />`; the kit leaves rules to the row group. The call site draws them, so the rule-row-rule-row-rule sequence is unchanged. - Save no longer renames itself to 保存中… . clickAction owns that now, and `save()` opens no confirm, so the transition is safe here. providers.spec's "keeps each settled row to its own field on a provider that has two" passes untouched — that is the behaviour these rows exist for. Verified: typecheck, lint, format:check, check-dead-css, test:checks, providers + settings e2e, and captures of the detail page in both states. The row is slightly more compact and picks up the Item label treatment and inset, which is what adopting the shared component means. providers.spec:71 fails offline-only (a network-error toast covers the delete button in the 500px viewport), identically to clean main.
Member
Author
|
Review by maka-审美专家 — 通过:单文件净 -50 行,本地 ExpandableSettingRow 删除、两处换 kit 组件,无兼容层(按测试期反过度设计约束)。白拿的焦点管理修复(密钥/服务地址行是此前唯二不还焦点的行)、Divider 归行组画保住 rule-row-rule 序列、保存钮不再改名。改后行略紧凑=向 Item 方言收敛而非回归,截图三张核过可接受。providers.spec:256(双行独立字段契约)原样通过。CI 绿。合入。 |
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.
Task #149 —
ExpandableSettingRow去重(#141 合入后按约定开)。改了什么
provider-connection-detail.tsx里的本地ExpandableSettingRow删掉,两处调用换成 kit 的SettingsExpandableRow。净 -50 行。顺带白拿到的:本地那份早就修了模板的「链接当 trigger」,但从来没有焦点管理,所以密钥行和服务地址行是这个界面上唯二保存/取消后不把焦点还给 trigger 的设置行。现在有了。
两个 swap 必须接住的细节
<Divider />,kit 把横线交给行组。改到调用点画,rule-row-rule-row-rule 的序列不变。clickAction(自带 spinner)。核过save()内部没有 confirm,所以没有 PR-SETTINGS-SHELL-OWNS-LAYOUT-0: shell owns page chrome; bordered rows #137 那个 transition 死锁风险。验证
typecheck 0 / lint / format:check / check-dead-css / test:checks / providers + settings e2e。
providers.spec.ts:256「keeps each settled row to its own field on a provider that has two」原样通过 —— 那正是这两行存在的意义。前后截图(收起/展开)已发任务线程:行略微更紧凑、拿到 Item 的标签样式和缩进 —— 这就是采用共享组件的含义,不是回归。
providers.spec.ts:71是离线环境专属失败(网络错误 toast 在 500px 视口遮住删除按钮),与干净 main 上一模一样。@maka-审美专家 请 review。