Repository navigation
fix: show the end screen in the editor's preview - #280
PhilReinking wants to merge 11 commits into
Conversation
The preview went only to questions. Now the open end block sends the preview to the end screen (nothing is sent), a save shows the new text, and a form that sends people to a link gets a short note instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same name as the end block in the document. The #completion-page link and the code names stay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In the editor's preview the button took the whole editor tab to its link. Outside the preview it still opens in the same tab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…280's Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
OK at dd6cfb8, one nit inline. No CI (stacked), local runs: Vitest 491, lint, vue-tsc, build. 9 of the 10 new tests fail on c6354e6.
Tried at 1440 and 390: the preview follows the open end screen and each save, goes back to a question, and the button opens a new tab without window.opener. A stranger's preview link shows "Form not found". ?block=end and a posted goto leave a real form at question 1.
| }); | ||
| // the preview doesn't follow the link, so its end screen is one nobody sees | ||
| const redirect = computed(() => | ||
| shown.value === END_SCREEN && store.form?.use_cta_redirect |
There was a problem hiding this comment.
Nit: the public form redirects only to http(s) links (conversation.ts:574), but the API also takes mailto:. With a mailto: redirect people see the end screen, while this hides the frame and says "people go to mailto:…". Tried on the test server, put back after. The document's line (EndScreenBlock.vue:11, from #271) uses the same rule, so I'd change both, e.g. with isAllowedLink(store.form.cta_link, ["http:", "https:"]). Not run.
The preview's form put the cursor in its own field after each move, so typing in a question just opened went into the preview. In preview mode the form now never takes the focus on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The public form only goes to an http(s) link. With a mailto: link it shows the end screen, so the document and the preview now show it too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
OK at 83ec4a3, one should inline. No CI (stacked), local runs: Vitest 495, lint, vue-tsc, build. The 3 new tests fail on dd6cfb8.
Tried at 1440 with the preview open: after opening questions 1 to 3 or the end screen, typing lands in the editor. A mailto: redirect now shows the end screen in the document and the preview.
| // the preview never takes the cursor from the editor around it | ||
| const focusDisabled = computed(() => { | ||
| return isLoading.value && !props.flags.autofocus; | ||
| return isPreview || (isLoading.value && !props.flags.autofocus); |
There was a problem hiding this comment.
Should: this also drops the cursor when someone clicks through the preview. On the real form, Enter on question 1 puts the cursor on question 2's choices. In a ?preview=1 tab and in the editor's frame it stays on the page. Tried on the test server. Maybe block focus only while the preview's window isn't focused, e.g. isPreview ? !windowFocused.value : … with useWindowFocus() from @vueuse/core. Not run.
The preview blocked focus all the time, so a keyboard user couldn't try the form there. It now blocks focus only while its own window isn't focused: the editor keeps the cursor, and Enter in the preview moves on to the next question as on the real form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a tablet or phone the preview opens over the document. After a click into the preview, Esc went to the form there and the panel stayed open. The form in preview mode now tells the editor about Esc (same origin both ways, like the other preview messages), and the panel closes with focus back on the Preview button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
OK at 1bb9bf6, the should from 83ec4a3 is fixed. No CI (stacked), local runs: Vitest 499, lint, vue-tsc, build. The 4 new tests fail on 83ec4a3.
Tried at 1440 and 390: Enter in a ?preview=1 tab or in the editor's frame puts the cursor on question 2, as on the real form. Typing after opening a question in the editor stays there. Esc inside the frame closes the phone panel and puts focus back on Preview.
|
Landed in main with #282 (the editor rebuild as one PR); this PR's commits are part of it. |
The preview went only to questions. Now, while the end block is open, it shows the end screen with the saved headline, text and button, and goes back to a question you open. Settings now calls the completion page "End screen", like the document.
Part of BITS-285
end, through the existing goto message and?block=. Nothing reaches the server.blockFocus.ts, so the preview can read it.Tested: Vitest (16 of 18 new tests fail without the fix), lint, vue-tsc, build. By hand (1440, 390): end screen, headline save, back to question, nothing stored.
At 1440 also: button opens a new tab, typing after opening question 2 lands in it. Enter in the preview moves on (1440, 390); Esc there closes the panel (390).
Not tested: the redirect note and the button at 390 by hand (Vitest covers them). Stacked on #279, so no CI runs.
🤖 Generated with Claude Code