Skip to content

Refuse or carry the edits a re-read would undo - #20

Merged
ww-mw merged 2 commits into
mainfrom
catalog-follows-a-rename
Sep 9, 2026
Merged

Refuse or carry the edits a re-read would undo#20
ww-mw merged 2 commits into
mainfrom
catalog-follows-a-rename

Conversation

@ww-mw

@ww-mw ww-mw commented Sep 9, 2026

Copy link
Copy Markdown
Member

Four findings from a test sweep of the unified table-edit path, all one shape: the
table accepted an edit, showed it, and the next read of the file spelled something
else.

  • A rename of a catalogued Architectural Data entry demoted it. System Composer
    keeps its type catalog in a separate part of the dictionary that references entries
    by name (a JSON object in a textual .sldd, a zipped MF0 XML member in a
    compressed-binary one), so a rename left the catalog defining a name nothing carries
    and a struct type re-read as a plain data interface — in the file, on both formats.
    New parser/ScCatalog.ts holds that vocabulary; SectionNode._entryRenamed moves the
    key in memory (load-bearing for a narrow repaint, which rebuilds an entry from a
    record and classifies it through the catalog), and the scan/rename/apply helpers are
    exported so the host can patch the file — it owns the document text and the zip
    members; this package can splice neither.
  • A rename of a struct/object/.mat struct array left its elements labelled after the
    old name.
    The label was baked at parse time; it is now derived from an
    ElementSubscript plus the parent's current displayed name.
  • A Simulink.Parameter's Value row offered a rename serialize discarded — the
    property is written under the key Value whatever the node is called. The row is a
    class property bag, so it says so, and setProperty asks nameEditable first.
  • A Description typed onto a plain variable or a struct went nowhere — those
    serialize as {name, metadata, value}. descriptionEditable joins the
    nameEditable/valueEditable family and reaches the row, the property inspector and
    setProperty.

Tests: test/scCatalog.test.ts (both storage forms, the rename sites, and the sites a
rename must NOT touch), test/editsTheFormatCannotKeep.test.ts,
test/elementLabelFollowsName.test.ts, plus new fixtures arch_binary.sldd /
arch_binary_as_text.sldd generated by make-fixtures.mjs. Full suite: 4134 passing.

Four findings from a test sweep of the unified table-edit path, all one
shape: the table accepted an edit, showed it, and the next read of the
file spelled something else.

Renaming a catalogued Architectural Data entry demoted it. System
Composer keeps its type catalog in a SEPARATE part of the dictionary
that references entries BY NAME — a JSON object in a textual .sldd, a
zipped MF0 XML member in a compressed-binary one — so a rename left the
catalog defining a name nothing carries: a struct type re-read as a
plain data interface, on both formats, in the file. ScCatalog.ts now
holds that vocabulary in one place; a section moves the key when one of
its entries is renamed (_entryRenamed), which is what keeps a narrow
repaint honest, since rebuilding an entry from a record classifies it
through the catalog. The scan/rename/apply helpers are exported because
patching the FILE belongs to the host: it owns the open document's text
and the zip members, and this package can splice neither for it.

Renaming a struct, object or .mat struct array left its elements
labelled after the old name. The label was baked at parse time; it is
now derived from an ElementSubscript and the parent's CURRENT displayed
name, so an element row follows the row above it at any depth.

A Simulink.Parameter's Value row offered a rename that serialize
discarded in silence: the property is written under the key `Value`
whatever the node is called. That row is a class property bag exactly as
an object's children are, so it says so, and setProperty asks
nameEditable before renaming anything — the model no longer accepts a
rename the table already declined to offer.

A Description typed onto a plain variable or a struct went nowhere:
those serialize as {name, metadata, value}, with no property bag to hold
one. `descriptionEditable` joins the nameEditable/valueEditable family —
declared true, false in the two classes that cannot keep one — and is
consulted by the row, by the property inspector, and by setProperty.

Refusing an edit and carrying it are the same rule from two sides: what
the cell shows is what the file will say.
@ww-mw
ww-mw merged commit 8c0dbb3 into main Sep 9, 2026
1 check passed
@ww-mw
ww-mw deleted the catalog-follows-a-rename branch September 9, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant