Skip to content

Save page when creating custom layout (BL-15989)#7731

Merged
StephenMcConnel merged 1 commit intomasterfrom
saveNewCustom
Mar 16, 2026
Merged

Save page when creating custom layout (BL-15989)#7731
StephenMcConnel merged 1 commit intomasterfrom
saveNewCustom

Conversation

@JohnThomson
Copy link
Contributor

@JohnThomson JohnThomson commented Mar 11, 2026

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


Open with Devin

This change is Reviewable

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment on lines +449 to +455
// 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);

Choose a reason for hiding this comment

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

🚩 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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
@JohnThomson JohnThomson changed the title Save page when creating custom layout Save page when creating custom layout (BL-15989) Mar 11, 2026
Copy link
Contributor

@StephenMcConnel StephenMcConnel left a comment

Choose a reason for hiding this comment

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

@StephenMcConnel reviewed 1 file and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on JohnThomson).

Copy link
Contributor

@StephenMcConnel StephenMcConnel left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on JohnThomson).

@StephenMcConnel StephenMcConnel merged commit 0fd3b9d into master Mar 16, 2026
1 of 2 checks passed
@StephenMcConnel StephenMcConnel deleted the saveNewCustom branch March 16, 2026 15:33
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.

2 participants