fix: show correct paragraph font in toolbar when selection is empty (SD-2145)#2402
Merged
harbournick merged 2 commits intomainfrom Mar 17, 2026
Conversation
abb8286 to
7fac727
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7fac7275c6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
fd49b70 to
c405a19
Compare
Contributor
|
🎉 This PR is included in superdoc-cli v0.3.0-next.5 The release is available on GitHub release |
Contributor
|
🎉 This PR is included in superdoc v1.19.1-next.4 The release is available on GitHub release |
harbournick
pushed a commit
that referenced
this pull request
Mar 18, 2026
# [1.20.0](v1.19.1...v1.20.0) (2026-03-18) ### Bug Fixes * behavior tests ([#2436](#2436)) ([2d087f2](2d087f2)) * change default link protocol ([#2319](#2319)) ([1deda06](1deda06)) * **cli:** restore tracked diff redline roundtrip ([#2438](#2438)) ([f609371](f609371)) * **comments:** resolve double-click activation and edit mode issues (SD-2035) ([#2259](#2259)) ([d9465aa](d9465aa)) * **diffing:** ignore volatile OOXML attrs in image and paragraph diff comparison ([#2421](#2421)) ([ca91225](ca91225)) * **doc-api:** gate textStyle attrs and sync reference coverage ([#2430](#2430)) ([e2d6ca6](e2d6ca6)) * **docs:** coherence pass on doc api, clean up dead code, update CLI SKILL.md ([#2424](#2424)) ([bf0d4b8](bf0d4b8)) * **document-api:** add document diff API and fix tracked diff replay in CLI host session ([#2418](#2418)) ([2a804f7](2a804f7)) * **editor:** prevent scroll-to-top when clicking toolbar buttons ([#2236](#2236)) ([ab30a36](ab30a36)) * guard drawing export against invalid structures and zero IDs (SD-824) ([#2363](#2363)) ([9c7fc2e](9c7fc2e)) * improve multi-column rendering ([#2369](#2369)) ([d231640](d231640)) * **lists:** stabilize list item addresses for docs without paraIds ([#2429](#2429)) ([0070de6](0070de6)) * newline formatting inheritance without serializing style-derived formatting (SD-2228) ([#2417](#2417)) ([5a3318f](5a3318f)) * open links in view mode ([#2350](#2350)) ([25f0aad](25f0aad)) * **presentation-editor:** arrow key scroll-into-view with unconstrained containers (SD-1950) ([#2411](#2411)) ([fa8afc8](fa8afc8)), closes [#findScrollableAncestor](https://github.com/superdoc-dev/superdoc/issues/findScrollableAncestor) * register DOCX numbering metadata for lists.create ([#2432](#2432)) ([129772f](129772f)) * seed base docx package for collaboration exports ([#2416](#2416)) ([df36853](df36853)) * show correct paragraph font in toolbar when selection is empty (SD-2145) ([#2402](#2402)) ([39e1477](39e1477)) * **super-editor:** guard against style definition nodes without elements ([#2379](#2379)) ([7dd57f8](7dd57f8)) * text selection inside headers/footers ([#2404](#2404)) ([09677dc](09677dc)) * **toc:** inject _Toc bookmarks so exported DOCX TOC links work without manual Update Table ([#2431](#2431)) ([54c5aa7](54c5aa7)) ### Features * **comments:** add scrollToComment API ([#2440](#2440)) ([0132d0e](0132d0e)) * **doc-info:** add live page counts to doc.info ([#2435](#2435)) ([e631f4b](e631f4b)) * **doc-info:** live doc.info counts for characters, tracked changes, SDT fields, and lists ([#2428](#2428)) ([2978507](2978507)) ### Reverts * Revert "fix(types): fix broken .d.ts imports in published superdoc package (S…" ([#2443](#2443)) ([33215ee](33215ee))
Collaborator
|
🎉 This PR is included in superdoc v1.20.0 The release is available on GitHub release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the cursor lands inside an empty paragraph, the toolbar never reflects the paragraph’s paragraphProperties font family because it only reads active marks or linked-style overrides; newly inserted runs still inherit the paragraph font, so the toolbar value was wrong.
Solution
encodeMarksFromRPr) whenever the selection is collapsed inside an empty paragraph and no font-family mark/link override is active.