Skip to content

style(ui): align collection cards with dashboard tiles - #18358

Merged
GermanJablo merged 9 commits into
mainfrom
codex/pyld-4165-collection-cards
Oct 1, 2026
Merged

GermanJablo merged 9 commits into
mainfrom
codex/pyld-4165-collection-cards

Conversation

@GermanJablo

@GermanJablo GermanJablo commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Redacted with AI

Summary

Align the dashboard Collection Cards with the primary tile design for PYLD-4165 and give all .card widgets the same surface.

Changes

  • Update tile spacing and responsive columns to match the Figma design.
  • Apply the Figma tile surface, padding, radius, and hover color to the shared .card class so other dashboard widgets match.
  • Clarify the card recommendation in the dashboard documentation and cover the shared surface in the dashboard E2E test.
  • Align Collection Cards with the other dashboard widgets at the shared content edge.
  • Show collection create actions on hover or keyboard focus, while keeping them available on touch devices.
  • Use localized create labels for both the accessible name and tooltip.
  • Cover tile layout, interaction, keyboard focus, and 320px reflow.
  • Match the create-action tooltip to Figma with 8px horizontal and 4px vertical padding.
  • Retry card measurements and hover checks during dashboard hydration.

Design

Admin previews

Three collections, desktop

Full Payload admin with sidebar, three collection cards, a global card, and Recently viewed

Create action on hover

Payload admin dashboard with the Users collection card and the Create new Users tooltip showing updated horizontal padding

Narrow viewport with two columns

Payload admin at a narrow viewport with collection cards in two columns

Shared card style across the dashboard fixture

Full Payload admin with collection cards, count cards, revenue chart, private panel, and list widgets sharing the updated card surface

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖

Meta File Out File Size (raw) Note
packages/next/meta_index.json esbuild/index.js 215.27 KB ⚠️ +496 B (+0.2%)
packages/payload/meta_index.json esbuild/index.js 1.86 MB ⚠️ +73.81 KB (+4.1%)
packages/payload/meta_shared.json esbuild/exports/shared.js 553.18 KB ⚠️ +3.88 KB (+0.7%)
packages/richtext-lexical/meta_client.json esbuild/exports/client_optimized/index.js 294.35 KB ⚠️ +7.85 KB (+2.7%)
packages/ui/meta_client.json esbuild/exports/client_optimized/index.js 36.54 KB ✅ No change
packages/ui/meta_shared.json esbuild/exports/shared_optimized/index.js 18.98 KB ⚠️ +34 B (+0.2%)
Largest paths These visualization shows top 20 largest paths in the bundle.

Meta file: packages/next/meta_index.json, Out file: esbuild/index.js

Path Size
../../node_modules ${{\color{Goldenrod}{ ████████████████████████▋ }}}$ 98.7%, 210.74 KB
dist/adapters/router.js ${{\color{Goldenrod}{ }}}$ 0.3%, 718 B
dist/adapters/server.js ${{\color{Goldenrod}{ }}}$ 0.2%, 533 B
dist/adapters/layout.js ${{\color{Goldenrod}{ }}}$ 0.2%, 529 B
dist/adapters/views.js ${{\color{Goldenrod}{ }}}$ 0.2%, 324 B
dist/utilities/initAdminContext.js ${{\color{Goldenrod}{ }}}$ 0.1%, 315 B
dist/utilities/selectiveCache.js ${{\color{Goldenrod}{ }}}$ 0.1%, 263 B
dist/esbuildEntry.js ${{\color{Goldenrod}{ }}}$ 0.0%, 0 B

Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js

Path Size
../../node_modules ${{\color{Goldenrod}{ █████████████████▉ }}}$ 71.9%, 1.33 MB
dist/collections/operations ${{\color{Goldenrod}{ ▊ }}}$ 3.0%, 54.65 KB
dist/fields/hooks ${{\color{Goldenrod}{ ▋ }}}$ 2.5%, 46.15 KB
dist/auth/operations ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 16.95 KB
dist/globals/operations ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 16.18 KB
dist/utilities/configToJSONSchema.js ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 16.02 KB
dist/queues/operations ${{\color{Goldenrod}{ ▏ }}}$ 0.8%, 14.31 KB
dist/fields/config ${{\color{Goldenrod}{ ▏ }}}$ 0.7%, 13.65 KB
dist/utilities/telemetry ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 11.88 KB
dist/collections/config ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 11.00 KB
dist/fields/validations.js ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 10.82 KB
dist/cli/commands ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 9.92 KB
dist/config/orderable ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 8.76 KB
dist/uploads/fetchAPI-multipart ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 8.38 KB
dist/database/migrations ${{\color{Goldenrod}{ }}}$ 0.4%, 8.16 KB
dist/index.js ${{\color{Goldenrod}{ }}}$ 0.4%, 7.79 KB
dist/hierarchy/utils ${{\color{Goldenrod}{ }}}$ 0.4%, 7.66 KB
dist/auth/strategies ${{\color{Goldenrod}{ }}}$ 0.4%, 7.36 KB
dist/utilities/entityInputSchema ${{\color{Goldenrod}{ }}}$ 0.4%, 7.34 KB
dist/config/sanitize.js ${{\color{Goldenrod}{ }}}$ 0.4%, 7.33 KB
(other) ${{\color{Goldenrod}{ ███████ }}}$ 28.1%, 520.63 KB

Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js

Path Size
../../node_modules ${{\color{Goldenrod}{ ██████████████████████▏ }}}$ 88.8%, 486.64 KB
dist/fields/validations.js ${{\color{Goldenrod}{ ▌ }}}$ 2.0%, 10.79 KB
dist/fields/config ${{\color{Goldenrod}{ ▎ }}}$ 1.1%, 5.83 KB
dist/utilities/traverseFields.js ${{\color{Goldenrod}{ ▏ }}}$ 0.8%, 4.34 KB
dist/utilities/deepCopyObject.js ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 3.52 KB
dist/collections/config ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 3.42 KB
dist/config/orderable ${{\color{Goldenrod}{ ▏ }}}$ 0.6%, 3.13 KB
dist/fields/baseFields ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 2.79 KB
dist/config/client.js ${{\color{Goldenrod}{ ▏ }}}$ 0.5%, 2.56 KB
dist/auth/cookies.js ${{\color{Goldenrod}{ }}}$ 0.3%, 1.55 KB
dist/utilities/flattenTopLevelFields.js ${{\color{Goldenrod}{ }}}$ 0.3%, 1.42 KB
dist/utilities/getVersionsConfig.js ${{\color{Goldenrod}{ }}}$ 0.2%, 1.04 KB
dist/globals/config ${{\color{Goldenrod}{ }}}$ 0.2%, 939 B
dist/utilities/unflatten.js ${{\color{Goldenrod}{ }}}$ 0.2%, 850 B
dist/utilities/flattenAllFields.js ${{\color{Goldenrod}{ }}}$ 0.1%, 794 B
dist/utilities/sanitizeUserDataForEmail.js ${{\color{Goldenrod}{ }}}$ 0.1%, 713 B
dist/auth/extractJWT.js ${{\color{Goldenrod}{ }}}$ 0.1%, 696 B
dist/utilities/getFieldPermissions.js ${{\color{Goldenrod}{ }}}$ 0.1%, 651 B
dist/utilities/fieldPath.js ${{\color{Goldenrod}{ }}}$ 0.1%, 639 B
dist/utilities/getSafeRedirect.js ${{\color{Goldenrod}{ }}}$ 0.1%, 632 B
(other) ${{\color{Goldenrod}{ ██▊ }}}$ 11.2%, 61.67 KB

Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js

