Skip to content

feat(toolbar): make formatting marks button opt-in via config#3324

Merged
caio-pizzol merged 2 commits into
mainfrom
caio/toolbar-formatting-marks-button-opt-in
May 15, 2026
Merged

feat(toolbar): make formatting marks button opt-in via config#3324
caio-pizzol merged 2 commits into
mainfrom
caio/toolbar-formatting-marks-button-opt-in

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

The pilcrow (¶) button is now opt-in instead of shipping in the default toolbar. Consumers that want it back set modules.toolbar.showFormattingMarksButton: true.

  • Default behavior change: the button disappears from the toolbar unless the flag is set. The underlying superdoc.toggleFormattingMarks() command and layoutEngineOptions.showFormattingMarks paint option are unchanged.
  • The new flag is intentionally distinct from layoutEngineOptions.showFormattingMarks to avoid name collision. The layout option controls whether marks render in the document; the toolbar flag only controls the button's presence.
  • Works in any mode; removed formattingMarks from the non-docx filter since the behavior is paint-side, not converter state.

Verified: pnpm --filter @superdoc/super-editor test src/editors/v1/components/toolbar/ 91/91 passing; pnpm --filter superdoc... build clean.

@caio-pizzol caio-pizzol requested a review from a team as a code owner May 15, 2026 19:42
@github-actions
Copy link
Copy Markdown
Contributor

@caio-pizzol caio-pizzol self-assigned this May 15, 2026
@caio-pizzol caio-pizzol merged commit b49aa94 into main May 15, 2026
27 checks passed
@caio-pizzol caio-pizzol deleted the caio/toolbar-formatting-marks-button-opt-in branch May 15, 2026 19:42
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f405635535

ℹ️ 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".

toolbarItems.splice(getLinkedStylesIndex - 1, 2);

const filterItems = ['ruler', 'formattingMarks', 'zoom', 'undo', 'redo'];
const filterItems = ['ruler', 'zoom', 'undo', 'redo'];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep formatting marks out of non-docx toolbars

When showFormattingMarksButton is enabled for a toolbar running with config.mode !== 'docx' (for example an html/text Editor toolbar, which the new test now expects), this filter no longer removes the pilcrow button even though the command is only implemented through SuperDoc's layout/presentation rendering path. In standalone SuperToolbar({ editor }) there is no superdoc.toggleFormattingMarks, so clicking falls through to a missing editor command and throws; in SuperDoc HTML documents the viewer is the plain HtmlViewer rather than a PresentationEditor, so toggling has no rendered effect. Please keep this item filtered for non-docx modes or gate it on an available formatting-marks implementation.

Useful? React with 👍 / 👎.

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 15, 2026

🎉 This PR is included in @superdoc-dev/mcp v0.3.0-next.107

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 15, 2026

🎉 This PR is included in vscode-ext v2.3.0-next.153

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 15, 2026

🎉 This PR is included in @superdoc-dev/react v1.2.0-next.151

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 15, 2026

🎉 This PR is included in superdoc-cli v0.8.0-next.122

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 15, 2026

🎉 This PR is included in superdoc-sdk v1.8.0-next.105

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 15, 2026

🎉 This PR is included in superdoc v1.30.0-next.101

The release is available on GitHub release

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants