mirror of
https://github.com/rememberber/MooTool.git
synced 2026-12-01 03:18:19 +08:00
Align JSON inspector formatOptions.spaces with Electron’s 2/4-only indent select when reloading tool sessions. Co-authored-by: Cursor <cursoragent@cursor.com>
655 B
655 B
DIFF-483:JSON 检查器缩进选项规范化(对齐 Electron JsonInspector)
背景
Electron 检查器缩进仅为 <select> 的 2 或 4(JsonInspector.tsx)。Compose 侧栏为 MooSegmented 同样只提供 2/4,但会话快照/迁入若带上 spaces: 0(例如误用 MCP 紧凑语义)或其它非法值,分段控件与 formatAdvanced 行为会与 Electron 不一致。
行为
JsonFormatOptions.normalizeInspectorIndent():仅保留4,其余一律2。JsonSession.restore写回formatOptions前规范化缩进。
验证
JsonFormatOptionsTest./gradlew :composeApp:desktopTest --offline