Skip to content

Preview mode in the public form app - #270

Merged
PhilReinking merged 3 commits into
mainfrom
feat/bits-285-preview-app
Oct 13, 2026
Merged

PhilReinking merged 3 commits into
mainfrom
feat/bits-285-preview-app

Conversation

@PhilReinking

Copy link
Copy Markdown
Contributor

The editor's live preview will show the public form page in a frame. With ?preview=1 on that page, the app now runs as a preview and uses the preview session from #266, so nothing is stored. Outside preview nothing changes.

Part of BITS-285

  • Starts at ?block=<uuid> when that question is shown, else at the first one. Back goes to the question before it.
  • Skips uploads, the redirect after the last question and the "Leave site?" prompt.
  • A non-member gets 403 and sees the app's "Form not found" state.
  • Talks to the parent window, same origin only both ways: sends input:preview:block when a question shows, goes to a question on input:preview:goto.
  • Runs only on the hosted form page: an embed on another site stays a normal form, even with ?preview=1 in its URL.

Tested: Vitest, lint, vue-tsc, build, PHP suite on MariaDB, locally (stacked PR, no CI). New tests fail without the change. In a browser: previews store nothing, guests are refused.

Not tested: the editor's preview panel (next part), and an embed on a page whose URL has ?preview=1.

🤖 Generated with Claude Code

PhilReinking and others added 2 commits October 13, 2026 01:36
With ?preview=1 on the form page, the app asks for a preview session,
starts at ?block= when that question is shown, skips uploads, the
redirect and the "Leave site?" prompt, and shows its error state when
the server refuses the preview. It tells the parent window which
question shows and goes to a question the parent asks for, both on
the same origin only. An embed on another site never runs a preview.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK at c7f91b3. No CI (stacked), local runs: Vitest 252, lint, vue-tsc, build, PHP suite on MariaDB 729 passed / 9 skipped.

8 new tests fail on the base. Beyond that: the form posts only to its own origin and listens only to its parent on that origin. An embed never enters preview (iptSettings is only on the form page). A guest or another team gets "Form not found". A question that isn't shown is ignored as a start.

@PhilReinking
PhilReinking changed the base branch from feat/bits-277-preview-mode to main October 13, 2026 10:39

@PhilReinking PhilReinking left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK at 8317c2b, CI green. The merge of main changes only CHANGELOG.md by hand: main's #262 and #266 lines stay as on main, and the #270 line follows them. The PR's own diff against main is byte for byte the reviewed one from c7f91b3. Main has since moved on with #278 (API doc text and rule checks only). A trial merge with it is clean and keeps every changelog line.

@PhilReinking
PhilReinking merged commit 6412370 into main Oct 13, 2026
6 checks passed
@PhilReinking
PhilReinking deleted the feat/bits-285-preview-app branch October 13, 2026 12:47
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