Skip to content

fix(renderer): a skipped page's answers stop driving conditions; languages 3.7.0 - #508

Merged
kevinchappell merged 5 commits into
mainfrom
fix/122-followups
Sep 28, 2026
Merged

kevinchappell merged 5 commits into
mainfrom
fix/122-followups

Conversation

@kevinchappell

Copy link
Copy Markdown
Collaborator

What

Two #122 follow-ups.

Translated pages.page. Bumps @draggable/formeo-languages to ^3.7.0, which translates pages.page. The locale test checks every pages.* key again, and the docs no longer say it shows in English.

A skipped page's answers no longer drive other conditions.

  • While a page is skipped, conditions read its fields as unanswered: an empty value, unchecked and not visible.
  • When a page is skipped or comes back, the renderer re-runs only the conditions that watch something on that page.
  • Example: if "Account type" skips the Company page, a VAT page shown only when "VAT registered?" (on Company) is "yes" now drops out along with Company, and returns with it.
  • A condition that skips or brings back a page still reads that page's own fields as they are, so a page can still skip itself. This is decided per action: an action that targets another page doesn't get the exemption.
  • destroy() now also releases the renderer's condition runners.

Behaviour change. Forms that relied on a skipped page's answers still driving other pages will see those pages drop out while it's skipped. Its answers stay on the page and count again when it comes back. A value action whose source is on a skippable page can now fire when that page is skipped or comes back. The skipped-pages section of docs/renderer/renderer.md covers both.

Refs #122

Testing

  • npm test: 584 pass
  • npm run lint: clean
  • Playwright: 150 passed, 3 skipped, including a new wizard test for the VAT example

3.7.0 translates pages.page, so the locale test checks every pages.*
key again and the docs no longer say it shows in English.

Refs #122
A skipped page's fields kept driving other conditions, so a page shown
by an answer on a skipped page stayed in play. While a page is skipped
its fields now read as empty, unchecked and not visible, and the
conditions watching that page re-run whenever it is skipped or back.

A condition that skips or brings back a page still reads that page's
own fields as they are, so a page can skip itself by its own answer
without its bring-back condition undoing the skip at once.

Refs #122
The own-page exemption applied to the whole condition, so a condition
showing its own page and another one read its own page's answers as
they are for both, and wasn't re-run when its page was skipped. Now
only an action that skips or brings back a page reads that page as it
is; every other action reads a skipped page as unanswered. A page's
skip re-runs the conditions watching it that act on any other target,
leaving that page's own actions alone. destroy() drops the runners.

The re-run test now uses a value action whose source still matches
when the page comes back, so it fails if every condition re-runs.
Docs note that value actions reading a page can fire as it's skipped.

Refs #122
Copilot AI lite review requested due to automatic review settings September 28, 2026 10:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Address the self-skip condition rerun and stale listener teardown issues in src/lib/js/renderer/index.js.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Fixes skipped-page condition handling and updates page-label translations to @draggable/formeo-languages 3.7.0.

Changes:

  • Treats skipped-page answers as unanswered for dependent conditions.
  • Adds regression tests and documentation.
  • Updates localization dependencies and validation.
File Summary
tests/​renderer-pagination.spec.js Adds VAT wizard integration coverage.
src/​lib/​js/​renderer/​renderer.test.js Tests condition-runner cleanup.
src/​lib/​js/​renderer/​pagination.test.js Adds skipped-page condition coverage.
src/​lib/​js/​renderer/​index.js Implements skipped-page handling; requires fixes for self-skip reruns and listener teardown.
src/​lib/​js/​components/​stages/​stages-pages.test.js Validates translated page keys.
src/​lib/​js/​components/​stages/​page-text.mjs Updates translation fallback documentation.
package.json Bumps the languages dependency.
package-lock.json Locks languages package 3.7.0.
docs/​renderer/​renderer.md Documents skipped-page behavior.
docs/​editor/​pages.md Updates page and localization documentation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/lib/js/renderer/index.js Outdated
*/
rerunConditionsReading = stage => {
for (const { watched, pages, run } of this.conditionRunners) {
if (pages.some(page => page !== stage) && watched.some(component => stage.contains(component))) {
@kevinchappell

Copy link
Copy Markdown
Collaborator Author

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested change, apply the suggestion exactly.

Do not make changes beyond what is described in the linked review thread.

Co-authored-by: kevinchappell <1457540+kevinchappell@users.noreply.github.com>

Copilot AI commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

@copilot Fix the code for all comments in this review thread.

When a review comment includes a suggested change, apply the...

Implemented the review-thread fix in commit 5b5dd37.

I updated the renderer rerun logic so unskip transitions re-run self-skip conditions, while skip transitions suppress only same-stage actions that would immediately unskip the newly skipped page. I also added a focused pagination regression test for this exact case.

@kevinchappell
kevinchappell merged commit ac07857 into main Sep 28, 2026
@kevinchappell
kevinchappell deleted the fix/122-followups branch September 28, 2026 11:52
@kevinchappell

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 5.9.3 🎉

The release is available on:

Your semantic-release 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.

3 participants