Skip to content

Fix: ensure tools are configured before editor renders on note switch#355

Open
7eliassen wants to merge 1 commit into
mainfrom
fix/editor-block-displaying
Open

Fix: ensure tools are configured before editor renders on note switch#355
7eliassen wants to merge 1 commit into
mainfrom
fix/editor-block-displaying

Conversation

@7eliassen

Copy link
Copy Markdown
Contributor

Problem:
image
Occasionally, when switching between notes, some editor.js blocks may not be displayed correctly.

Root Cause:
image
toolsUserConfigLoaded and isEditorReady already true when the function is just called

This issue occurs because the toolsUserConfigLoaded and isEditorReady flags are not properly reset. As a result, the editor may render before the tools are fully configured, causing certain blocks to fail to display.

Fix:
Added logic to reset toolsUserConfigLoaded and isEditorReady before calling loadToolsScripts, ensuring that the editor waits for the tools to be properly configured before rendering.

@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codex-ui Ready Ready Preview, Comment Jul 8, 2026 1:50pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses an intermittent Editor.js rendering issue when switching between notes by ensuring the editor does not render until tool scripts/configuration have been rebuilt for the newly selected note.

Changes:

  • Reset isEditorReady and toolsUserConfigLoaded before re-loading tool scripts on noteAndUserTools changes.
  • Ensure the editor component remounts only after tools are configured, preventing blocks from rendering with stale/missing tool configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +147 to 150
isEditorReady.value = false;
toolsUserConfigLoaded.value = false;

await loadToolsScripts(tools);
Comment on lines +147 to 150
isEditorReady.value = false;
toolsUserConfigLoaded.value = false;

await loadToolsScripts(tools);
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.

2 participants