Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rich Text: Remove overridden underline format #94244

Merged
merged 1 commit into from
Sep 10, 2024

Conversation

ntsekouras
Copy link
Member

@ntsekouras ntsekouras commented Sep 5, 2024

Resolves: #94243
Resolves: #71631

From the issue:

Currently the underline format is overridden from core in order to add an option in block's toolbar formats dropdown.

In core this button (alongside with the justify one) were removed years ago. TLDR;

Underline - It introduces a potentially bad user experience issue: readers confusing the underline text with a link. Underlined text is broadly interpreted as web links.

Additionally, right now is buggy, because it doesn't handle the shortcuts for it (Command + U).

This PR removes the overridden format and aligns with core.

Steps to reproduce

  1. Open the post editor and insert some text in a paragraph
  2. Open the formats dropdown in the block's toolbar
  3. Observe the Underline format is not rendered
  4. Use the shortcut Command+U (Mac) or Ctrl+U (Windows)
  5. The text should be underlined and the format active
Before After
Screenshot 2024-09-05 at 3 51 52 PM Screenshot 2024-09-05 at 4 47 19 PM

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@ntsekouras ntsekouras added [Type] Bug When a feature is broken and / or not performing as intended [Feature] Post/Page Editor The editor for editing posts and pages. [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Sep 5, 2024
@ntsekouras ntsekouras self-assigned this Sep 5, 2024
@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug remove/underline-format-override on your sandbox.

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@Copons
Copy link
Contributor

Copons commented Sep 5, 2024

👋 Hi @ntsekouras!

IMHO, we should not remove the Underline button, but we might want to fix the missing shortcut instead, or even just remove the mention from our docs (since ⌘+U is not supported everywhere like, for example, ⌘+B). 🤔

There was a long discussion many years ago about the Underline and Justify formats (p7jreA-2em-p2#comment-1853), and the long story short, as far as I can remember, was:

  • Dotcom classic editor used to support them even after they were removed from Core.
  • Users used them consistently.
  • Once Gutenberg replaced the Dotcom classic editor, they disappeared.
  • HEs received a significant amount of requests about them.
  • We decided to add them back to make the Dotcom experience consistent and seamless.

Now, we all agree that they are poor web design choices. I believe Core shouldn't encourage poor web design choices, so it makes perfect sense to remove them from Core.

However, Dotcom is a third-party consumer of Core. If our users want to Underline, we should give them the functionality.

Let me know what you think! 🙂

@ntsekouras
Copy link
Member Author

ntsekouras commented Sep 5, 2024

Thanks for sharing the context!

These discussions seem to have happened around 5 and half years ago. Do you think it's something still needed and widely used? Is there some kind of metric for its usage (although I wouldn't expect one to exist)?

Could it be an opportunity to revisit the underline and even the justify or uppercase formats?

Actually I have already opened a PR to add the shortcut, but ideally we should align with core.

@Copons
Copy link
Contributor

Copons commented Sep 5, 2024

These discussions seem to have happened around 5 and half years ago. Do you think it's something still needed and widely used? Is there some kind of metric for its usage (although I wouldn't expect one to exist)?

Yeah, it all happened around when Core removed those formats.
Unfortunately, we don't record toolbar clicks.

Back then, we only noticed the problem thanks to HEs telling us.
I guess we could give HEs a quick heads-up, tentatively remove the format, see what happens, and revert if folks have really strong opinions about it.

My only concern (fairly minor, to be honest) is that users who underlined their content won't be able to de-underline it anymore without modifying the code.

@ntsekouras
Copy link
Member Author

My only concern (fairly minor, to be honest) is that users who underlined their content won't be able to de-underline it anymore without modifying the code.

That's a valid concern, yes. There will be the shortcut, but they won't probably know about it, since it wasn't working before.. I'd also agree that it doesn't seem very likely, but you never know :)

I guess we could give HEs a quick heads-up, tentatively remove the format, see what happens, and revert if folks have really strong opinions about it.

This sounds like a good plan to me. It shouldn't be that impactful, and if it turns out to be, it's an easy one to revert. I'd leave the decision to you though or if you want to ping more people about it.

Copy link
Contributor

@Copons Copons left a comment

Choose a reason for hiding this comment

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

Works as advertised!

@ntsekouras, as discussed separately, please give a heads-up to Dotcom HEs about this change. It might not cause any problem, but in the off-chance, they should know who to contact and that it's easily reversible if needed. 🙂

@ntsekouras ntsekouras force-pushed the remove/underline-format-override branch from f728067 to 8259c1b Compare September 10, 2024 13:11
@ntsekouras ntsekouras merged commit 9069081 into trunk Sep 10, 2024
11 checks passed
@ntsekouras ntsekouras deleted the remove/underline-format-override branch September 10, 2024 13:28
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 10, 2024
@ntsekouras
Copy link
Member Author

Deployed r303912-wpcom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Post/Page Editor The editor for editing posts and pages. [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
3 participants