Skip to content

fix: use consistent empty state styling between list and folder views#15555

Merged
PatrikKozak merged 6 commits into
payloadcms:mainfrom
AhmadYasser1:fix/ui-empty-list-folder-view-styling
Feb 17, 2026
Merged

fix: use consistent empty state styling between list and folder views#15555
PatrikKozak merged 6 commits into
payloadcms:mainfrom
AhmadYasser1:fix/ui-empty-list-folder-view-styling

Conversation

@AhmadYasser1
Copy link
Copy Markdown
Contributor

@AhmadYasser1 AhmadYasser1 commented Feb 9, 2026

What?

Uses the shared NoListResults component in the list view empty state, matching the styling already used by the folder and browse-by-folder views.

Why?

The empty state for the list view (left-aligned, no border) looks completely different from the folder view empty state (centered, dashed border). This inconsistency was reported in #15524.

How?

  • Replaced the inline collection-list__no-results div in DefaultListView with the existing NoListResults component from elements/NoListResults
  • Removed the now-unused &__no-results SCSS block from List/index.scss
  • Updated e2e test selectors from .collection-list__no-results to .no-results

Before

Screenshot 2026-02-13 at 1 48 40 PM Screenshot 2026-02-13 at 1 48 48 PM

After

Screenshot 2026-02-17 at 3 34 37 PM Screenshot 2026-02-17 at 3 34 43 PM

Fixes #15524

…iews

Replaces the inline no-results div in the list view with the shared
NoListResults component already used by folder and browse-by-folder
views. This ensures both views render the same centered, bordered
empty state container when a collection has no documents.

Removes the now-unused .collection-list__no-results SCSS block and
updates e2e test selectors to match the new .no-results class name.

Fixes payloadcms#15524
@PatrikKozak
Copy link
Copy Markdown
Contributor

Hey @AhmadYasser1!

Thanks for opening this PR, I pulled it down and everything was looking good but I decided to take the updated empty state styling a bit further - I think it looks a bit cleaner now.

You can see the updated styles in the before & after images I added in the PR description.

Once CI passes, we'll get this merged.

Thanks again!

Comment thread packages/translations/src/languages/de.ts Outdated
@PatrikKozak PatrikKozak changed the title fix(ui): use consistent empty state styling between list and folder views fix: use consistent empty state styling between list and folder views Feb 13, 2026
@AhmadYasser1
Copy link
Copy Markdown
Contributor Author

Thanks @PatrikKozak and @jhb-dev!

Since CI passed, are we good to merge?

@PatrikKozak PatrikKozak merged commit 8953b37 into payloadcms:main Feb 17, 2026
297 of 300 checks passed
@AhmadYasser1 AhmadYasser1 deleted the fix/ui-empty-list-folder-view-styling branch February 18, 2026 14:52
@github-actions
Copy link
Copy Markdown
Contributor

🚀 This is included in version v3.77.0

PatrikKozak added a commit that referenced this pull request Mar 11, 2026
…5914)

# Overview

Applies the same empty state styling fix from #15555 to the
`RelationshipTable` component.

## Key Changes

- Replaced inline empty state div with shared `NoListResults` component
- `RelationshipTable` was using its own inline implementation with
different styling
- Now uses the same centered, dashed-border design as List, Folder, and
Browse-by-Folder views

- Restructured empty state to use `Message` and `Actions` props
  - Message includes heading ("No Results.") and description
- Actions conditionally includes the AddNewButton when user has create
permission

## Design Decisions

Follows the exact pattern from #15555 where all list views were
standardized to use the `NoListResults` component. `RelationshipTable`
was missed in that PR and had the same inconsistent left-aligned,
no-border styling.

The shared component ensures visual consistency across all empty states
in the admin UI.

### Before
<img width="1329" height="142" alt="Screenshot 2026-03-11 at 1 53 19 PM"
src="https://github.com/user-attachments/assets/f85284a0-8abf-49f7-b6bf-6058e514ad1a"
/>

### After
<img width="1313" height="188" alt="Screenshot 2026-03-11 at 2 23 02 PM"
src="https://github.com/user-attachments/assets/aa84c3b7-ae01-44ae-a767-b2c14a87fe71"
/>
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.

Empty list and folder view differ completely in styling

3 participants