Repository navigation
fix(cms): expand recursive schema types when their nested items are opened - #7903
Merged
Merged
Conversation
…pened #7899 stopped resolveSchema from re-expanding a `$ref` already on the path, which fixed the hang on recursive commerce types but left the cut node without `properties`/`items`. A recursive menu type (`Item.children: Item[]`) therefore listed its child items but opened each one as an empty form. Mark the cut node with `recursiveRef` and expand it one level on demand (`resolveSchemaRef` + cached `expandRecursiveSchema`) when renderField or ArrayField reaches it, so the hang guard stays while nested levels remain editable. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
decocms Bot
pushed a commit
that referenced
this pull request
Oct 14, 2026
PR: #7903 fix(cms): expand recursive schema types when their nested items are opened Bump type: patch - decocms (apps/api/package.json): 4.478.0 -> 4.478.1 - @decocms/native (apps/native/package.json): 4.478.0 -> 4.478.1 Deploy-Scope: web
tlgimenes
added a commit
that referenced
this pull request
Oct 15, 2026
… (A9) The PO asked for main's recursive-schema behaviour, for v7 and v8 sites alike. Remove MAX_RECURSIVE_REF_REPEATS, the per-path repeat count and the array-items `$ref` pass-through that came with it, and the tests that pinned three levels. The following cherry-picks bring main's own fix (#7899, #7903): a re-entered `$ref` is cut and expanded on demand. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
tlgimenes
pushed a commit
that referenced
this pull request
Oct 15, 2026
…pened (#7903) #7899 stopped resolveSchema from re-expanding a `$ref` already on the path, which fixed the hang on recursive commerce types but left the cut node without `properties`/`items`. A recursive menu type (`Item.children: Item[]`) therefore listed its child items but opened each one as an empty form. Mark the cut node with `recursiveRef` and expand it one level on demand (`resolveSchemaRef` + cached `expandRecursiveSchema`) when renderField or ArrayField reaches it, so the hang guard stays while nested levels remain editable. Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]> (cherry picked from commit 6d8748d) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
tlgimenes
added a commit
that referenced
this pull request
Oct 15, 2026
Brings in 114 commits from main, including #7909 (PATCH decofile `expect` fingerprints, 409 block-conflict, value-by-value block merge on sync) and guitavano's #7899/#7903. One conflict, in apps/api/src/decofile/commit-coalescer.ts: this branch moved the gen-artifact regeneration and the commit message into gen-artifact.ts (shared with hosted publish), while #7909 changed the message to name only the accepted patches. The resolution keeps the shared helpers and passes them #7909's accepted `set`/`del`, so the legacy and Fast Preview write path behaves exactly as on main. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WNwbSEePYNcY5YCgqZURig
tlgimenes
added a commit
that referenced
this pull request
Oct 15, 2026
…ection Brings in fold/v8-api, which now carries origin/main (114 commits), including #7909 and #7918 (section forms start from a known version, saves send `expect`, a stale save is refused with 409 and replayed or reloaded). Conflicts resolved: - use-save-block.ts: main's Fast Preview save (`base` -> `expect`, rebase on 409, BlockConflictError, no rollback on a conflict, `written`) moves into this branch's `writeLegacy`; the content-protocol path and SaveGuard stay as they were. `mutate`/`mutateAsync` keep main's `withBase` default and the hook keeps `reportError`. - sections-editor.tsx: both form reloads stay (the content-epoch reload for discards/publishes and #7909's `reloadStaleForm`); main's form-base tracking, three-way merge, section following and retry-once are kept; failed saves use this branch's `reportError`. - serve-save-error.ts: a BlockConflictError's own message (#7909's copy) is the toast headline on every backend, with no Details line. - resolve-schema.ts and its cache test: #7899/#7903 were already cherry-picked here; this branch's lazy-block handling and A9 test stay. - cms-header-actions.tsx / cms-panel-state.ts: main dropped cmsHeaderButtonLabels; the hosted header helpers stay. - playwright.config.ts: both env additions (hosted env, GraphQL stub URL, BOARD_TRANSITION_SETTLE_SECONDS). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016ZsmzpZ2zahRBoATBb2tBu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is this contribution about?
#7899 stopped
resolveSchemafrom re-expanding a$refthat is already on the current path. That fixed the hang on recursive commerce types (Product → hasVariant: Product[]), but the cut node lost itsproperties/items. Recursive data types broke as a result. A site's menuItemhaschildren?: Item[], so the child items appear in the list, but each child opens as an empty form: only the multivariate variant/rule chrome shows and there are no fields to edit.This change keeps the cut and makes it lazy:
resolve-schema.ts: the cut node now carriesrecursiveRef(the re-entered$ref), and the newresolveSchemaRef(ref, meta)builds that definition on its own.fields/resolved-schema-cache.ts:expandRecursiveSchemafills in the skipped level (properties/required/items) and keeps the field's own title and description. It caches the result per node, so re-renders get the same object back.renderFieldexpands cut array and object fields.ArrayFieldexpands a cut item schema (e.g.Product[]items). Each drill expands one level, and the next re-entry is cut again, so the hang guard still holds.How did you verify your code works?
resolveSchemaagainst the real/live/_metaof an affected site. Before the fix,navItems → desktop[] → childrenresolved to{ type: "array" }with noitems. After it,expandRecursiveSchemagives the child item and the grandchild item all their fields (label,flagNew,banner,countBadge,children,url,display). The whole header section still resolves in about 10ms.resolve-schema.test.ts: the cut node carriesrecursiveRefforProduct;resolveSchemaRefbuilds the skipped level and cuts the next re-entry again; a recursive array def (Item.children: Item[]) is marked and expands withtitleBy.fields/resolved-schema-cache.test.ts: the expansion keeps the field title, returns the same object on every call, and is a no-op withoutrecursiveReformeta.bun run verifypasses: 10865 tests, 0 failures.Screenshots/Demonstration
No screenshots: I didn't run the Site Editor against an affected site.
How to Test
Itemhaschildren?: Item[].Review Checklist
🤖 Generated with Claude Code
Summary by cubic
Fixes recursive data-type forms that opened empty after #7899's recursion guard. When a recursive type re-entered itself (
Product → hasVariant: Product[], menuItemwithchildren?: Item[]), the cut node kept its type but lost itsproperties/items, so child items appeared in the list but each one rendered no fields.The cut node now carries a
recursiveRef, and the form fills in that skipped level on demand via the cachedexpandRecursiveSchemahelper whenrenderFieldorArrayFieldreaches it—restoring editable fields while keeping the recursion guard intact, one level at a time.Bug Fixes
Written for commit 128884d. Summary will update on new commits.