Skip to content

⚡ Bolt: optimize ProseMirror cursor DOM recycling - #217

Draft
dezren39 wants to merge 6 commits into
mainfrom
bolt/prosemirror-dom-recycling-10118274821565687820
Draft

dezren39 wants to merge 6 commits into
mainfrom
bolt/prosemirror-dom-recycling-10118274821565687820

Conversation

@dezren39

Copy link
Copy Markdown
Member

💡 What: Changed ProseMirror Decoration.widget construction in collaborative cursor plugin to use DOM factory functions (() => HTMLElement) and stable recycling keys based on dynamic properties (opacity, connectionState, color). Eliminated decorationGeneration logic which bypassed recycling.
🎯 Why: Instantiating DOM nodes directly during decoration mapping without recycling causes severe layout thrashing and continuous garbage collection when cursors move.
📊 Impact: Expected to dramatically reduce memory pressure and layout recalculation pauses when typing in collaboratively edited documents.
🔬 Measurement: Verify cursor updates now simply move existing DOM nodes rather than continuously creating/destroying nodes in browser DevTools.


PR created automatically by Jules for task 10118274821565687820 started by @dezren39

💡 What: Changed ProseMirror `Decoration.widget` construction in collaborative cursor plugin to use DOM factory functions (`() => HTMLElement`) and stable recycling keys based on dynamic properties (`opacity`, `connectionState`, `color`). Eliminated `decorationGeneration` logic which bypassed recycling.
🎯 Why: Instantiating DOM nodes directly during decoration mapping without recycling causes severe layout thrashing and continuous garbage collection when cursors move.
📊 Impact: Expected to dramatically reduce memory pressure and layout recalculation pauses when typing in collaboratively edited documents.
🔬 Measurement: Verify cursor updates now simply move existing DOM nodes rather than continuously creating/destroying nodes in browser DevTools.

Co-authored-by: dezren39 <11225574+dezren39@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

google-labs-jules Bot and others added 5 commits October 15, 2026 01:50
💡 What: Fixed two biome lint warnings for an unused/unassigned `leftmostCursorLine` variable in `pkgs/id/web/src/cursors.ts` that were uncovered during CI.
🎯 Why: The CI `nix flake check` failed due to the `id-biome-check` job failing on formatting and unused variables which were introduced when refactoring DOM node generation to utilize factory functions in the previous commit.
📊 Impact: Expected to pass CI formatting and linting checks.
🔬 Measurement: Verify `bunx @biomejs/biome check src/cursors.ts` reports no errors or warnings locally.

Co-authored-by: dezren39 <11225574+dezren39@users.noreply.github.com>
💡 What: Fixed two biome lint warnings for an unused/unassigned `leftmostCursorLine` variable in `pkgs/id/web/src/cursors.ts` that were uncovered during CI.
🎯 Why: The CI `nix flake check` failed due to the `id-biome-check` job failing on formatting and unused variables which were introduced when refactoring DOM node generation to utilize factory functions in the previous commit.
📊 Impact: Expected to pass CI formatting and linting checks.
🔬 Measurement: Verify `bunx @biomejs/biome check src/cursors.ts` reports no errors or warnings locally.

Co-authored-by: dezren39 <11225574+dezren39@users.noreply.github.com>
💡 What: Fixed formatting in `.jules/bolt.md` using prettier.
🎯 Why: CI `treefmt check` job failed due to formatting issues in the markdown file generated during previous code changes.
📊 Impact: Expected to pass CI formatting checks.
🔬 Measurement: Verify tests run cleanly on CI.

Co-authored-by: dezren39 <11225574+dezren39@users.noreply.github.com>
💡 What: Fixed rust code formatting in `pkgs/id/src/blob_gate.rs` using `cargo fmt`.
🎯 Why: CI `cargo-fmt-check` failed. Even though this isn't in a file touched by this agent run, fixing it resolves the overall CI check suite failure.
📊 Impact: Expected to pass CI formatting checks.
🔬 Measurement: Verify `cargo fmt --check` succeeds.

Co-authored-by: dezren39 <11225574+dezren39@users.noreply.github.com>
💡 What: Fixed rust code formatting in `pkgs/id/src/blob_gate.rs` using `cargo fmt`.
🎯 Why: CI `cargo-fmt-check` failed. Even though this isn't in a file touched by this agent run, fixing it resolves the overall CI check suite failure.
📊 Impact: Expected to pass CI formatting checks.
🔬 Measurement: Verify `cargo fmt --check` succeeds.

Co-authored-by: dezren39 <11225574+dezren39@users.noreply.github.com>
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