fix(console): 设置/关于本机不再随 3s 轮询重建(修复下拉弹回、配置改不动) - #79
Open
Windsander wants to merge 1 commit into
Open
Windsander wants to merge 1 commit into
Windsander wants to merge 1 commit into
Conversation
问题:设置弹窗打开时 render() 每 3s 全量重建 #settings-body DOM,原生 <select> 弹层被销毁 → 下拉一两秒就弹回、选择丢失(像是配置无法生效); 「关于本机」同样每次重建会冲掉滚动位置与文本选择。 修复: - renderSettings / renderAbout 增加内容签名跳过(activeTab + settings + rawConfig + writes + healthz + deviceId);签名未变且容器已有内容时不重建 - 撤销/保存后显式失效签名(lastSettingsSignature=null),确保强制刷新到最新值 - 保留既有 cfgDraft 草稿与焦点/光标恢复逻辑 回归(packages/console/scripts/verify-console-ui.mjs): - 跨 3s 轮询设置容器与 auth 下拉节点引用不变(DOM 未重建) - 修改 mcp.http.auth 后跨轮询保持;撤销复位;全程不保存 验证:npm test 845/845、npm run lint、npm run check:cleanliness 0-0、 UI 冒烟 19/19(修复前该回归 2 项失败)。
This branch has not been deployed
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.
问题
packages/console/console.js的render()每 3s 轮询一次;设置弹窗打开时调用renderSettings()、关于本机打开时调用renderAbout(),每次都整体重建#settings-body/#about-body的 DOM(innerHTML)。后果:
<select>(mcp.http.auth鉴权模式)展开后一两秒被销毁弹回,选择丢失,用户感觉“配置无法生效”。修复点
renderSettings/renderAbout增加内容签名跳过:签名覆盖各自渲染依赖(activeTab/settingsTab、state.settings、state.rawConfig、state.features.writes、state.healthz、本机deviceId);签名未变且容器已有内容时不重建 DOM。lastSettingsSignature = null)再renderSettings(),避免签名未变被跳过导致“撤销无效”。state.cfgDraft草稿与焦点/光标恢复行为不变。验证证据
npm test:119 suites / 845 tests 全通过。npm run lint:0 错误。npm run check:cleanliness:0 错误 / 0 警告(孤儿 0)。node packages/console/scripts/verify-console-ui.mjs:19/19 通过(新增 6 项回归)。mcp.http.auth下拉后跨轮询值保持;点「撤销」后回到原值;全程不保存。console.js修复后,上述 DOM 引用断言 2 项失败,确认回归可捕获该缺陷。影响面
packages/fleet、CI workflow、根package.json,无新增脚本/依赖。~/.mebular节点配置未触碰,全部验证使用临时MEBULAR_HOME。