Skip to content

Conversation

@mrcthms
Copy link
Contributor

@mrcthms mrcthms commented Sep 28, 2022

WHY are these changes introduced?

Fixes https://github.com/Shopify/web/issues/74192

Spin link in situ: https://admin.web.discounts-update-save-as.marc-thomas.eu.spin.dev/store/shop1/orders?inContextTimeframe=none

WHAT is this pull request doing?

Before

Screenshot 2022-09-28 at 11 42 54

Screenshot 2022-09-28 at 11 42 28

After

Screenshot 2022-09-28 at 11 42 39

Screenshot 2022-09-28 at 11 42 43

Screenshot 2022-09-28 at 11 43 00

Screenshot 2022-09-28 at 11 43 03

This PR updates the BulkActions component, used on the IndexTable and ResourceList components, as well as moving some functionality from BulkActions into the new SelectAllActions component. This is to support the Unified Index Filtering and Search project.

This PR introduces a new UX pattern for the BulkActions component. It has been separated from the Select X actions – which is now the SelectAllActions component, and the BulkActions component gets rendered afterward in the DOM.

Components that consume the BulkActions use the new useIsBulkActionSticky hook to determine whether the BulkActions component should be position: fixed or position: absolute with a calculated top position. We have had to do this rather than use a regular position: sticky on the BulkActions element, as the keyboard focus order needs to be logically preserved, and moving the BulkActions component under the table/resource list HTML in the DOM would provide a bad experience for users navigating via keyboard.

The IndexTable and ResourceList components have been updated with this new component.

The CheckableButton component has been simplified, as a lot of the logic required in the existing implementation is no longer needed.

As part of this work, small-screen BulkActions and SelectAllActions support has been removed, as we are removing bulk action and select functionality for small screens, as an intentional decision as part of the Unified Index Filtering and Search project.

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

Copy-paste this code in playground/Playground.tsx:
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}

🎩 checklist

@mrcthms mrcthms force-pushed the mrcthms-bulk-actions branch from 89aafb3 to 16d5d31 Compare September 28, 2022 13:17
@github-actions
Copy link
Contributor

github-actions bot commented Sep 28, 2022

size-limit report 📦

Path Size
polaris-react-cjs 210.72 KB (+0.03% 🔺)
polaris-react-esm 136.15 KB (+0.09% 🔺)
polaris-react-esnext 191.98 KB (+0.1% 🔺)
polaris-react-css 42.12 KB (+0.14% 🔺)

@mrcthms mrcthms force-pushed the mrcthms-bulk-actions branch 2 times, most recently from 90f8831 to 05b6af4 Compare September 28, 2022 13:52
@mrcthms
Copy link
Contributor Author

mrcthms commented Sep 28, 2022

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @mrcthms! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/plugin-polaris@0.0.0-snapshot-release-20220928140906
yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20220928140906
yarn add @shopify/polaris@0.0.0-snapshot-release-20220928140906

@mrcthms mrcthms force-pushed the mrcthms-bulk-actions branch from 26537c9 to 944ef65 Compare October 4, 2022 19:04
@mrcthms
Copy link
Contributor Author

mrcthms commented Oct 4, 2022

/snapit

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2022

🫰✨ Thanks @mrcthms! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/plugin-polaris@0.0.0-snapshot-release-20221004191155
yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20221004191155
yarn add @shopify/polaris@0.0.0-snapshot-release-20221004191155

@mrcthms
Copy link
Contributor Author

mrcthms commented Oct 7, 2022

/snapit

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2022

🫰✨ Thanks @mrcthms! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/plugin-polaris@0.0.0-snapshot-release-20221007130147
yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20221007130147
yarn add @shopify/polaris@0.0.0-snapshot-release-20221007130147

@mrcthms
Copy link
Contributor Author

mrcthms commented Oct 7, 2022

/snapit

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2022

🫰✨ Thanks @mrcthms! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/plugin-polaris@0.0.0-snapshot-release-20221007173538
yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20221007173538
yarn add @shopify/polaris@0.0.0-snapshot-release-20221007173538

@mrcthms mrcthms force-pushed the mrcthms-bulk-actions branch from 7a50af6 to 40325df Compare October 7, 2022 18:38
@mrcthms
Copy link
Contributor Author

mrcthms commented Oct 7, 2022

/snapit

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2022

🫰✨ Thanks @mrcthms! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/plugin-polaris@0.0.0-snapshot-release-20221007184240
yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20221007184240
yarn add @shopify/polaris@0.0.0-snapshot-release-20221007184240

@mrcthms
Copy link
Contributor Author

mrcthms commented Oct 12, 2022

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @mrcthms! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/plugin-polaris@0.0.0-snapshot-release-20221012112901
yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20221012112901
yarn add @shopify/polaris@0.0.0-snapshot-release-20221012112901

@mrcthms
Copy link
Contributor Author

mrcthms commented Oct 13, 2022

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @mrcthms! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/plugin-polaris@0.0.0-snapshot-release-20221013101019
yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20221013101019
yarn add @shopify/polaris@0.0.0-snapshot-release-20221013101019

@zakwarsame zakwarsame force-pushed the mrcthms-bulk-actions branch from a2f6988 to b2dce72 Compare October 19, 2022 16:42
@zakwarsame
Copy link
Contributor

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @zakwarsame! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/plugin-polaris@0.0.0-snapshot-release-20221026163019
yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20221026163019
yarn add @shopify/polaris@0.0.0-snapshot-release-20221026163019

@zakwarsame
Copy link
Contributor

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @zakwarsame! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/plugin-polaris@0.0.0-snapshot-release-20221026191651
yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20221026191651
yarn add @shopify/polaris@0.0.0-snapshot-release-20221026191651

@mrcthms mrcthms force-pushed the mrcthms-bulk-actions branch from 6224bd0 to 3abbbe7 Compare November 18, 2022 13:44
@mrcthms
Copy link
Contributor Author

mrcthms commented Nov 18, 2022

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @mrcthms! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/plugin-polaris@0.0.0-snapshot-release-20221118134718
yarn add @shopify/polaris-icons@0.0.0-snapshot-release-20221118134718
yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20221118134718
yarn add @shopify/polaris@0.0.0-snapshot-release-20221118134718

@mrcthms
Copy link
Contributor Author

mrcthms commented Nov 18, 2022

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @mrcthms! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/plugin-polaris@0.0.0-snapshot-release-20221118144805
yarn add @shopify/polaris-icons@0.0.0-snapshot-release-20221118144805
yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20221118144805
yarn add @shopify/polaris@0.0.0-snapshot-release-20221118144805

@mrcthms mrcthms force-pushed the mrcthms-bulk-actions branch from 6df66fc to 3e34ede Compare November 28, 2022 18:55
@mrcthms
Copy link
Contributor Author

mrcthms commented Nov 28, 2022

/snapit

@github-actions
Copy link
Contributor

🫰✨ Thanks @mrcthms! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

yarn add @shopify/plugin-polaris@0.0.0-snapshot-release-20221128185741
yarn add @shopify/polaris-icons@0.0.0-snapshot-release-20221128185741
yarn add @shopify/polaris-migrator@0.0.0-snapshot-release-20221128185741
yarn add @shopify/polaris@0.0.0-snapshot-release-20221128185741

gap: var(--p-space-025);
align-items: center;
justify-content: flex-start;
will-change: opacity, display;
Copy link
Member

Choose a reason for hiding this comment

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

display doesn't animate but safari is weird so I get why this might be needed but is it actually needed?

@mrcthms mrcthms merged commit 2b8904f into main Nov 30, 2022
@mrcthms mrcthms deleted the mrcthms-bulk-actions branch November 30, 2022 13:23
mrcthms added a commit that referenced this pull request Nov 30, 2022
mrcthms added a commit that referenced this pull request Nov 30, 2022
…#7811)

