Skip to content

fix(#2949): TableView/ListView/DnD Windows High Contrast issues#3827

Merged
reidbarber merged 36 commits into
mainfrom
table-whcm
Jan 31, 2023
Merged

fix(#2949): TableView/ListView/DnD Windows High Contrast issues#3827
reidbarber merged 36 commits into
mainfrom
table-whcm

Conversation

@majornista
Copy link
Copy Markdown
Collaborator

@majornista majornista commented Dec 8, 2022

Relates to #2949

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue 2949.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

  1. Using Google Chrome or Microsoft Edge, open https://reactspectrum.blob.core.windows.net/reactspectrum/5d6f3c03ccdf2462277f32e53624cceea767e751/storybook/iframe.html?providerSwitcher-express=false&providerSwitcher-toastPosition=bottom&strict=false&providerSwitcher-locale=&providerSwitcher-theme=&providerSwitcher-scale=&args=&id=tableview--allowsresizing-uncontrolled-sortable-columns&viewMode=story
  2. Open Developer Tools, and enable forced-colors: active emulation under the Customize and control DevTools menu button (looks like "⋮" in the upper right corner of DevTools panel toolbar) > More tools... > Rendering > Emulate CSS media feature forced-colors > forced-colors: active
  3. Use keyboard to navigate rows and cells in the TableView. Confirm that a visual indication of focus is present in forced-colors mode.
  4. Select one or more rows. Confirm that it is possible to distinguish between selected and unselected rows, as well as the focused state of selected rows.
  5. Resize columns to verify that the resize column indicator is visible

Screen capture of TableView in forced-color: active mode that demonstrates several rows selected with one of the selected rows focused

Screen capture of TableView in forced-color: active mode that shows the Nubbin for resizing the column width of the first column

Also test ListView stories, including drag and drop: https://reactspectrum.blob.core.windows.net/reactspectrum/e23100ba3eff9c6206f91b525d06f5620eedb5d4/storybook/index.html?path=/story/listview--default&providerSwitcher-express=false&providerSwitcher-toastPosition=bottom

And Drag and Drop stories:
https://reactspectrum.blob.core.windows.net/reactspectrum/5d6f3c03ccdf2462277f32e53624cceea767e751/storybook/index.html?path=/story/drag-and-drop--default&providerSwitcher-express=false&providerSwitcher-toastPosition=bottom

Checkbox WHCM story:
https://reactspectrum.blob.core.windows.net/reactspectrum/5d6f3c03ccdf2462277f32e53624cceea767e751/storybook/index.html?path=/story/checkbox--whcm&providerSwitcher-express=false&providerSwitcher-toastPosition=bottom

Switch WHCM story:
https://reactspectrum.blob.core.windows.net/reactspectrum/5d6f3c03ccdf2462277f32e53624cceea767e751/storybook/index.html?path=/story/switch--whcm-test&providerSwitcher-express=false&providerSwitcher-toastPosition=bottom

🧢 Your Project:

Adobe/Accessibility

@majornista majornista requested review from devongovett, jnurthen and snowystinger and removed request for devongovett, jnurthen and snowystinger December 9, 2022 15:06
@majornista majornista changed the title fix(#2949): TableView Windows High Contrast issues fix(#2949): TableView/ListView Windows High Contrast issues Dec 12, 2022
@majornista majornista changed the title fix(#2949): TableView/ListView Windows High Contrast issues fix(#2949): TableView/ListView/DnD Windows High Contrast issues Dec 13, 2022
Copy link
Copy Markdown
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a glance, we're going to need to set variables for these to cut down on the size of the changes
See what I did to the resizer changes

@majornista
Copy link
Copy Markdown
Collaborator Author

From a glance, we're going to need to set variables for these to cut down on the size of the changes See what I did to the resizer changes

I wonder if the CSS-specificity hack might work to fix things like .spectrum-Checkbox, which has variables defined that are not getting consistently applied.

@snowystinger
Copy link
Copy Markdown
Member

Can you say more about "not consistently getting applied"?

@majornista
Copy link
Copy Markdown
Collaborator Author

majornista commented Dec 15, 2022

Can you say more about "not consistently getting applied"?

The updates to Checkbox come from me noticing that in forced-colors: active mode the Spectrum color was still being used for the border/background style of checkboxes, rather than the system color overrides:

forced-color-adjust: none;
--spectrum-checkbox-box-border-color: ButtonText;
--spectrum-checkbox-box-border-color-error: Highlight;
--spectrum-checkbox-box-border-color-error-down: Highlight;
--spectrum-checkbox-box-border-color-error-hover: Highlight;
--spectrum-checkbox-box-border-color-key-focus: Highlight;
--spectrum-checkbox-checkmark-color: HighlightText;
--spectrum-checkbox-emphasized-box-background-color: ButtonFace;
--spectrum-checkbox-emphasized-box-background-color-disabled: ButtonFace;
--spectrum-checkbox-emphasized-box-border-color: ButtonText;
--spectrum-checkbox-emphasized-box-border-color-disabled: GrayText;
--spectrum-checkbox-emphasized-box-border-color-down: Highlight;
--spectrum-checkbox-emphasized-box-border-color-hover: Highlight;
--spectrum-checkbox-emphasized-box-border-color-selected: Highlight;
--spectrum-checkbox-emphasized-box-border-color-selected-down: Highlight;
--spectrum-checkbox-emphasized-box-border-color-selected-hover: Highlight;
--spectrum-checkbox-emphasized-box-border-color-selected-key-focus: Highlight;
--spectrum-checkbox-emphasized-text-color: FieldText;
--spectrum-checkbox-emphasized-text-color-down: FieldText;
--spectrum-checkbox-emphasized-text-color-hover: FieldText;
--spectrum-checkbox-emphasized-text-color-key-focus: FieldText;
--spectrum-checkbox-focus-ring-color-key-focus: ButtonText;
--spectrum-checkbox-quiet-box-border-color-selected: Highlight;
--spectrum-checkbox-quiet-box-border-color-selected-down: Highlight;
--spectrum-checkbox-quiet-box-border-color-selected-hover: Highlight;
--spectrum-checkbox-text-color: FieldText;
--spectrum-checkbox-text-color-disabled: GrayText;
--spectrum-checkbox-text-color-error: FieldText;
--spectrum-checkbox-text-color-error-down: FieldText;
--spectrum-checkbox-text-color-error-hover: FieldText;

Here's a screen shot showing the colors that are not being overridden, the default checked and indeterminate states, and the unchecked read-only state:

Screen shot showing all Spectrum checkbox styles and states in forced-colors mode.

@majornista
Copy link
Copy Markdown
Collaborator Author

@snowystinger and @devongovett WHCM for Checkbox breaks with this: 9d21a67#diff-33c2361c79a3779c4950c8d95cd3af4b4e3a6ad989803452330f0337ffa64d97. The color styles defined in the index.css are taking precedence over the styles defined in the skin.css.

@rspbot

This comment was marked as outdated.

@rspbot
Copy link
Copy Markdown

rspbot commented Jan 30, 2023

Copy link
Copy Markdown
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran chromatic, looks like the selection border changed a little bit https://www.chromatic.com/test?appId=5f0dd5ad2b5fc10022a2e320&id=63d7fc08564648dc28ef74e4
I'm looking into the why of it right now.

Looks like the dropshadow ::after is now --spectrum-table-row-border-color-selected <=== var(--spectrum-legacy-color-blue-500,var(--spectrum-global-color-blue-500))

and it used to be --spectrum-global-color-blue-500
I'm not sure why the legacy one is the lead choice and not the fallback, I see you followed some other examples. @devongovett maybe I'm just not understanding xvar, but shouldn't these all be switched?

Edit: I see why the legacy was preferred there, see description of #3857

Copy link
Copy Markdown
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got some additional info regarding xvar
it is also used to not collapse variables, much like we have done by placing the variable declarations in the component's top level class.
I'm not sure we should move to using xvar, but just providing some more context

@rspbot
Copy link
Copy Markdown

rspbot commented Jan 30, 2023

@rspbot
Copy link
Copy Markdown

rspbot commented Jan 30, 2023

@rspbot
Copy link
Copy Markdown

rspbot commented Jan 30, 2023

@majornista majornista requested a review from reidbarber January 30, 2023 22:59
@rspbot
Copy link
Copy Markdown

rspbot commented Jan 30, 2023

Copy link
Copy Markdown
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rspbot
Copy link
Copy Markdown

rspbot commented Jan 31, 2023

@rspbot
Copy link
Copy Markdown

rspbot commented Jan 31, 2023

## API Changes

unknown top level export { type: 'identifier', name: 'Column' }
unknown top level export { type: 'identifier', name: 'Column' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }
unknown type { type: 'link' }

@snowystinger
Copy link
Copy Markdown
Member

Seems like it's hanging, going to close and reopen

@snowystinger
Copy link
Copy Markdown
Member

One more try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants