Closed Bug 1667372 Opened 4 years ago Closed 4 years ago

implement/expose "clear formatting/styling" in the compose window

Categories

(Thunderbird :: Message Compose Window, enhancement, P2)

enhancement

Tracking

(thunderbird_esr78 wontfix)

RESOLVED FIXED
91 Branch
Tracking Status
thunderbird_esr78 --- wontfix

People

(Reporter: mkmelin, Assigned: henry-x)

References

Details

Attachments

(8 files, 2 obsolete files)

A super common annoyance and complaint talking to people is that there are many situations (copy paste, or while replying) that you end up with mixed fonts or font styles.

We should have a button on the toolbar that let's you easily clear up such styling but keeps the structural markup that was there.

Filing this bug I notice we have a cmd_removeStyles command for this, partly working.
https://searchfox.org/comm-central/search?q=cmd_removeStyles&path=&case=false&regexp=false

There is also Ctrl+Space (but undocumented).

We should probably use document.execCommand("removeFormat", false, "" );

Assignee: nobody → henry
See Also: → 1655014

Potentially we'd want to also detect if people have mixed fonts from pasting, and offer to fix it for them. As a second step.

What's wrong with select, "Format > Remove All Text Styles". Works OK, but doesn't remove CSS, IIRC, see bug 1539110.

I never saw that. https://searchfox.org/comm-central/rev/7ed718c90a58141a74da3acbf3f97ad8854e5561/mail/components/compose/content/editor.js#1981

Apparently i need to select all the text to get it to show up.
So, at least there's much room for improving the discoverability of that.

There's not really much reason such an option/button couldn't show all the time, and remove from the whole entered text if executed.

Attached image erease icons.png (obsolete) —

Little fly by to propose some possible options for the clear formatting icon.
The currently proposed icon is not very clear unfortunately as the diagonal stroke doesn't play very well with the letter A.
What do you think about these?

Attachment #9224867 - Flags: feedback?(richard.marti)
Attachment #9224867 - Flags: feedback?(mkmelin+mozilla)
Attachment #9224867 - Flags: feedback?(henry)
Attached image erease icons.png

wow, figma really did a number on the export quality

Attachment #9224867 - Attachment is obsolete: true
Attachment #9224867 - Flags: feedback?(richard.marti)
Attachment #9224867 - Flags: feedback?(mkmelin+mozilla)
Attachment #9224867 - Flags: feedback?(henry)
Attachment #9224868 - Flags: feedback?(richard.marti)
Attachment #9224868 - Flags: feedback?(mkmelin+mozilla)
Attachment #9224868 - Flags: feedback?(henry)

Comment on attachment 9224868 [details]
erease icons.png

Of these, I'd say the first one (with the large x) is clearest

Attachment #9224868 - Flags: feedback?(mkmelin+mozilla)

Comment on attachment 9224868 [details]
erease icons.png

I'm for the one on the right. First, because we use the letter "A" on the other buttons and using the "T" would look inconsistent. Second, the eraser is a good sign for "erasing" the styles.

The icon on the left isn't so clear as it could also be recognized as "Tx".

The "close" sign in the middle could also work with the "A" instead of the eraser.

Attachment #9224868 - Flags: feedback?(richard.marti)

Comment on attachment 9224868 [details]
erease icons.png

The button has two functions:

  1. If there is a selection, remove existing styling from the selection.
  2. Stop using styling for the next typed character.

Aesthetically, I like the rubber/eraser one the best, but I don't know if it works so well for hinting at the second behaviour. On the other hand, I don't know whether the second behaviour will be used that much.

Regarding the slanted T, I know gmail uses something similar, but I don't think it works that well here. Is it slanted because the button removes Italic, among other stylings?

Also, the letter T is inconsistent with the letter A used for the other style symbols. With the other icons, you don't need to know what the letter A is, just that it looks like a consistent glyph where the buttons meaning can be derived from the differences (underlined, thicker, slanted, bigger, smaller).

I think the first cross blends a little bit too much into the T.

I think the circle cross could work if used on an A, but further in the corner. Similar to the category-dictionary icon https://searchfox.org/mozilla-central/rev/85a74c965bd4bcab091b5767c13c44f84671d9ce/toolkit/themes/shared/extensions/category-dictionaries.svg

