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 <noreply@anthropic.com>
This commit is contained in:
@@ -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"));
|
||||
|
||||
@@ -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": "平移",
|
||||
|
||||
Reference in New Issue
Block a user