Repository navigation
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
|
Size Change: +12 B (0%) Total Size: 7.76 MB 📦 View Changed
|
|
@t-hamano @Mamaduka I tested this approach and the behaviour which you can see below Screen.Recording.on.2026-07-29.at.10-36-09.mp4The problems I see are
The key problem though is clearly the former. I don't see it as being acceptable UX for a block like this. I'm not aware of any way around this using the current SSR approach but as it sounds like you've had more experience with this you might be aware of alternatives. If not then I don't see this approach as viable. Looking forward to your feedback. |
Right. The server only has data from persisted post content, so it can only update after the post is saved. Not sure if a custom endpoint will help here; cons:
Maybe we should keep Editor preview handling on the client-side; it would require some refactoring, but it would be responsive and probably make it easier to keep the "Convert to static list" option. cons:
|
60f61d1 to
a18ad78
Compare
a18ad78 to
ad2c4f2
Compare
🤖 PR meta 🤖📦 Bundle sizeSize Change: -131 B (0%) Total Size: 8.08 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsShow the failuresSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Navigates the items list via UP/DOWN arrow keys in
|
What
Related to #80794.
Convert the Table of Contents editor preview to reuse the existing server-side block renderer. When post context is available, the editor renders the heading list produced by the same rendering path that readers receive on the front of the site.
Why
The editor previously built a client-side approximation of the heading list, while the front end resolves headings from rendered post content. This evaluates whether server-side rendering can avoid a dedicated REST endpoint while giving authors a preview based on the reader-facing rendering path.
Key reviewer question: persisted preview versus live editing
This approach does not produce a live Table of Contents preview from unsaved editor state. It shows the most recently persisted heading list.
Are we comfortable with that author experience? If not, SSR alone is insufficient and we should consider a client-side fallback, a hybrid, or the dedicated endpoint proposed in #80786.
How
useServerSideRender, passing the edited post ID when available.Testing Instructions
These scenarios help assess whether a persisted preview is acceptable while an author edits.
First save of a new post
Saved draft: changes before and after autosave
Published post: changes before and after autosave
Automated coverage