I was also wondering if we could just avoid a glyph entirely, and just use a generic stop/remove symbol, which will make sense in context (immediately following the styling buttons):

  1. A cross, either plain or inside a circle.
  2. A stop sign (like https://searchfox.org/comm-central/rev/c880e5a1cfbce281b8836f092e08df167919d32f/mail/themes/shared/mail/icons/exclude.svg).
  3. A "clean" symbol. E.g. just your rubber on its own. In GNOME/GTK, there is edit-clear-all named icon, which is themed as a rubber (https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/blob/master/Adwaita/scalable/actions/edit-clear-all-symbolic.svg) or a sweeping brush (https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/blob/master/src/fullcolor/legacy/edit-clear-all.svg, https://github.com/elementary/icons/blob/master/actions/symbolic/edit-clear-all-symbolic.svg).
Attachment #9224868 - Flags: feedback?(henry)

FWIW, we discussed changing the letters of other buttons there. I filed bug 1714329 now.

Comment on attachment 9224868 [details]
erease icons.png

Just realised, libreoffice and microsoft (https://support.microsoft.com/en-us/office/clear-all-text-formatting-c094c4da-7f09-4cea-9a8d-c166949c9c80#OfficeVersion=Windows) both use the letter A with a rubber/eraser as their icons for this. So the third icon works well in that respect.

Google uses an icon similar to the first T icon, except it uses a single slash over the T. But I feel like the google one ends up looking like an X or a chi.

Attached image remove-text-styling.svg

Here's the SVG for the 3rd icon, the A with the eraser.
I like that one a lot as indeed the other 2 kinda look like Tx and they might be a bit confusing.
Pinging Richard to check if it's properly pixel hinted and if it needs optimization.

Attachment #9225107 - Flags: feedback?(richard.marti)
Attachment #9225107 - Flags: feedback?(mkmelin+mozilla)
Attachment #9225107 - Flags: feedback?(henry)
Status: NEW → ASSIGNED

Comment on attachment 9225107 [details]
remove-text-styling.svg

Looks good, but I think the "A" is too small compared to the other icons. I'll attach your icon with the file size optimization.

Attachment #9225107 - Flags: feedback?(richard.marti)
Attached image comparison.png

Comparison of the three icons. On top the one from Alessandro which isn't aligned with the other icons and too small. In the middle my icon with the thin eraser (my favourite). On bottom with fat eraser which could be the best for uneven scaling. But the scaling couldn't be so bad as the eraser is turned 45°.

Attachment #9225163 - Flags: feedback?(alessandro)
Attachment #9224724 - Attachment description: Bug 1667372 - Add a "Remove Styling" button to the message composer. r=mkmelin → Bug 1667372 - Add a "Remove Text Styling" button to the message composer. r=mkmelin

I wanted to give more importance to the eraser but without using a 2px thick line, that's why the A is smaller.
I don't mind v2 (the example in the middle) but I'd propose to see if it's possible to make the A a tiny bit smaller and the eraser a bit more prominent without affecting sharpness.
What do you think?

Attachment #9225163 - Flags: feedback?(alessandro) → feedback+

Comment on attachment 9225107 [details]
remove-text-styling.svg

I like this and it looks good in place.

Attachment #9225107 - Flags: feedback?(henry)

Comment on attachment 9225163 [details]
comparison.png

The button will go at the end of the list, so the size of the A can be compared to the underline size. I'll attach what it looks like now.

This is aleca's proposal with the eraser moved down. How about this?

Comment on attachment 9225255 [details]
remove-text-styling.svg eraser moved down

I like this.
Let's go with this one.

Attachment #9225255 - Flags: review+

I also think the updated one looks better in the toolbar.

Attachment #9225251 - Attachment is obsolete: true
Attachment #9225107 - Flags: feedback?(mkmelin+mozilla) → feedback+
Attachment #9224724 - Attachment description: Bug 1667372 - Add a "Remove Text Styling" button to the message composer. r=mkmelin → WIP: Bug 1667372 - Add a "Remove Text Styling" button to the message composer. r=mkmelin
Attachment #9224724 - Attachment description: WIP: Bug 1667372 - Add a "Remove Text Styling" button to the message composer. r=mkmelin → Bug 1667372 - Add a "Remove Text Styling" button to the message composer. r=mkmelin

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/bb94a54a2af5
Add a "Remove Text Styling" button to the message composer. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED

Looks like we should disable these tests until they work without failures (repro locally but only with --verify):

  • comm/mail/test/browser/composition/browser_font_size.js
  • comm/mail/test/browser/composition/browser_remove_text_styling.js
  • comm/mail/test/browser/composition/browser_text_styling.js
Target Milestone: --- → 91 Branch
Blocks: 1720174
Pushed by mkmelin@iki.fi: https://hg.mozilla.org/comm-central/rev/d54dd0929463 disable clear styling related tests that are not yet reliable. rs=me DONTBUILD
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: