Skip to content

Load chapters together with navigation pages - #2541

Merged
tf merged 1 commit into
codevise:masterfrom
tf:navigation-page-chapters
Nov 27, 2026
Merged

tf merged 1 commit into
codevise:masterfrom
tf:navigation-page-chapters

Conversation

@tf

@tf tf commented Nov 27, 2026

Copy link
Copy Markdown
Member

The Paged editor re-renders navigation widgets via the partials action whenever chapters or pages are saved. Rendering takes one to two seconds. When a chapter is deleted while such a request is running, pages loaded at the beginning of the request can no longer find their chapter once page_navigation_css_class lazily loads it, raising "undefined method 'position' for nil".

Eager loading chapters in the displayed_in_navigation scope makes pages and chapters come from the same snapshot. Doing this in the scope also covers navigation widgets of plugins like progress navigation bar and new pages box, which render chapters of pages from the same scope, and removes one chapter query per page.

The Paged editor re-renders navigation widgets via the partials action
whenever chapters or pages are saved. Rendering takes one to two
seconds. When a chapter is deleted while such a request is running,
pages loaded at the beginning of the request can no longer find their
chapter once page_navigation_css_class lazily loads it, raising
"undefined method 'position' for nil".

Eager loading chapters in the displayed_in_navigation scope makes pages
and chapters come from the same snapshot. Doing this in the scope also
covers navigation widgets of plugins like progress navigation bar and
new pages box, which render chapters of pages from the same scope, and
removes one chapter query per page.
@tf tf added this to the v17.3 milestone Nov 27, 2026
@tf
tf merged commit 082acb4 into codevise:master Nov 27, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant