Skip to content

Fix DOM inline formatting#138

Open
gohabereg wants to merge 2 commits intomainfrom
fix/dom-formatting
Open

Fix DOM inline formatting#138
gohabereg wants to merge 2 commits intomainfrom
fix/dom-formatting

Conversation

@gohabereg
Copy link
Copy Markdown
Member

Inline tools were not applied to the DOM tree because Adapter was initialized after tools were loaded. Caret and Formatting adapters were not initialized at all before first BlockToolAdapter is created

Fixed the order of initialization in this PR

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

⏭️ No files to mutate for ./packages/model

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Coverage report for ./packages/dom-adapters

St.
Category Percentage Covered / Total
🟢 Statements 96.43% 27/28
🟢 Branches 86.96% 20/23
🟢 Functions 100% 5/5
🟢 Lines 96.43% 27/28

Test suite run success

11 tests passing in 2 suites.

Report generated by 🧪jest coverage report action from 088abf6

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Coverage report for ./packages/core

St.
Category Percentage Covered / Total
🟢 Statements 100% 129/129
🟢 Branches 100% 47/47
🟢 Functions 100% 27/27
🟢 Lines 100% 120/120

Test suite run success

75 tests passing in 7 suites.

Report generated by 🧪jest coverage report action from 088abf6

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

⏭️ No files to mutate for ./packages/dom-adapters

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Coverage report for ./packages/model

St.
Category Percentage Covered / Total
🟢 Statements 99.8% 988/990
🟢 Branches 98.98% 292/295
🟢 Functions 97.45% 229/235
🟢 Lines 99.79% 948/950

Test suite run success

538 tests passing in 25 suites.

Report generated by 🧪jest coverage report action from 088abf6

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

⏭️ No files to mutate for ./packages/core

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Coverage report for ./packages/collaboration-manager

St.
Category Percentage Covered / Total
🟢 Statements 92.51% 358/387
🟢 Branches 85.51% 118/138
🟢 Functions 98.15% 53/54
🟢 Lines 92.41% 353/382

Test suite run success

117 tests passing in 7 suites.

Report generated by 🧪jest coverage report action from 088abf6

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Coverage report for ./packages/ot-server

St.
Category Percentage Covered / Total
🟡 Statements 70.97% 22/31
🔴 Branches 20% 1/5
🟡 Functions 75% 6/8
🟡 Lines 68.97% 20/29

Test suite run success

4 tests passing in 1 suite.

Report generated by 🧪jest coverage report action from 088abf6

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 fixes inline DOM formatting application by ensuring DOM adapter internals (caret + formatting) are instantiated early enough to receive tool-loading events and to be available before the first block adapter is created.

Changes:

  • Eagerly initializes FormattingAdapter and CaretAdapter when the DOM adapter plugin is constructed.
  • Adjusts Core initialization order to eagerly resolve key internal modules (BlockRenderer, BlocksManager, SelectionManager) before plugins/tools are initialized, so adapter-related event listeners are registered in time.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/dom-adapters/src/index.ts Forces early instantiation of singleton DOM adapters to register listeners before tools load.
packages/core/src/index.ts Reorders Core initialization to resolve internal modules before initializing plugins/tools.

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

Comment thread packages/dom-adapters/src/index.ts
Comment thread packages/core/src/index.ts Outdated
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.

4 participants