Skip to content

Reduce editor keydown plugin work#5906

Merged
ComputelessComputer merged 2 commits into
mainfrom
fix/reduce-editor-keydown-plugin-work
Jul 4, 2026
Merged

Reduce editor keydown plugin work#5906
ComputelessComputer merged 2 commits into
mainfrom
fix/reduce-editor-keydown-plugin-work

Conversation

@ComputelessComputer

@ComputelessComputer ComputelessComputer commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Compute placeholder decorations from the selected block and limit image trailing paragraph repair to changed document ranges so large notes avoid document-wide plugin scans during typing.


Note

Medium Risk
Placeholder and image-repair logic changed how empty blocks are targeted; behavior is covered by new tests but still affects all note editing UX.

Overview
Editor typing performance: placeholderPlugin no longer walks the whole document with doc.descendants; it resolves a single empty block from the selection (including nested blocks and gap-cursor neighbors) and applies at most one decoration. imageTrailingParagraphPlugin only inspects images in transaction changed ranges (via getChangedRanges) instead of every top-level child on each edit.

Desktop: ClassicMainBody is wrapped in a memoized ClassicMainBodyHost, and TimelineView is exported as memo(...) so parents can skip redundant subtree work. Timeline tests pass explicit props on rerender where memo would otherwise leave stale UI.

Tests: New Vitest coverage for placeholder selection behavior and image trailing-paragraph insert/repair edge cases.

Reviewed by Cursor Bugbot for commit 9cc5fb2. Bugbot is set up for automated code reviews on this repo. Configure here.

@netlify

netlify Bot commented Jul 4, 2026

Copy link
Copy Markdown

Deploy Preview for old-char ready!

Name Link
🔨 Latest commit 29a9304
🔍 Latest deploy log https://app.netlify.com/projects/old-char/deploys/6a488f21fe545500080e6160
😎 Deploy Preview https://deploy-preview-5906--old-char.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread packages/editor/src/plugins/image-trailing-paragraph.ts
@ComputelessComputer ComputelessComputer force-pushed the fix/reduce-editor-keydown-plugin-work branch from 012bfc7 to 0d97638 Compare July 4, 2026 03:57
Comment thread packages/editor/src/plugins/placeholder.ts
@ComputelessComputer ComputelessComputer force-pushed the fix/reduce-editor-keydown-plugin-work branch from 0d97638 to 8c3f1f3 Compare July 4, 2026 04:09
Comment thread packages/editor/src/plugins/placeholder.ts Outdated
@ComputelessComputer ComputelessComputer force-pushed the fix/reduce-editor-keydown-plugin-work branch 2 times, most recently from 223d25d to 0238516 Compare July 4, 2026 04:16

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0238516. Configure here.

Comment thread packages/editor/src/plugins/placeholder.ts
@ComputelessComputer ComputelessComputer force-pushed the fix/reduce-editor-keydown-plugin-work branch 3 times, most recently from 524e7f5 to 29a9304 Compare July 4, 2026 04:42
@ComputelessComputer ComputelessComputer changed the base branch from main to fix/reduce-panel-context-render-churn July 4, 2026 04:42
@ComputelessComputer ComputelessComputer force-pushed the fix/reduce-panel-context-render-churn branch from ffc8630 to 74c1d2b Compare July 4, 2026 05:05
@ComputelessComputer ComputelessComputer force-pushed the fix/reduce-editor-keydown-plugin-work branch from 29a9304 to e9dc4bd Compare July 4, 2026 05:05
@ComputelessComputer ComputelessComputer force-pushed the fix/reduce-panel-context-render-churn branch from 74c1d2b to cf88576 Compare July 4, 2026 05:33
@ComputelessComputer ComputelessComputer force-pushed the fix/reduce-editor-keydown-plugin-work branch from e9dc4bd to b990913 Compare July 4, 2026 05:33
Compute placeholder decorations from the selected block and limit image trailing paragraph repair to changed document ranges so large notes avoid document-wide plugin scans during typing.
@ComputelessComputer ComputelessComputer force-pushed the fix/reduce-editor-keydown-plugin-work branch from b990913 to 9cc5fb2 Compare July 4, 2026 05:57
@ComputelessComputer ComputelessComputer changed the base branch from fix/reduce-panel-context-render-churn to main July 4, 2026 05:57
@ComputelessComputer ComputelessComputer merged commit adb4bd0 into main Jul 4, 2026
8 checks passed
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.

1 participant