Skip to content

Commit d0f142e

Browse files
mirekmwitoszekdev
andauthored
Improve table design consistency across the dashboard (#6276)
* Unify ResponsiveTable design; Fix visual consistency of Shipping Methods * WIP * Updating ReactiveTable across the entire Dashboard * Improve the ResponsiveTable styling; Stick variants list * Improve variants page * Unify the loading phases pattern for all ResponsiveTables * Mock scrollIntoView in test fixture * Add changeset * Extract messages * Remove old dead part of the code * Fix error button * Revert mistakenly overritten changelog entry * Add changeset * Trim AGENTS.MD to the minimum * Handle plural * Remove unused styles * Drop barrel index * Refactor * Apply suggestions from code review * Update messages * fix messages, add plural * apply other review comments * fix incorreclty added changeset --------- Co-authored-by: Jonatan Witoszek <jonatanwitoszek@gmail.com>
1 parent 32250a7 commit d0f142e

132 files changed

Lines changed: 2850 additions & 2833 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/tough-poems-sit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"saleor-dashboard": patch
3+
---
4+
5+
Improve table design consistency across the dashboard with unified styling for ResponsiveTable components, better loading states, and improved scroll behavior for variant navigation

AGENTS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,21 @@ The codebase follows a feature-based architecture with shared components:
127127
- Implement proper form validation with React Hook Form
128128
- Add internationalization support for user-facing text
129129

130+
### UI Design Guidelines
131+
132+
**Before redesigning any component that displays a list, ask: "What happens with 50+ items?"**
133+
134+
If the list could be long:
135+
136+
- Add scrollable container with `max-height`
137+
- Keep headers outside the scroll area
138+
- Auto-scroll to active item on load
139+
140+
Other considerations:
141+
142+
- Loading states: Show skeletons
143+
- Empty states: Handle zero items gracefully
144+
130145
### Testing Requirements
131146

132147
- Write unit tests for utility functions and complex components

locale/defaultMessages.json

Lines changed: 55 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,9 @@
528528
"context": "sum of all pending refunds inside an order",
529529
"string": "Pending refunds"
530530
},
531+
"0xMUfd": {
532+
"string": "No results found for \"{query}\""
533+
},
531534
"1+ROfp": {
532535
"string": "Transaction"
533536
},
@@ -1368,17 +1371,9 @@
13681371
"context": "weight",
13691372
"string": "{fromValue} {fromUnit} - {toValue} {toUnit}"
13701373
},
1371-
"5ye4Ik": {
1372-
"context": "warning message when some variants failed to create",
1373-
"string": "{success} variants created, {failed} failed"
1374-
},
13751374
"6230rS": {
13761375
"string": "Discount rules for carts and draft orders."
13771376
},
1378-
"62Ywh2": {
1379-
"context": "number of countries",
1380-
"string": "{number} Countries"
1381-
},
13821377
"62nsdy": {
13831378
"string": "Retry"
13841379
},
@@ -2104,6 +2099,10 @@
21042099
"context": "replaced event title",
21052100
"string": "Products were replaced"
21062101
},
2102+
"AWyKB7": {
2103+
"context": "card header title",
2104+
"string": "Channel list"
2105+
},
21072106
"AY7Tuz": {
21082107
"string": "The same object cannot be in both lists"
21092108
},
@@ -3241,6 +3240,10 @@
32413240
"context": "dialog content",
32423241
"string": "{counter,plural,one{Are you sure you want to unassign this category?} other{Are you sure you want to unassign {displayQuantity} categories?}}"
32433242
},
3243+
"GjEdSd": {
3244+
"context": "number of postal code ranges",
3245+
"string": "{number, plural, one {# postal code range} other {# postal code ranges}}"
3246+
},
32443247
"Gkip05": {
32453248
"context": "button",
32463249
"string": "Unassign"
@@ -3413,6 +3416,10 @@
34133416
"context": "table column header, sold units preorder quantity",
34143417
"string": "Sold units"
34153418
},
3419+
"Hd3E1g": {
3420+
"context": "table header column",
3421+
"string": "Channel name"
3422+
},
34163423
"Hebup2": {
34173424
"context": "Health check subtitle when product is not published",
34183425
"string": "Product is not published. Publish it to make it visible in your store."
@@ -5814,10 +5821,6 @@
58145821
"VEext+": {
58155822
"string": "Are you sure you want to delete this image?"
58165823
},
5817-
"VHuzgq": {
5818-
"context": "table actions",
5819-
"string": "Actions"
5820-
},
58215824
"VIABHy": {
58225825
"context": "error message",
58235826
"string": "Default shipping zone already exists"
@@ -5987,10 +5990,6 @@
59875990
"WHgdsk": {
59885991
"string": "Out of stock"
59895992
},
5990-
"WIxSDm": {
5991-
"context": "card header",
5992-
"string": "{country} class rates"
5993-
},
59945993
"WK62MN": {
59955994
"string": "Fulfillment"
59965995
},
@@ -6954,6 +6953,10 @@
69546953
"context": "button",
69556954
"string": "Create permission group"
69566955
},
6956+
"bRQeJp": {
6957+
"context": "success message when all variants are created",
6958+
"string": "{count, plural, one {# variant created successfully} other {# variants created successfully}}"
6959+
},
69576960
"bRXgSC": {
69586961
"context": "capture button with amount",
69596962
"string": "Capture {amount}"
@@ -7299,6 +7302,10 @@
72997302
"context": "error message",
73007303
"string": "Cannot change the quantity because of insufficient stock"
73017304
},
7305+
"dAst+b": {
7306+
"context": "attribute values list: no attribute values found",
7307+
"string": "No values found"
7308+
},
73027309
"dDCLFW": {
73037310
"context": "alert message",
73047311
"string": "Not available for sale this channel"
@@ -7453,6 +7460,10 @@
74537460
"eRqx44": {
74547461
"string": "Search collections..."
74557462
},
7463+
"eS8xZ6": {
7464+
"context": "card header",
7465+
"string": "Tax class rates: {country}"
7466+
},
74567467
"eUjFjW": {
74577468
"string": "Permission group created"
74587469
},
@@ -7699,10 +7710,6 @@
76997710
"context": "button",
77007711
"string": "Assign categories"
77017712
},
7702-
"g5zIpS": {
7703-
"context": "No attribute values found",
7704-
"string": "No values found"
7705-
},
77067713
"g6yuk2": {
77077714
"context": "export items to csv file, choice field label",
77087715
"string": "Export information for:"
@@ -7778,10 +7785,6 @@
77787785
"gTr0qE": {
77797786
"string": "Shipping Settings"
77807787
},
7781-
"gVD1os": {
7782-
"context": "empty list message",
7783-
"string": "You haven’t assigned any member to this permission group yet."
7784-
},
77857788
"gVqSnA": {
77867789
"string": "Assign and save"
77877790
},
@@ -7966,6 +7969,9 @@
79667969
"hYWxeg": {
79677970
"string": "The extension requests permissions you cannot grant or that exceed its allowed scope. Review the extension's manifest and your permissions. {docsLink} ({errorCode})"
79687971
},
7972+
"hh0xW7": {
7973+
"string": "Channel Name"
7974+
},
79697975
"hjEkEH": {
79707976
"string": "All webhooks registered by this extension. In case of failed webhook delivery, list of attempts is displayed."
79717977
},
@@ -8152,6 +8158,9 @@
81528158
"context": "translation progress",
81538159
"string": "{current} of {max}"
81548160
},
8161+
"imYtnq": {
8162+
"string": "Selected {number, plural, one {# item} other {# items}}"
8163+
},
81558164
"inWs4U": {
81568165
"context": "attribute visibility in storefront",
81578166
"string": "Visible in storefront"
@@ -8197,10 +8206,6 @@
81978206
"context": "Shown when shipping zone count cannot be determined",
81988207
"string": "Shipping zones: Unknown"
81998208
},
8200-
"j/vV0n": {
8201-
"context": "channel name",
8202-
"string": "Channel Name"
8203-
},
82048209
"j08fR9": {
82058210
"context": "Product collections",
82068211
"string": "Collections"
@@ -8589,6 +8594,10 @@
85898594
"context": "order return error title when cannot refund",
85908595
"string": "Couldn't refund products"
85918596
},
8597+
"lCEp2/": {
8598+
"context": "save button disabled tooltip",
8599+
"string": "Set prices for all channels to save"
8600+
},
85928601
"lCPxtT": {
85938602
"context": "resend code label",
85948603
"string": "Resend code"
@@ -9930,10 +9939,6 @@
99309939
"t1Bd7E": {
99319940
"string": "Payment captured"
99329941
},
9933-
"t1XcOo": {
9934-
"context": "success message when all variants are created",
9935-
"string": "{count} variants created successfully"
9936-
},
99379942
"t1scMK": {
99389943
"string": "Refunds settings"
99399944
},
@@ -9949,6 +9954,10 @@
99499954
"context": "voucher status",
99509955
"string": "Expired"
99519956
},
9957+
"t84lbb": {
9958+
"context": "empty list message",
9959+
"string": "You haven't assigned any member to this permission group yet."
9960+
},
99529961
"tCLTCb": {
99539962
"context": "tab name",
99549963
"string": "All products"
@@ -10111,6 +10120,10 @@
1011110120
"context": "shipping zones configuration",
1011210121
"string": "Change default weight unit"
1011310122
},
10123+
"u6rPuc": {
10124+
"context": "warning message when some variants failed to create",
10125+
"string": "{success, plural, one {# variant} other {# variants}} created, {failed, plural, one {# failed} other {# failed}}"
10126+
},
1011410127
"u7ShY+": {
1011510128
"context": "pill status for overcaptured outcome",
1011610129
"string": "Overcaptured"
@@ -10200,10 +10213,6 @@
1020010213
"context": "Dry run objects",
1020110214
"string": "Objects"
1020210215
},
10203-
"ud0w8h": {
10204-
"context": "number of postal code ranges",
10205-
"string": "{number} postal code ranges"
10206-
},
1020710216
"udJUSa": {
1020810217
"context": "Authorize {app name}",
1020910218
"string": "Authorize"
@@ -10320,6 +10329,9 @@
1032010329
"v3WWK+": {
1032110330
"string": "Status is invalid"
1032210331
},
10332+
"v8UngX": {
10333+
"string": "Search warehouses..."
10334+
},
1032310335
"v8e93p": {
1032410336
"context": "hint for order total option",
1032510337
"string": "Matches what customer owes"
@@ -10373,6 +10385,10 @@
1037310385
"context": "button",
1037410386
"string": "Undo"
1037510387
},
10388+
"vNaDeR": {
10389+
"context": "number of countries",
10390+
"string": "{count, plural, one {# Country} other {# Countries}}"
10391+
},
1037610392
"vONi+O": {
1037710393
"string": "Country"
1037810394
},
@@ -10435,6 +10451,9 @@
1043510451
"context": "default product variant indicator",
1043610452
"string": "Default"
1043710453
},
10454+
"vaFjs6": {
10455+
"string": "No warehouses available to add"
10456+
},
1043810457
"vbop3G": {
1043910458
"string": "Create new model"
1044010459
},
@@ -10588,9 +10607,6 @@
1058810607
"context": "refund amounts were settled",
1058910608
"string": "Settled"
1059010609
},
10591-
"wL7VAE": {
10592-
"string": "Actions"
10593-
},
1059410610
"wL850U": {
1059510611
"context": "draft order lines, section header",
1059610612
"string": "Order lines"
@@ -10891,10 +10907,6 @@
1089110907
"context": "discount value",
1089210908
"string": "discount"
1089310909
},
10894-
"yLfbSh": {
10895-
"context": "support label",
10896-
"string": "Channel name"
10897-
},
1089810910
"yOaNWB": {
1089910911
"context": "delete shipping method",
1090010912
"string": "Are you sure you want to delete {name}?"
@@ -11028,10 +11040,6 @@
1102811040
"zCb8fX": {
1102911041
"string": "Weight"
1103011042
},
11031-
"zD7/M6": {
11032-
"context": "empty list message",
11033-
"string": "Please use Assign Members button to do so."
11034-
},
1103511043
"zDvDnG": {
1103611044
"context": "modal header",
1103711045
"string": "Media from the URL you supply will be shown in the media gallery. You will be able to define the order of the gallery."

src/attributes/components/AttributeListDatagrid/AttributeListDatagrid.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ import {
66
DatagridChangeStateContext,
77
useDatagridChangeState,
88
} from "@dashboard/components/Datagrid/hooks/useDatagridChange";
9-
import { TablePaginationWithContext } from "@dashboard/components/TablePagination";
9+
import { DatagridPagination } from "@dashboard/components/TablePagination";
1010
import { AttributeFragment } from "@dashboard/graphql";
1111
import { getPrevLocationState } from "@dashboard/hooks/useBackLinkWithState";
1212
import useNavigator from "@dashboard/hooks/useNavigator";
1313
import { ListProps, SortPage } from "@dashboard/types";
1414
import { Item } from "@glideapps/glide-data-grid";
15-
import { Box } from "@saleor/macaw-ui-next";
1615
import { useCallback, useMemo } from "react";
1716
import { useIntl } from "react-intl";
1817
import { useLocation } from "react-router";
@@ -122,14 +121,12 @@ export const AttributeListDatagrid = ({
122121
navigatorOpts={{ state: getPrevLocationState(location) }}
123122
/>
124123

125-
<Box paddingX={6}>
126-
<TablePaginationWithContext
127-
component="div"
128-
settings={settings}
129-
disabled={disabled}
130-
onUpdateListSettings={onUpdateListSettings}
131-
/>
132-
</Box>
124+
<DatagridPagination
125+
component="div"
126+
settings={settings}
127+
disabled={disabled}
128+
onUpdateListSettings={onUpdateListSettings}
129+
/>
133130
</DatagridChangeStateContext.Provider>
134131
);
135132
};

0 commit comments

Comments
 (0)