Skip to content

Stabilize live heading collapse - #28

Merged
sufyanaser merged 1 commit into
developfrom
codex/fix-live-heading-collapse
Aug 2, 2026
Merged

Stabilize live heading collapse#28
sufyanaser merged 1 commit into
developfrom
codex/fix-live-heading-collapse

Conversation

@sufyanaser

Copy link
Copy Markdown
Owner

What changed

  • moved heading collapse state into a ProseMirror plugin and node decorations
  • preserved collapsed sections across editor transactions and document position mapping
  • reset collapse state safely when switching notes
  • kept toolbar and inline heading controls synchronized
  • removed the global DOM mutation observer fallback

Root cause

The previous implementation wrote unmanaged attributes directly into ProseMirror-owned editable DOM. ProseMirror reconciled those attributes during live editing, so collapse only appeared reliable after locking the note and could jump when transactions rebuilt the DOM.

User impact

Heading sections now collapse and expand immediately while a note is unlocked, without changing saved note HTML or shifting the heading viewport position.

Validation

  • lint: passed with zero warnings
  • TypeScript check: passed
  • tests: 62/62 passed
  • production build: passed
  • npm audit: 0 vulnerabilities
  • Electron native-module smoke test: passed
  • real Electron/CDP collapse-expand test: passed; heading top remained 1963.125 px before and after toggle

@sufyanaser
sufyanaser marked this pull request as ready for review August 2, 2026 18:36
@sufyanaser
sufyanaser merged commit 9510d8b into develop Aug 2, 2026
1 check 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