From f016a14984b3bc4253b7fdebcf85a52a3f36bb46 Mon Sep 17 00:00:00 2001 From: Ni Jingzhe <1448976235@qq.com> Date: Tue, 10 Nov 2026 04:04:14 +0800 Subject: [PATCH] editor-web: the "model shown" log says what the header says (open solids are not parts) DECISION: the log line written when a preview arrives reuses previewSummary(), so it counts parts and open solids the same way as the header. WHY: found by driving the real editor in a browser (ego-browser) after the editor commit of this series. A part notebook with two open solids (a body and a tool, no Part yet) showed "2 open solids" in the header but "model shown: 2 parts" in the log: the log still counted every node as a part, which was true while a Part could hold several bodies and is false now that a Part holds exactly one solid (see design-docs/part-holds-one-solid.md; the owner's point was that the editor's side-by-side solids are notebook values, not parts, so the editor must not call them parts). - App.tsx: log.push("ok", ...) uses t("model shown: {{summary}}", { summary: previewSummary(nodes) }). - zh-CN.json: the two plural strings it replaces are one string with the summary. Checked in the browser: a part notebook with two open solids -> header "2 open solids", log "model shown: 2 open solids"; the same notebook with a make_part_rpart cell -> header "1 part". editor-web vitest (331) and tsc --noEmit pass. Co-Authored-By: Claude Sonnet 5.5 --- editor-web/src/App.tsx | 4 +--- editor-web/src/i18n/locales/zh-CN.json | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/editor-web/src/App.tsx b/editor-web/src/App.tsx index 9360f592..0b10ca16 100644 --- a/editor-web/src/App.tsx +++ b/editor-web/src/App.tsx @@ -294,9 +294,7 @@ export function App() { "ok", solids === 0 ? surfaceNodes.length ? t("{{count}} surfaces shown, no solid yet", { count: surfaceNodes.length }) : t("no solid yet") - : solids === 1 - ? t("model shown: 1 part") - : t("model shown: {{count}} parts", { count: solids }), + : t("model shown: {{summary}}", { summary: previewSummary(preview.nodes) }), ); } catch (error) { log.push("error", error instanceof Error ? error.message : t("unable to open the preview")); diff --git a/editor-web/src/i18n/locales/zh-CN.json b/editor-web/src/i18n/locales/zh-CN.json index d1b1b565..7cf741b5 100644 --- a/editor-web/src/i18n/locales/zh-CN.json +++ b/editor-web/src/i18n/locales/zh-CN.json @@ -1044,8 +1044,7 @@ "loop": "环", "lowercase letters, digits and underscores, starting with a letter": "只能用小写字母、数字和下划线,并以字母开头", "mid": "中点", - "model shown: 1 part": "已显示模型:1 个零件", - "model shown: {{count}} parts": "已显示模型:{{count}} 个零件", + "model shown: {{summary}}": "已显示模型:{{summary}}", "modeled": "建模", "modifier": "修改", "move": "平移",