Skip to content

Derivative preserves custom pages (BL-16074)#7809

Open
JohnThomson wants to merge 1 commit intomasterfrom
customPageDerivative
Open

Derivative preserves custom pages (BL-16074)#7809
JohnThomson wants to merge 1 commit intomasterfrom
customPageDerivative

Conversation

@JohnThomson
Copy link
Copy Markdown
Contributor

@JohnThomson JohnThomson commented Apr 3, 2026

Also better handles various aspects of restoring a saved custom page state (e.g., disabled because no subscription) when the languages have changed since the custom page was saved.


Open with Devin

This change is Reviewable

Also better handles various aspects of restoring a saved custom page state (e.g., disabled because no subscription) when the languages have changed since the custom page was saved.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

Copy link
Copy Markdown

@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 1 potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment on lines 285 to +289

InjectXMatter(initialPath, storage, sizeAndOrientation);

// Restore bloom-customLayout to any pages that had it before xmatter replacement.
XMatterHelper.RestoreCustomLayoutClasses(storage.Dom, customLayoutIds);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚩 GatherCustomLayoutIds/RestoreCustomLayoutClasses may be a no-op in BookStarter for xmatter pages

The newly added GatherCustomLayoutIds at BookStarter.cs:256 collects IDs from pages with bloom-customLayout before xmatter removal. After InjectXMatter at line 286, the new xmatter pages come from generic templates that lack data-custom-layout-id attributes. Therefore RestoreCustomLayoutClasses at line 289 searches for @data-custom-layout-id on pages (XPath at XMatterHelper.cs:562) but won't find any on the freshly injected template pages. This makes the Gather/Restore pair effectively a no-op for xmatter pages in the BookStarter path. The bloom-customLayout class and custom content would only be properly restored later when the book is fully loaded via EnsureUpToDateSynchronizeDataItemsThroughoutDOM. This is harmless (no incorrect behavior), but worth noting that the protection is not actually active in this code path. The same pattern in Book.cs:BringXmatterHtmlUpToDate works because SynchronizeDataItemsThroughoutDOM runs shortly after and restores data-custom-layout-id to the pages before they're used.

(Refers to lines 254-289)

Open in Devin Review

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

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