Skip to content

Enhancements to custom pages (BL-15948)#7766

Open
JohnThomson wants to merge 5 commits intomasterfrom
customPageImprovements
Open

Enhancements to custom pages (BL-15948)#7766
JohnThomson wants to merge 5 commits intomasterfrom
customPageImprovements

Conversation

@JohnThomson
Copy link
Copy Markdown
Contributor

@JohnThomson JohnThomson commented Mar 24, 2026

  • Add format dialog for read-only fields on custom pages
  • Remove cover-is-image book setting and migrate to custom layout
  • Keep image selected after "become background" command
  • Make hint bubbles work on custom pages

Open with Devin

This change is Reviewable

@JohnThomson JohnThomson changed the title Enhancements to custom pages Enhancements to custom pages (BL-15948) Mar 24, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor Author

@JohnThomson JohnThomson left a comment

Choose a reason for hiding this comment

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

@JohnThomson made 2 comments and resolved 2 discussions.
Reviewable status: 0 of 15 files reviewed, all discussions resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
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 15 files and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on JohnThomson).

@JohnThomson JohnThomson force-pushed the customPageImprovements branch from 73bef05 to 23693b9 Compare March 25, 2026 18:10
Copy link
Copy Markdown
Contributor Author

@JohnThomson JohnThomson left a comment

Choose a reason for hiding this comment

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

@JohnThomson made 1 comment and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on JohnThomson).

devin-ai-integration[bot]

This comment was marked as resolved.

@JohnThomson JohnThomson force-pushed the customPageImprovements branch from 23693b9 to 90b8313 Compare March 27, 2026 21:56
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 2 new potential issues.

View 8 additional findings in Devin Review.

Open in Devin Review

"coverIsImage",
out var legacyCoverSettingValue
) && legacyCoverSettingValue;
BookInfo.AppearanceSettings.Properties.Remove("coverIsImage");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚩 Migration 14 doesn't write appearance.json to disk, unlike Migration 12

MigrateToLevel14CoverIsImageToCustomLayout removes the coverIsImage property from in-memory AppearanceSettings.Properties at line 4586, but unlike MigrateToLevel12PageNumberPosition (which explicitly calls WriteToFolder and WriteCssToFolder at BookStorage.cs:4561-4562), this migration does not persist the change to disk immediately. The property removal will only be written when the book is eventually saved via Save()UpdateSupportFiles(). This is presumably safe because the DOM's maintenanceLevel is also only in memory until save, keeping both in sync. But it's worth noting the inconsistency with Level 12's approach.

Open in Devin Review

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

Comment on lines +1788 to +1808
const activateConvertedBackground = () => {
requestAnimationFrame(() => {
theOneCanvasElementManager.setActiveElement(
bgImageCe,
);
});
};
activateConvertedBackground();
if (!haveRealBgImage) {
const fallbackHandle = setTimeout(() => {
activateConvertedBackground();
}, 120);
bgImg.addEventListener(
"load",
() => {
clearTimeout(fallbackHandle);
activateConvertedBackground();
},
{ once: true },
);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚩 activateConvertedBackground uses multiple activation strategies with potential for redundancy

The new code at lines 1788-1808 activates the converted background element using three strategies: (1) immediate requestAnimationFrame, (2) a 120ms fallback timeout, and (3) an image load event listener. When !haveRealBgImage, all three can fire, each calling setActiveElement. The timeout and load event race, and the load event cancels the timeout — but the immediate rAF call at line 1795 will always fire regardless. This means setActiveElement could be called 2-3 times. If setActiveElement is idempotent this is fine, but it's worth verifying there are no side effects from multiple rapid activations.

Open in Devin Review

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

Copy link
Copy Markdown
Contributor Author

@JohnThomson JohnThomson left a comment

Choose a reason for hiding this comment

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

@JohnThomson made 2 comments.
Reviewable status: 11 of 15 files reviewed, 2 unresolved discussions (waiting on StephenMcConnel).

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.

3 participants