Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Filters] consolidate se23 logic and styles #10178

Merged
merged 2 commits into from
Aug 24, 2023
Merged

[Filters] consolidate se23 logic and styles #10178

merged 2 commits into from
Aug 24, 2023

Conversation

gwyneplaine
Copy link
Contributor

@gwyneplaine gwyneplaine commented Aug 23, 2023

WHY are these changes introduced?

Fixes #9934

WHAT is this pull request doing?

  • consolidate se23 logic
  • consolidate se23 styles

How to 🎩

🎩 checklist

background: var(--p-color-bg-subdued);

#{$se23} & {
background: var(--p-color-bg-secondary-experimental);
Copy link
Contributor Author

@gwyneplaine gwyneplaine Aug 23, 2023

Choose a reason for hiding this comment

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

Looks like a remnant from the subdued > secondary token migration.
On one hand, I think the intention here is to apply secondary-experimental instead of subdued.
On the other hand, the active background color is noticeably different to the default background color feels good (even if it is a bug)

Not a designer though, so defering to @sarahill or @bernardojoaogarcia to weigh in here.

Choose a reason for hiding this comment

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

Wrong Bernardo, I also don't have the required skills to assess this properly. 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry about that @bernardoamc, not sure how you got tagged instead 🙏

@gwyneplaine
Copy link
Contributor Author

gwyneplaine commented Aug 23, 2023

This UI test change appears to be another case of $se23 styles (unintentionally) taking precedence over relevant non se23 styles.

In this case disabled background and border styles were being overridden by base $se23 background and border styles.

Prod styles:
Screenshot 2023-08-23 at 2 55 51 pm

PR styles:
Screenshot 2023-08-23 at 2 56 00 pm

I'm unclear as to whether or not this is intentional though (or desired), deferring to designers again 🙏 @bernardojoaogarcia @sarahill

Copy link
Contributor

@sophschneider sophschneider left a comment

Choose a reason for hiding this comment

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

I think the prod states of the "Add filter" button are messed up, according to Figma the default state is supposed to be white

Screenshot 2023-08-23 at 11 35 15 AM

Also I think the old disabled "Add filter" state with the dotted line is correct

Made a small comment about the "Clear all" button spacing changing

@@ -247,32 +227,22 @@
}

.ClearAll {
Copy link
Contributor

Choose a reason for hiding this comment

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

For some reason, there is a difference in spacing for the clear all button in this PR vs. prod. See the IndexTable with filtering story

Before After
Screenshot 2023-08-23 at 11 21 02 AM Screenshot 2023-08-23 at 11 21 10 AM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sophschneider this looks to be a result of this change to button variants. I've changed this to monochromePlain which should be the variant value equivalent of the previous configuration plain and monochrome

@sarahill
Copy link
Contributor

sarahill commented Aug 23, 2023

I would defer to Figma for the accurate design. There wasn't a disabled state in there so I added that for reference. https://www.figma.com/file/jLLkmo9r28hiqPvf4s90E4/Polaris-Gen-3-Components-%5Balpha%5D?type=design&node-id=68605-33198&mode=design&t=0nWQL7LChp2Emwu6-4

Uploading image.png…

@gwyneplaine gwyneplaine force-pushed the v12/9934 branch 2 times, most recently from 370669a to 3278bde Compare August 24, 2023 05:51
@@ -414,7 +393,7 @@ export function Filters({
size="micro"
onClick={handleClearAllFilters}
removeUnderline
variant="tertiary"
variant="monochromePlain"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously this was monoChrome=true and plain=true, the equivalent variant value should be monochromePlain not tertiary.

background: var(--p-color-bg-subdued);
border-radius: var(--p-border-radius-6);
border: var(--p-color-border-subdued) dashed var(--p-border-width-1);
background: var(--p-color-bg);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

change this to color-bg token instead to match Figma

border-color: var(--p-color-border-hover);
}

&[aria-disabled='true'] {
background: var(--p-color-bg-disabled);
border-color: var(--p-color-border-disabled);
background: var(--p-color-bg-transparent-disabled-experimental);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to match Figma

&.disabledFilterButton {
background: var(--p-color-bg-disabled);
background: var(--p-color-bg-transparent-disabled-experimental);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to match Figma.

But also, will remove these entirely in a subsequent PR, since disabled FilterPills are no longer rendered

background: var(--p-color-bg-disabled);
border-color: var(--p-color-border-disabled);
background: var(--p-color-bg-transparent-disabled-experimental);
border-color: transparent;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No border in Figma, setting to transparent to avoid layout shift.

Copy link
Contributor

@sophschneider sophschneider left a comment

Choose a reason for hiding this comment

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

It looks a lot better, thanks for fixing this!!

I noticed a few more discrepancies between figma and the current state but since that isn't related to consolidating the se23 logic I tracked the discrepancies in a separate issue that we can address in a follow up PR!

Copy link
Contributor

@sarahill sarahill left a comment

Choose a reason for hiding this comment

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

@gwyneplaine gwyneplaine merged commit 2c718dc into next Aug 24, 2023
16 checks passed
@gwyneplaine gwyneplaine deleted the v12/9934 branch August 24, 2023 23:57
sam-b-rose added a commit that referenced this pull request Aug 25, 2023
* next: (87 commits)
  [ButtonGroup] Removed `segmented` boolean prop and replaced with `variant` (#9997)
  [LegacyTabs] Consolidate se23 styles and logic (#10231)
  [v12] Update changesets (#10232)
  [LegacyFilters] Consolidate se23 styles and logic (#10217)
  [Banner] Change status prop to tone (#10206)
  Replace icon highlight color in box stories (#10226)
  [TopBar] Consolidate se23 styles and logic (#10221)
  [Filters] consolidate se23 logic and styles (#10178)
  [Icon] Update props (#10220)
  [ButtonGroup] Update variant plain prop name (#10222)
  [Button] Remove connectedDisclosure (#10182)
  [LegacyCard] Consolidate se23 styles and logic (#10207)
  [Navigation] Consolidate se23 logic and styles (#10213)
  [Frame][ContextualSaveBar] Consolidate se23 styles and logic (#10196)
  [OptionList] consolidate se23 styles and logic  (#10177)
  [Page] Consolidate se23 styles and logic (#10187)
  [DataTable] Consolidate conditional logic (#10169)
  [Thumbnail] Consolidate conditional logic (#10171)
  [ResourceItem] Consolidate conditional logic (#10172)
  [FullscreenBar] Consolidate conditional logic (#10173)
  ...
sam-b-rose added a commit that referenced this pull request Aug 25, 2023
* next: (87 commits)
  [ButtonGroup] Removed `segmented` boolean prop and replaced with `variant` (#9997)
  [LegacyTabs] Consolidate se23 styles and logic (#10231)
  [v12] Update changesets (#10232)
  [LegacyFilters] Consolidate se23 styles and logic (#10217)
  [Banner] Change status prop to tone (#10206)
  Replace icon highlight color in box stories (#10226)
  [TopBar] Consolidate se23 styles and logic (#10221)
  [Filters] consolidate se23 logic and styles (#10178)
  [Icon] Update props (#10220)
  [ButtonGroup] Update variant plain prop name (#10222)
  [Button] Remove connectedDisclosure (#10182)
  [LegacyCard] Consolidate se23 styles and logic (#10207)
  [Navigation] Consolidate se23 logic and styles (#10213)
  [Frame][ContextualSaveBar] Consolidate se23 styles and logic (#10196)
  [OptionList] consolidate se23 styles and logic  (#10177)
  [Page] Consolidate se23 styles and logic (#10187)
  [DataTable] Consolidate conditional logic (#10169)
  [Thumbnail] Consolidate conditional logic (#10171)
  [ResourceItem] Consolidate conditional logic (#10172)
  [FullscreenBar] Consolidate conditional logic (#10173)
  ...
sophschneider pushed a commit that referenced this pull request Sep 19, 2023
<!--
  ☝️How to write a good PR title:
- Prefix it with [ComponentName] (if applicable), for example: [Button]
  - Start with a verb, for example: Add, Delete, Improve, Fix…
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

Fixes #9934

<!--
  Context about the problem that’s being addressed.
-->

- consolidate se23 logic
- consolidate se23 styles

-
[Storybook](https://5d559397bae39100201eedc1-avqvvftkub.chromatic.com/?path=/story/all-components-filters--with-a-resource-list)
- [Prod
storybook](https://storybook.polaris.shopify.com/?path=/story/all-components-filters--with-a-resource-list&globals=polarisSummerEditions2023:true)

- [x] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [ ] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
AnnaCheba pushed a commit to AnnaCheba/polaris that referenced this pull request Apr 22, 2024
<!--
  ☝️How to write a good PR title:
- Prefix it with [ComponentName] (if applicable), for example: [Button]
  - Start with a verb, for example: Add, Delete, Improve, Fix…
  - Give as much context as necessary and as little as possible
  - Prefix it with [WIP] while it’s a work in progress
-->

### WHY are these changes introduced?

Fixes Shopify#9934

<!--
  Context about the problem that’s being addressed.
-->

### WHAT is this pull request doing?

- consolidate se23 logic
- consolidate se23 styles

### How to 🎩

-
[Storybook](https://5d559397bae39100201eedc1-avqvvftkub.chromatic.com/?path=/story/all-components-filters--with-a-resource-list)
- [Prod
storybook](https://storybook.polaris.shopify.com/?path=/story/all-components-filters--with-a-resource-list&globals=polarisSummerEditions2023:true)

### 🎩 checklist

- [x] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [ ] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [ ] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants