Repository navigation
style(ui): align collection cards with dashboard tiles - #18358
Merged
Merged
Conversation
Contributor
📦 esbuild Bundle Analysis for payloadThis analysis was generated by esbuild-bundle-analyzer. 🤖
Largest pathsThese visualization shows top 20 largest paths in the bundle.Meta file: packages/next/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_index.json, Out file: esbuild/index.js
Meta file: packages/payload/meta_shared.json, Out file: esbuild/exports/shared.js
Meta file: packages/richtext-lexical/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_client.json, Out file: esbuild/exports/client_optimized/index.js
Meta file: packages/ui/meta_shared.json, Out file: esbuild/exports/shared_optimized/index.js
DetailsNext to the size is how much the size has increased or decreased compared with the base branch of this PR.
|
GermanJablo
marked this pull request as ready for review
September 29, 2026 19:49
GermanJablo
requested review from
AlessioGr,
JarrodMFlesch and
jacobsfletch
as code owners
September 29, 2026 19:49
Member
JessRynkar
reviewed
Sep 30, 2026
GermanJablo
enabled auto-merge (squash)
September 30, 2026 17:18
JessRynkar
previously approved these changes
Oct 1, 2026
JessRynkar
approved these changes
Oct 1, 2026
Contributor
|
🚀 This is included in version v4.0.0-canary.38 |
This was referenced Oct 27, 2026
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]>
This was referenced Oct 29, 2026
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Redacted with AI
Summary
Align the dashboard Collection Cards with the primary tile design for PYLD-4165 and give all
.cardwidgets the same surface.Changes
.cardclass so other dashboard widgets match.cardrecommendation in the dashboard documentation and cover the shared surface in the dashboard E2E test.Design
Admin previews
Three collections, desktop
Create action on hover
Narrow viewport with two columns
Shared card style across the dashboard fixture