Page MenuHomePhabricator

[web] Replace `ColorPicker` with `ColorSelector` in `ThreadSettingsModal`
ClosedPublic

Authored by atul on Apr 11 2022, 11:53 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 5, 8:58 PM
Unknown Object (File)
Tue, Nov 5, 11:25 AM
Unknown Object (File)
Tue, Nov 5, 11:25 AM
Unknown Object (File)
Tue, Nov 5, 11:24 AM
Unknown Object (File)
Tue, Oct 29, 5:31 AM
Unknown Object (File)
Oct 14 2024, 1:35 AM
Unknown Object (File)
Oct 14 2024, 1:35 AM
Unknown Object (File)
Oct 14 2024, 1:35 AM

Details

Summary

We're ready to swap out ColorPicker with ColorSelector.

Leaving ColorPicker in the codebase for now even though it's not being used anywhere... will remove it in a bit.


Depends on D3697

Test Plan

Looks and works as expected:

Diff Detail

Repository
rCOMM Comm
Branch
landapril12 (branched from master)
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

web/modals/threads/color-selector-button.react.js
16 ↗(On Diff #11312)

This is a hack for now. We were previously just comparing strings, but the currentThreadColor we get from the server is lowercase whereas the colors we specified in ColorSelector are capitalized.

Next diffs:

  1. Add tinycolor2 to web/package.json (same version as in lib/native of course)
  2. Use tinycolor2.equals(a, b) to compare the two colors. This is a little less flaky than .toLowerCase() since it also accounts for the # prefix being included/excluded/etc.
atul requested review of this revision.Apr 11 2022, 12:00 PM

Looking at the video it feels like it would be better if hover and selected states of color button were different. Now for me it feels a bit laggy - maybe because the previous selection has longer animation duration. What do you think? (we can also keep the current solution, because it doesn't matter that much and will take some time to fix)

This revision is now accepted and ready to land.Apr 12 2022, 3:30 AM

Now for me it feels a bit laggy - maybe because the previous selection has longer animation duration. What do you think?

Yeah I agree, it looked okay when it was just the hover state that had the transition, but now on selection it makes the app look unresponsive.

I'll put up a diff either

A. removing the transition altogether
B. removing the "fade out" transition when a color is "unselected"

depending on how each looks after some experimentation