Reverts #7290

Reverting due to blocking a release of Polaris that needs to go out
ASAP.
laurkim pushed a commit that referenced this pull request Nov 30, 2022
### WHY are these changes introduced?

Fixes Shopify/web#74192

Spin link in situ:
https://admin.web.discounts-update-save-as.marc-thomas.eu.spin.dev/store/shop1/orders?inContextTimeframe=none

### WHAT is this pull request doing?

#### Before

<img width="2440" alt="Screenshot 2022-09-28 at 11 42 54"
src="https://user-images.githubusercontent.com/2562596/192759539-4fece161-5bef-44ed-961f-4a342f495c69.png">
<img width="2440" alt="Screenshot 2022-09-28 at 11 42 28"
src="https://user-images.githubusercontent.com/2562596/192759582-834b2d6a-f0e2-4d07-803f-4be435559495.png">

#### After

<img width="2440" alt="Screenshot 2022-09-28 at 11 42 39"
src="https://user-images.githubusercontent.com/2562596/192761041-9b38059f-3b80-4a8e-8261-633589098bb4.png">
<img width="2440" alt="Screenshot 2022-09-28 at 11 42 43"
src="https://user-images.githubusercontent.com/2562596/192761078-f7fe25e1-4181-49ab-8545-c6e923917d2c.png">
<img width="2440" alt="Screenshot 2022-09-28 at 11 43 00"
src="https://user-images.githubusercontent.com/2562596/192761112-bca384f4-ec7f-435c-80a7-b96f2ef7cbb8.png">
<img width="2440" alt="Screenshot 2022-09-28 at 11 43 03"
src="https://user-images.githubusercontent.com/2562596/192761145-e6feb191-0430-420c-a77f-9dac004a418a.png">

