From 124ef62b5fbe70ce6193c1eb3e70e061d649179f Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Tue, 18 Aug 2026 03:10:26 +0000 Subject: [PATCH] Fix flow from new page creation to page editor. --- frontend/src/SiteEditor.vue | 2 +- frontend/src/pagerite.js | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/SiteEditor.vue b/frontend/src/SiteEditor.vue index 1a114f8..324066e 100644 --- a/frontend/src/SiteEditor.vue +++ b/frontend/src/SiteEditor.vue @@ -190,7 +190,7 @@ async function loadPlain(p) { history.replaceState(null, '', finalUrl) runScripts(document.getElementById('page-banner')) runScripts(document.getElementById('main')) - dispatchEvent(new CustomEvent('pagerite:preview')) // re-tuck the edit pen + dispatchEvent(new CustomEvent('pagerite:preview')) // re-inject + re-tuck the edit pens // The swap brought in the server-rendered (inherited) banner; overlay // the page's own banner if one is being edited. if (banner.value.trim()) previewBanner() diff --git a/frontend/src/pagerite.js b/frontend/src/pagerite.js index 7bb2cb9..1f1c7bb 100644 --- a/frontend/src/pagerite.js +++ b/frontend/src/pagerite.js @@ -214,7 +214,14 @@ import { showAuthIframe } from 'paskia' if (btn && h1 && btn.parentElement !== h1) h1.append(btn); } - addEventListener("pagerite:preview", placeEditPen); + addEventListener("pagerite:preview", () => { + // The editors' in-place swaps (SiteEditor.loadPlain) replace #main + // without applyEffects, discarding the injected pens; re-add them + // before tucking the article pen into the h1. Without this a freshly + // created page has no pen for commitPending's handover click. + renderAuthUi(); + placeEditPen(); + }); function applyEffects() { (window.requestIdleCallback || setTimeout)(preload);