Save page when creating custom layout (BL-15989)#7731
Conversation
| // Persist the newly created custom layout state so a later toggle back | ||
| // to standard has matching server-side state to work from. | ||
| await postString( | ||
| "editView/jumpToPage", | ||
| page.getAttribute("id")!, | ||
| ); | ||
| renderPageLayoutMenu(page, container); |
There was a problem hiding this comment.
🚩 editView/jumpToPage triggers a page save AND reload, not just a save
The new code at lines 451-454 uses editView/jumpToPage to persist the custom layout state. Looking at the C# handler (EditingViewApi.cs:195-200), HandleJumpToPage calls request.PostSucceeded() then View.Model.SaveThen(() => pageId, () => { }). SaveThen saves the current page DOM and then navigates to pageId. Since the page ID is the current page, this will cause a full page reload after the save completes. This means renderPageLayoutMenu at line 455 is called but will be immediately wiped by the reload. The reload also means setupPageLayoutMenu() will run again on the reloaded page, re-rendering the menu. This is wasteful but not harmful — it just causes a brief visual flash. If the intent is only to save (not reload), a more targeted save mechanism may be preferable.
Was this helpful? React with 👍 or 👎 to provide feedback.
ff5ea70 to
dcdf682
Compare
This puts the backend properly into custom mode so switching to standard again works. Also fixed a problem with using async code that modifies the dom
dcdf682 to
881dc68
Compare
StephenMcConnel
left a comment
There was a problem hiding this comment.
@StephenMcConnel reviewed 1 file and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on JohnThomson).
StephenMcConnel
left a comment
There was a problem hiding this comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on JohnThomson).
This puts the backend properly into custom mode so switching to standard again works.
Also fixed a problem with using async code that modifies the dom
This change is