Skip to content

Replace editor view polling with callbacks#5562

Merged
ComputelessComputer merged 1 commit into
mainfrom
fix/note-editor-view-callbacks
Jun 12, 2026
Merged

Replace editor view polling with callbacks#5562
ComputelessComputer merged 1 commit into
mainfrom
fix/note-editor-view-callbacks

Conversation

@ComputelessComputer

@ComputelessComputer ComputelessComputer commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Expose NoteEditor view lifecycle callbacks and use them in NoteInput instead of polling the editor ref after render.


Note

Low Risk
Localized editor lifecycle wiring for UI caret behavior; no auth, persistence, or API changes.

Overview
Replaces per-render polling of internalEditorRef.current?.view in session NoteInput with explicit ProseMirror view lifecycle hooks, so caret-near-bottom tracking gets a stable EditorView when the editor mounts and clears it on teardown (e.g. raw ↔ enhanced tab switches).

NoteEditor gains optional onViewReady / onViewDisposed props. ViewCapture now runs disposal in the useEditorEffect cleanup (with a ref for latest callbacks) and still invokes the internal ready path that seeds debounced onUpdate before forwarding onViewReady. Raw, Enhanced, and EnhancedEditor pass these callbacks through unchanged.

NoteInput wires handleViewReady / handleViewDisposed into both tab editors; dispose only nulls state when the disposed view matches the current one, avoiding races if a new view is already active.

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

Expose NoteEditor view lifecycle callbacks and use them in NoteInput instead of polling the editor ref after render.
@netlify

netlify Bot commented Jun 12, 2026

Copy link
Copy Markdown

Deploy Preview for old-char canceled.

Name Link
🔨 Latest commit 791c919
🔍 Latest deploy log https://app.netlify.com/projects/old-char/deploys/6a2bbe2ba3c4f8000735f823

@ComputelessComputer ComputelessComputer merged commit 7661061 into main Jun 12, 2026
11 checks passed
@ComputelessComputer ComputelessComputer deleted the fix/note-editor-view-callbacks branch June 12, 2026 08:38
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