-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WEB-1116] fix: page outline not reflecting changes in realtime #5567
Conversation
3403b0b
to
e3a8eab
Compare
WalkthroughThe changes in this pull request involve multiple modifications across various files in the editor's codebase. Key updates include enhancements to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (17)
Files not reviewed due to no reviewable changes (1)
Files skipped from review due to trivial changes (3)
Additional comments not posted (29)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Description
Headings stopped loading post the real time changes as we're not directly fetching and feeding in the data to the editor, but instead the control is with our live server.
Hence the calculation needs to happen inside the editor post it's initialization, and the web app that needs to render the headings list needs to subscribe to the editor updates for calculating using the editorRef.onHeadingChange function and can optionally pass a callback to perform a side effect based on the updated list of headings.
We're emitting an update event once the calculation of headings is complete since custom events aren't supported in tiptop, to give the latest headings' list on content change.
When a component renders for the first time there's no guarantee that the editor will emit an update (as maybe editor has initialized a long time ago, so for that reason we've exposed another function
editorRef.getHeadings()
to get the latest headings list.Minor fixes
Summary by CodeRabbit
Release Notes
New Features
HeadingListExtension
for improved management of headings in the editor.onHeadingChange
andgetHeadings
methods for dynamic access to headings in both editable and read-only modes.Bug Fixes
Refactor
markings
prop across multiple components for streamlined state management.Chores