Skip to content

fix: keep an edition's own values in every row of a shared section - #173

Merged
lero62 merged 1 commit into
mainfrom
fix/shared-section-row-values
Oct 7, 2026
Merged

lero62 merged 1 commit into
mainfrom
fix/shared-section-row-values

Conversation

@lero62

@lero62 lero62 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

A section an edition follows from the library lost content on every read, so an edit made in the
admin came back as the library's own value the moment the document was saved and re-read. The value
written to the database was right; the read put the library's back over it, and the next save made
that permanent.

Two losses, both the same confusion between a template and a row of data:

  • The first row of every list, at any depth. shapeOf reads an array's shape off its first row,
    and withShape hands that row back as the shape — correct in the builder, where row one is the
    edit the shape came from. reconcile reused it to fit the library's shape over an edition's
    values, and there row one is an ordinary row: it was replaced by the template wholesale, together
    with everything nested under it.
  • Hidden rows. A hidden row carries a hidden field the shape does not have. dressed walked
    the shape, so the marker was dropped and the row came back visible.

withShape keeps its meaning and its caller, the builder's edit path. The fitting half is now
valued + a dressed that treats every row alike: the shape decides which fields exist and how
they are drawn, the value decides what they hold, and the hidden marker is read off the row being
dressed rather than off the one the shape came from. reconcile goes through it, which is also why
reshape is three lines instead of twenty-five.

Two things come along with it: a container swapped for another container in the library
(group ↔ collapsible) no longer empties the editions, since the two hold the same thing; and in
the builder a shape edit now reaches the sibling rows' own settings, which return had used to keep
stale.

Covered by hand against the shape that found this — a collapsible holding an array, and an array
nested inside a row of another array:

  • the first row survives a save, at the top level and nested;
  • a hidden row stays hidden;
  • a field added to the library arrives without touching what is filled in;
  • an edition's hidden on the section itself is kept;
  • the builder's addAt / editAt still propagate a shape edit to rows two and up, values intact.

check-types is clean and the package is two lint warnings below main.

Editions already overwritten do not come back — the edits were erased by the saves that followed,
and have to be entered again.

@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
ideal-cms Ready Ready Preview Oct 7, 2026 7:51am UTC

Request Review

@lero62
lero62 merged commit 08e4ca9 into main Oct 7, 2026
2 checks passed
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.3.2 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

This branch was successfully deployed

1 active deployment
Preview — 8a3ad0ac Deployed Oct 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant