Page MenuHomePhabricator

[web] Pass `optionSelected` from `EnumSettingsOption` to `EnumSettingsOptionInfo`
ClosedPublic

Authored by atul on May 15 2022, 1:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 19, 2:14 PM
Unknown Object (File)
Thu, Nov 14, 10:21 AM
Unknown Object (File)
Thu, Nov 14, 10:21 AM
Unknown Object (File)
Sat, Nov 9, 8:09 AM
Unknown Object (File)
Oct 26 2024, 3:15 PM
Unknown Object (File)
Oct 25 2024, 3:43 AM
Unknown Object (File)
Oct 23 2024, 4:15 PM
Unknown Object (File)
Oct 23 2024, 4:15 PM

Details

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:

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.May 15 2022, 1:02 PM
atul edited the summary of this revision. (Show Details)
atul edited the test plan for this revision. (Show Details)
atul edited the summary of this revision. (Show Details)
atul edited the test plan for this revision. (Show Details)
atul edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.May 17 2022, 6:57 AM

rebase after resolving merge conflicts and before landing