Path Size
dist/features/blocks ${{\color{Goldenrod}{ ███▌ }}}$ 14.2%, 41.40 KB
dist/lexical/plugins ${{\color{Goldenrod}{ ██▉ }}}$ 11.9%, 34.51 KB
dist/lexical/ui ${{\color{Goldenrod}{ ██▊ }}}$ 11.4%, 33.27 KB
dist/features/table ${{\color{Goldenrod}{ ██▎ }}}$ 9.4%, 27.46 KB
dist/features/link ${{\color{Goldenrod}{ █▋ }}}$ 6.5%, 18.91 KB
dist/features/toolbars ${{\color{Goldenrod}{ █▌ }}}$ 6.3%, 18.41 KB
dist/features/upload ${{\color{Goldenrod}{ █▏ }}}$ 4.9%, 14.28 KB
dist/features/textState ${{\color{Goldenrod}{ ▉ }}}$ 3.8%, 11.08 KB
dist/lexical/utils ${{\color{Goldenrod}{ ▊ }}}$ 3.4%, 10.02 KB
dist/features/relationship ${{\color{Goldenrod}{ ▊ }}}$ 3.2%, 9.43 KB
dist/features/converters ${{\color{Goldenrod}{ ▋ }}}$ 2.9%, 8.40 KB
dist/utilities/fieldsDrawer ${{\color{Goldenrod}{ ▋ }}}$ 2.8%, 8.12 KB
dist/features/debug ${{\color{Goldenrod}{ ▋ }}}$ 2.5%, 7.40 KB
dist/lexical/config ${{\color{Goldenrod}{ ▍ }}}$ 1.8%, 5.14 KB
dist/features/indent ${{\color{Goldenrod}{ ▎ }}}$ 1.4%, 4.19 KB
dist/features/lists ${{\color{Goldenrod}{ ▎ }}}$ 1.3%, 3.67 KB
dist/lexical/LexicalEditor.js ${{\color{Goldenrod}{ ▎ }}}$ 1.1%, 3.33 KB
dist/features/format ${{\color{Goldenrod}{ ▎ }}}$ 1.1%, 3.28 KB
dist/features/horizontalRule ${{\color{Goldenrod}{ ▎ }}}$ 1.1%, 3.18 KB
dist/field/Field.js ${{\color{Goldenrod}{ ▎ }}}$ 1.0%, 2.88 KB
(other) ${{\color{Goldenrod}{ █████████████████████▍ }}}$ 85.8%, 249.74 KB

Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js

Path Size
dist/exports/client ${{\color{Goldenrod}{ █████████████████████████ }}}$ 100.0%, 26.90 KB

Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js

Path Size
dist/graphics/Logo ${{\color{Goldenrod}{ ███████▋ }}}$ 30.7%, 5.61 KB
../../node_modules ${{\color{Goldenrod}{ ███▌ }}}$ 14.5%, 2.65 KB
dist/graphics/Icon ${{\color{Goldenrod}{ ██ }}}$ 8.3%, 1.51 KB
dist/utilities/formatDocTitle ${{\color{Goldenrod}{ █▊ }}}$ 7.2%, 1.32 KB
dist/providers/TableColumns ${{\color{Goldenrod}{ █▏ }}}$ 4.7%, 866 B
dist/utilities/getGlobalData.js ${{\color{Goldenrod}{ █ }}}$ 4.2%, 762 B
dist/utilities/api.js ${{\color{Goldenrod}{ █ }}}$ 4.1%, 756 B
dist/utilities/groupNavItems.js ${{\color{Goldenrod}{ █ }}}$ 4.1%, 745 B
dist/elements/Translation ${{\color{Goldenrod}{ ▋ }}}$ 2.7%, 493 B
dist/utilities/handleTakeOver.js ${{\color{Goldenrod}{ ▌ }}}$ 2.4%, 440 B
dist/utilities/traverseForLocalizedFields.js ${{\color{Goldenrod}{ ▌ }}}$ 2.3%, 419 B
dist/elements/withMergedProps ${{\color{Goldenrod}{ ▍ }}}$ 1.9%, 339 B
dist/utilities/getNavGroups.js ${{\color{Goldenrod}{ ▍ }}}$ 1.8%, 338 B
dist/utilities/getVisibleEntities.js ${{\color{Goldenrod}{ ▍ }}}$ 1.8%, 329 B
dist/elements/WithServerSideProps ${{\color{Goldenrod}{ ▎ }}}$ 1.3%, 232 B
dist/layouts/Root ${{\color{Goldenrod}{ ▎ }}}$ 1.3%, 230 B
dist/utilities/handleGoBack.js ${{\color{Goldenrod}{ ▎ }}}$ 1.0%, 180 B
dist/fields/mergeFieldStyles.js ${{\color{Goldenrod}{ ▏ }}}$ 0.9%, 158 B
dist/forms/Form ${{\color{Goldenrod}{ ▏ }}}$ 0.8%, 152 B
dist/utilities/handleBackToDashboard.js ${{\color{Goldenrod}{ ▏ }}}$ 0.8%, 152 B
(other) ${{\color{Goldenrod}{ █████████████████▎ }}}$ 69.3%, 12.68 KB
Details

