Page MenuHomePhabricator

[web] Use Button for text buttons
ClosedPublic

Authored by michal on Oct 10 2022, 2:49 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 4:49 PM
Unknown Object (File)
Thu, Nov 14, 4:49 PM
Unknown Object (File)
Thu, Nov 14, 4:49 PM
Unknown Object (File)
Thu, Nov 14, 4:49 PM
Unknown Object (File)
Thu, Nov 14, 4:49 PM
Unknown Object (File)
Thu, Nov 14, 4:49 PM
Unknown Object (File)
Thu, Nov 14, 4:49 PM
Unknown Object (File)
Thu, Nov 14, 4:35 PM
Subscribers

Details

Summary

Part of ENG-843
Adds a new 'text' variant to Button and uses it instead of plain html elements in:

  • settings screen
  • retry send button
  • user list in thread composer

to keep the web app more consistent.

This diff also fixes visual bugs with retry message:
Before:

image.png (124×322 px, 13 KB)

After:

image.png (130×502 px, 15 KB)

Test Plan

Check if

  • settings screen
  • retry send button
  • user list in thread composer

look and work correctly.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Accepting with questions inline

web/chat/chat-message-list.css
157 ↗(On Diff #17434)

Can you provide some context on this change?

web/chat/failed-send.react.js
94 ↗(On Diff #17434)

css.retryButtonText applies text-transform: uppercase

Instead of doing that in CSS can we do it here? Just change Retry? to RETRY?

This revision is now accepted and ready to land.Oct 10 2022, 9:54 AM

(At a high level, would be good to provide a bit more context in the Description section to make things a bit easier for reviewers.)

There's a css block:

div.failedSend {
  text-transform: uppercase;
  (...)
}

that previously applied to the "Retry?", but now that we use Button it had to be copied to retryButtonText. So I just kept the old behaviour, but I don't see any reason why we couldn't just use RETRY? (and <span>DELIVERY FAILED.</span>).

michal edited the summary of this revision. (Show Details)

Removed the text-transform: uppercase. Fixed a bug with buttons in thread composer and this resulted in a slight change in visuals (see the updated summary). But that could be easily changed if it's undesirable.

This revision is now accepted and ready to land.Oct 11 2022, 5:58 AM
michal edited the summary of this revision. (Show Details)
michal edited the test plan for this revision. (Show Details)

Is text-transform: uppercase better for accessibility than just making the text all-caps? I'm not sure if it is, but I think that was the main reason for doing that

According to this article it's better for screen-readers (and it's better for a few other reasons but I don't think they are applicable to our example). I think we should change it back to text-transform.

Sounds good, thanks for explaining + linking to the article.

This revision is now accepted and ready to land.Oct 11 2022, 7:31 AM

Looks good, I would just address the text-transform: uppercase comments before landing

Added text-transform: uppercase back. This update also fixes two bugs that introduce changes to visuals so I'm requesting a review again.

  • the RETRY? button didn't change color depending on chat color (I didn't notice it before because I was testing on a blue chat)
  • The DELIVERY FAILED text was black so it wasn't visible. I wanted to create a task for this later, but while adding text-transform back I think it made sense to do this here instead of a one-line change later.

Please see the summary for images.

michal edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Oct 12 2022, 9:47 AM

Update. After changes to :hover behaviour in the newest revision of the previous diff, there are no longer visual changes in the thread composer.

Fix small issue with RETRY? button.

This revision was landed with ongoing or failed builds.Oct 20 2022, 8:55 AM
This revision was automatically updated to reflect the committed changes.