Skip to content

feat: add clear formatting button to toolbar - #9046

Open
ibrahim-iqbal wants to merge 1 commit into
AppFlowy-IO:mainfrom
ibrahim-iqbal:feat/clear-formatting-toolbar
Open

ibrahim-iqbal wants to merge 1 commit into
AppFlowy-IO:mainfrom
ibrahim-iqbal:feat/clear-formatting-toolbar

Conversation

@ibrahim-iqbal

@ibrahim-iqbal ibrahim-iqbal commented Sep 30, 2026 •

Copy link
Copy Markdown

Feature Preview

Adds a Clear formatting button to the desktop toolbar's "More options" (⋯) popover menu. Selecting text and clicking it strips all inline formatting (bold, italic, underline, strikethrough, code, font family, link, background color, and text color) in one click.

The button uses the existing eraser icon and appears below the formula entry in the popover, always visible when the more-options menu is open.

fixes #3427


PR Checklist

  • My code adheres to AppFlowy's Conventions
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

Summary by Sourcery

Add a clear-formatting control to the editor toolbar for quickly removing formatting from selected text.

New Features:

  • Add a clear-formatting action to the desktop toolbar’s More options menu, allowing selected text to have inline formatting removed in one step.

Chores:

  • Add localized labels for the new toolbar action.

Adds a "Clear formatting" entry to the desktop toolbar's "More options"
popover. It strips bold, italic, underline, strikethrough, code, font
family, link, background color, and text color from the selected text
using editorState.formatDelta with null attributes.

Closes AppFlowy-IO#3427
@sourcery-ai

sourcery-ai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR introduces an always-visible Clear formatting action in the desktop More options popover, using the existing eraser icon and localized label. When invoked, it applies a null-valued format delta across the selected range to remove the supported inline formatting attributes in one operation.

Sequence diagram for clearing selected text formatting

sequenceDiagram
    actor User
    participant MoreOptionsPopover
    participant EditorState

    User->>MoreOptionsPopover: Select Clear formatting
    MoreOptionsPopover->>EditorState: formatDelta(selection, null-valued format attributes)
    EditorState-->>User: Selected text has inline formatting removed
Loading

File-Level Changes

Change Details Files
Adds a clear-formatting command to the desktop toolbar’s More options menu and wires it to remove inline text attributes.
  • Adds the eraser menu item below the formula action.
  • Adds localized command labeling and command metadata.
  • Clears bold, italic, underline, strikethrough, code, font family, link, background color, and text color over the current selection.
  • Adds English (US and GB) translation entries.
frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/toolbar_item/more_option_toolbar_item.dart
frontend/resources/translations/en-GB.json
frontend/resources/translations/en-US.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@CLAassistant

CLAassistant commented Sep 30, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown

🥷 Ninja i18n – 🛎️ Translations need to be updated

Project /project.inlang

lint rule new reports level link
Missing translation 29 warning contribute (via Fink 🐦)
Identical pattern 1 warning contribute (via Fink 🐦)

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

This branch has not been deployed

No deployments
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.

[FR] remove formatting option

2 participants