HomePhabricator
Diffusion Comm 17c2ec161119

[web] Pass `optionSelected` from `EnumSettingsOption` to…

Tags
None
Referenced Files
F56436: Screen Recording 2022-05-15 at 3.49.56 PM.mov
May 19 2022, 8:58 AM
F56438: Screen Recording 2022-05-15 at 4.03.33 PM.mov
May 19 2022, 8:58 AM
F56435: Screen Recording 2022-05-15 at 2.06.53 PM.mov
May 19 2022, 8:58 AM
Subscribers
None

Description

[web] Pass optionSelected from EnumSettingsOption to EnumSettingsOptionInfo

Summary:
We want to know if an option is selected in EnumSettingsOptionInfo so we can style "invalid" statements accordingly.

Why do we need to style "invalid" statements accordingly?

Here's a video demonstrating what happens otherwise:

Basically, the color that the option is highlighted with matches the color of "invalid" statements. That means that when an option is selected, the "invalid" statements are pretty much invisible.

We were previously solving this problem with a CSS selector that looked like:

div.optionContainerSelected div.optionInfoInvalid {

However, that approach broke when I was splitting the styles into separate files. It's a little brittle and depends on a particular nesting of divs that are a side effect of an option being selected.

Instead, with the current approach we directly check whether an option is selected and style "invalid" statements based on that accordingly.

Here's a demonstration with the "selected" color set to red for illustration purposes:


Depends on D4049

Test Plan:
Things work/look as expected:

Reviewers: def-au1t, palys-swm, benschac

Reviewed By: palys-swm

Subscribers: ashoat, Adrian, yayabosh

Differential Revision: https://phabricator.ashoat.com/D4050

Details