Skip to content

fix(ui): keep the page elements editor context in sync with the pages list - #114

Merged
BatLeDev merged 1 commit into
masterfrom
fix-page-links-empty-list
Aug 19, 2026
Merged

fix(ui): keep the page elements editor context in sync with the pages list#114
BatLeDev merged 1 commit into
masterfrom
fix-page-links-empty-list

Conversation

@BatLeDev

Copy link
Copy Markdown
Member

The VJSF options of the page elements editor were built once on setup, so their context froze the pages list as it was at that moment. When the editor mounted before the parent's pages fetch resolved, the "Page" selector of every link stayed empty ("Aucune donnée disponible") and no link could target a page — navigation button and menu elements included.

  • vjsfOptions becomes a computed, so the context follows the pages prop instead of a setup-time snapshot
  • the @ts-ignore on messages becomes a typed cast, since the comment no longer applies from inside the getter

Why: on a page draft, configuring a link towards a page was failing at random — the editor mounting before GET /api/pages resolved was enough to lose the whole list for the rest of the session.

Heads-up:

  • the options object now changes identity on every recompute; useVjsf handles that (it compares options before rebuilding), but the page editor is sensitive to state-tree rebuilds — that is the part worth reviewing.
  • no automated test: the failure depends on a race between the component mounting and the fetch. Reproduced by delaying GET /api/pages by 6 s, and verified before/after — empty selector, then the full list and a link persisted with a PATCH 200.

… list

The vjsf options were built once on setup, so their context froze the pages
prop as it was at that moment. When the elements editor mounted before the
pages fetch of the parent resolved, the link configuration of every element
kept an empty pages list and no link could target a page.
@github-actions github-actions Bot added the fix label Aug 19, 2026
@BatLeDev
BatLeDev merged commit 4c46fae into master Aug 19, 2026
4 checks passed
@BatLeDev
BatLeDev deleted the fix-page-links-empty-list branch August 19, 2026 13:02
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