Commit df1eaf0
authored
[BulkActions] Bring everything up to the top (#11622)
### WHY are these changes introduced?
Fixes Shopify/web#119088
We want to further update the bulk/select actions to re-combine them
into the same piece of UI. We had broken bulk and select actions up as
part of the initial Index Filtering and Search work, but now realise
that keeping them colocated is the best UX for our merchants.
### WHAT is this pull request doing?
<img width="1624" alt="Screenshot 2024-02-22 at 12 23 50"
src="https://github.com/Shopify/polaris/assets/2562596/11b33a11-474a-42fb-8475-1137da228481">
This PR:
- re-introduces all the select logic to the BulkActions component
- left-align select actions, right-align bulk actions
- rewrites the BulkActions component to a function component from a
class component
- updates the logic to show/hide promoted actions, as the previous
method was broken
- deprecate the SelectAllActions component
- updates IndexTable & ResourceList to remove SelectAllActions, update
BulkActions implementation
- removes the useIsSelectAllActionsSticky hook (never exported, only
used to position the SelectAllActions internally within
ResourceList/IndexTable
The biggest piece of work is updating how the bulk actions show/rollup
logic works. Beforehand, it would either show all promoted actions if
they fit, or roll every single one up behind a meatball menu. This
wasn't great, as we should show as many as possible in the available
space. As part of the update to a function component, we now utilise a
similar layout sizing mechanism as we use in both the Tabs and
ActionMenu -> Actions components, to render as many promoted actions as
we possibly can in the available space.
### How to 🎩
Spin URL for IndexTable:
https://admin.web.bulk-ui-refresh.marc-thomas.eu.spin.dev/store/shop1/products?selectedView=all
Spin URL for ResourceList:
https://admin.web.bulk-ui-refresh.marc-thomas.eu.spin.dev/store/shop1/products/32
Spin URL for Updated Draft orders (using Shopify/web
`ResourceListWithHeader`):
https://admin.web.bulk-ui-refresh.marc-thomas.eu.spin.dev/store/shop1/draft_orders?selectedView=all
### 🎩 checklist
- [x] Tested a
[snapshot](https://github.com/Shopify/polaris/blob/main/documentation/Releasing.md#-snapshot-releases)
- [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 guide1 parent 6cc80fd commit df1eaf0
File tree
23 files changed
+918
-1486
lines changed- .changeset
- polaris-react/src/components
- BulkActions
- components
- BulkActionsMeasurer
- tests
- IndexTable
- tests
- ResourceList
- tests
- SelectAllActions
- hooks
- tests
- tests
23 files changed
+918
-1486
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 76 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
30 | 32 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
45 | 58 | | |
46 | 59 | | |
47 | 60 | | |
| |||
83 | 96 | | |
84 | 97 | | |
85 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
0 commit comments