Next to the size is how much the size has increased or decreased compared with the base branch of this PR.

  • ‼️: Size increased by 20% or more. Special attention should be given to this.
  • ⚠️: Size increased in acceptable range (lower than 20%).
  • ✅: No change or even downsized.
  • 🗑️: The out file is deleted: not found in base branch.
  • 🆕: The out file is newly found: will be added to base branch.

@GermanJablo
GermanJablo marked this pull request as ready for review September 29, 2026 19:49
@JessRynkar

JessRynkar commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Current:
Screenshot 2026-09-30 at 13 41 17

Design:
Screenshot 2026-09-30 at 13 41 33

Update the Create New [Collection] tooltip padding to match the design

Comment thread test/dashboard/e2e.spec.ts Resolved
@GermanJablo
GermanJablo enabled auto-merge (squash) September 30, 2026 17:18
JessRynkar
JessRynkar previously approved these changes Oct 1, 2026
@GermanJablo
GermanJablo merged commit b063a4a into main Oct 1, 2026
283 checks passed
@GermanJablo
GermanJablo deleted the codex/pyld-4165-collection-cards branch October 1, 2026 13:57
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🚀 This is included in version v4.0.0-canary.38

GermanJablo added a commit that referenced this pull request Oct 27, 2026
… (3.x) (#19116)

### What?

Port of #17664 to `3.x`. The create button on the dashboard collection
cards now passes the translated collection label to
`general:createNewLabel`.

### Why?

With localized collection labels (for example `{ en: 'Pages', de:
'Seiten' }`), the raw label object was interpolated, so the button's
`aria-label` and `title` read `[object Object] neu erstellen`. Reported
in #17069 and confirmed on 3.85.1, 3.85.2 and 3.88.0.

`main` already includes this fix via #18358.

### How?

- Use the already translated `title` in the create button's
`aria-label`, matching the `showAllLabel` call above it.
- Add the `test/i18n` e2e assertion from #17664 for both `aria-label`
and `title`. It fails without the fix (`Received: "Crear [object
Object]"`) and passes with it.
- The pre-commit hook also sorted the existing imports in
`test/i18n/e2e.spec.ts`.

Thanks to @1yakub for the original fix and test, and to @cbratschi for
the report and review.

Fixes #17069

Co-authored-by: German Jablonski <[email protected]>
Co-authored-by: Yakub Hossain <[email protected]>
GermanJablo added a commit that referenced this pull request Oct 30, 2026
…9209)

### What?

Fixes every remaining place on 3.x where a config label (a locale record
or label function) or another value that is not a string or number is
interpolated into a string without being resolved first.

User-visible fixes:

- **Sort buttons** in list column headers had `aria-label="Sort by
[object Object] Ascending"` when the field label is a locale record.
This is the remaining case from
[#19198](#19198).
- **Query preset bar**: "New", "Edit" and "Delete" preset labels, plus
the delete confirmation, rendered `[object Object]` when
`queryPresets.labels` uses locale records.
- **Number `hasMany` min/max errors** interpolated the whole array. They
now name the offending number.
- **Config errors** (`DuplicateGlobal`, `InvalidFieldName`,
`InvalidFieldRelationship`, `MissingFieldInputOptions`,
`ReservedFieldName`) and the **cloud-storage / payload-cloud delete
error logs** fall back to the field name or slug when the label is not a
plain string.
- `LinkEditor` was passing `i18n` as interpolation variables to `t()`.

### Why?

The other two sites from #19198 were fixed in
[#18358](#18358) and
[#19116](#19116) (dashboard
card) and [#19154](#19154)
(document drawer). This PR fixes the rest of the bug class at once
instead of one report at a time.

### How?

- I temporarily tightened `TFunction` to only accept primitive
interpolation values and ran `tsc -b`, then ran a TypeScript
compiler-API audit for the cases the compiler can't see (`any` values
and labels in template literals).
- Each site now resolves the label with `getTranslation`, or falls back
to the name or slug where there is no `i18n` instance.
- The `TFunction` type is unchanged, because narrowing it would be a
breaking change. The `main` port is
[#19208](#19208).

Tests:

- Unit test for the `hasMany` number message.
- e2e tests in the `i18n` suite for the sort button labels and the query
preset bar. Both fail on current 3.x with `[object Object]`.

Fixes #19198

Co-authored-by: German Jablonski <[email protected]>
GermanJablo added a commit that referenced this pull request Oct 30, 2026
…9208)

### What?

Fixes every remaining place where a config label (a locale record or
label function) or another non-primitive value is interpolated into a
string without being resolved first.

User-visible fixes:

- **Group by button** showed `Group by [object Object]` for fields
nested in a group or named tab, because `ReducedField.label` holds JSX
there. It now uses `plainTextLabel`. `reduceFieldsToOptions` also falls
back to the humanized field name for `label: false` fields, as
`combineFieldLabel` already does, so the button no longer reads `Group
by Meta > `.
- **Number `hasMany` min/max errors** interpolated the whole array
(`1,2,30 is greater than the max allowed value of 10`). They now name
the offending number.
- **Config errors** (`DuplicateGlobal`, `InvalidFieldName`,
`InvalidFieldRelationship`, `MissingFieldInputOptions`,
`ReservedFieldName`) and the **cloud-storage / payload-cloud delete
error logs** printed `[object Object]` or the source of a label
function. They now fall back to the field name or slug when the label is
not a plain string, which matches the existing pattern in
`saveVersion.ts`.
- `LinkEditor` was passing `i18n` as interpolation variables to `t()`.

### Why?

Follow-up to
[#19198](#19198),
[#17959](#17959) and
[#18358](#18358). These bugs
keep coming back one at a time because `TFunction` accepts `options?:
Record<string, any>`, and the runtime stringifies each value, so objects
become `[object Object]`.

### How?

- I found the sites by temporarily narrowing `TFunction` to primitive
values and running `tsc -b`, then running a TypeScript compiler-API
audit for what the compiler can't see: `any` values, labels in template
literals, and `aria-label`, `title`, `placeholder` and `alt` attributes
across all packages. The remaining hits are counts, filenames, document
titles and GraphQL type names.
- The `TFunction` type is unchanged. Narrowing it would stop correct
code from compiling (for example booleans or `Date` values, which the
runtime stringifies fine), which is a breaking change under the
[versioning
policy](https://github.com/payloadcms/payload/blob/main/docs/migration-guide/versioning.mdx).

Tests:

- Unit test for the `hasMany` number message.
- e2e tests for the Group by button with a nested field and with a
nested `label: false` field. The first fails on `main` with `Group by
[object Object]`.
- e2e test for the sort button labels with a locale-record field label.

3.x port: [#19209](#19209)

---------

Co-authored-by: German Jablonski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants