Page MenuHomePhabricator

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

Authored by atul on Apr 11 2022, 11:53 AM.
Tags
None
Referenced Files
F2905178: D3699.id11362.diff
Sun, Oct 6, 3:44 AM
F2902244: D3699.id11312.diff
Sat, Oct 5, 4:37 PM
Unknown Object (File)
Thu, Oct 3, 2:07 PM
Unknown Object (File)
Tue, Sep 17, 12:32 AM
Unknown Object (File)
Sep 3 2024, 4:45 PM
Unknown Object (File)
Sep 3 2024, 4:45 PM
Unknown Object (File)
Sep 3 2024, 4:45 PM
Unknown Object (File)
Sep 3 2024, 4:44 PM

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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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