This PR updates the BulkActions component, used on the IndexTable and
ResourceList components, as well as moving some functionality from
BulkActions into the new SelectAllActions component. This is to support
the [Unified Index Filtering and
Search](https://minerva.shopifycloud.com/auth/minerva?request=2905eaf2-0cf1-493c-b6d3-82e6385d6352&rd=https://vault.shopify.io%2Fprojects%2F24858)
project.

This PR introduces a new UX pattern for the BulkActions component. It
has been separated from the `Select X` actions – which is now the
`SelectAllActions` component, and the `BulkActions` component gets
rendered afterward in the DOM.

Components that consume the BulkActions use the new
`useIsBulkActionSticky` hook to determine whether the BulkActions
component should be `position: fixed` or `position: absolute` with a
calculated top position. We have had to do this rather than use a
regular `position: sticky` on the BulkActions element, as the keyboard
focus order needs to be logically preserved, and moving the BulkActions
component under the table/resource list HTML in the DOM would provide a
bad experience for users navigating via keyboard.

The IndexTable and ResourceList components have been updated with this
new component.

The `CheckableButton` component has been simplified, as a lot of the
logic required in the existing implementation is no longer needed.

As part of this work, small-screen BulkActions and SelectAllActions
support has been removed, as we are removing bulk action and select
functionality for small screens, as an intentional decision as part of
the Unified Index Filtering and Search project.

<!-- ℹ️ Delete the following for small / trivial changes -->

### How to 🎩

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

<!--
  Give as much information as needed to experiment with the component
  in the playground.
-->

<details>
<summary>Copy-paste this code in
<code>playground/Playground.tsx</code>:</summary>

```jsx
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}
```

</details>

### 🎩 checklist

- [x] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [x] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [x] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [x] Updated the component's `README.md` with documentation changes
- [x] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide

Co-authored-by: Zakaria Warsame <zakaria.warsame@shopify.com>
Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>
laurkim pushed a commit that referenced this pull request Nov 30, 2022
…#7811)

Reverts #7290

Reverting due to blocking a release of Polaris that needs to go out
ASAP.
juzser pushed a commit to juzser/polaris that referenced this pull request Jul 27, 2023
…#7290)

### WHY are these changes introduced?

Fixes https://github.com/Shopify/web/issues/74192

Spin link in situ:
https://admin.web.discounts-update-save-as.marc-thomas.eu.spin.dev/store/shop1/orders?inContextTimeframe=none

### WHAT is this pull request doing?

#### Before

<img width="2440" alt="Screenshot 2022-09-28 at 11 42 54"
src="https://user-images.githubusercontent.com/2562596/192759539-4fece161-5bef-44ed-961f-4a342f495c69.png">
<img width="2440" alt="Screenshot 2022-09-28 at 11 42 28"
src="https://user-images.githubusercontent.com/2562596/192759582-834b2d6a-f0e2-4d07-803f-4be435559495.png">

#### After

<img width="2440" alt="Screenshot 2022-09-28 at 11 42 39"
src="https://user-images.githubusercontent.com/2562596/192761041-9b38059f-3b80-4a8e-8261-633589098bb4.png">
<img width="2440" alt="Screenshot 2022-09-28 at 11 42 43"
src="https://user-images.githubusercontent.com/2562596/192761078-f7fe25e1-4181-49ab-8545-c6e923917d2c.png">
<img width="2440" alt="Screenshot 2022-09-28 at 11 43 00"
src="https://user-images.githubusercontent.com/2562596/192761112-bca384f4-ec7f-435c-80a7-b96f2ef7cbb8.png">
<img width="2440" alt="Screenshot 2022-09-28 at 11 43 03"
src="https://user-images.githubusercontent.com/2562596/192761145-e6feb191-0430-420c-a77f-9dac004a418a.png">

This PR updates the BulkActions component, used on the IndexTable and
ResourceList components, as well as moving some functionality from
BulkActions into the new SelectAllActions component. This is to support
the [Unified Index Filtering and
Search](https://minerva.shopifycloud.com/auth/minerva?request=2905eaf2-0cf1-493c-b6d3-82e6385d6352&rd=https://vault.shopify.io%2Fprojects%2F24858)
project.

This PR introduces a new UX pattern for the BulkActions component. It
has been separated from the `Select X` actions – which is now the
`SelectAllActions` component, and the `BulkActions` component gets
rendered afterward in the DOM.

Components that consume the BulkActions use the new
`useIsBulkActionSticky` hook to determine whether the BulkActions
component should be `position: fixed` or `position: absolute` with a
calculated top position. We have had to do this rather than use a
regular `position: sticky` on the BulkActions element, as the keyboard
focus order needs to be logically preserved, and moving the BulkActions
component under the table/resource list HTML in the DOM would provide a
bad experience for users navigating via keyboard.

The IndexTable and ResourceList components have been updated with this
new component.

The `CheckableButton` component has been simplified, as a lot of the
logic required in the existing implementation is no longer needed.

As part of this work, small-screen BulkActions and SelectAllActions
support has been removed, as we are removing bulk action and select
functionality for small screens, as an intentional decision as part of
the Unified Index Filtering and Search project.

<!-- ℹ️ Delete the following for small / trivial changes -->

### How to 🎩

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

<!--
  Give as much information as needed to experiment with the component
  in the playground.
-->

<details>
<summary>Copy-paste this code in
<code>playground/Playground.tsx</code>:</summary>

```jsx
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}
```

</details>

### 🎩 checklist

- [x] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [x] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [x] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [x] Updated the component's `README.md` with documentation changes
- [x] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide

Co-authored-by: Zakaria Warsame <zakaria.warsame@shopify.com>
Co-authored-by: translation-platform[bot] <34770790+translation-platform[bot]@users.noreply.github.com>
juzser pushed a commit to juzser/polaris that referenced this pull request Jul 27, 2023
…Shopify#7811)

Reverts Shopify#7290

Reverting due to blocking a release of Polaris that needs to go out
ASAP.
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.

4 participants