payloadcms / payloadcms/payload

Folder list view (FolderFileTable): show image thumbnails instead of the generic DocumentIcon

Open Beginner friendly
#17,964 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
TypeScript
Stars
44.8k
Forks
4.2k
Avg merge
2d 21h
Merged PRs (30d)
53

Description

Describe the improvement

Show image thumbnails in the folder list view (FolderFileTable) instead of the generic DocumentIcon.

The folder grid view renders image previews on its item cards, but the folder list view (FolderFileTable in @payloadcms/ui) renders the same generic DocumentIcon for every document row. When browsing image-heavy media folders in list view, there is no way to tell images apart without opening each one.

Suggested solution

In the first column cell of FolderFileTable: when the row's mimeType starts with image/ and the row has a url, render the image (lazy-loaded) instead of the DocumentIcon — the same data the grid cards already use. Alternatively (or additionally): make the first-column cell renderer overridable via a component slot, so projects can customize it without patching.

Current workaround

We maintain a patch-package patch for exactly this and would love to drop it. The readable part (the same change is repeated in the prebuilt dist/exports/client bundle, which the admin actually loads):

--- a/node_modules/@payloadcms/ui/dist/elements/FolderView/FolderFileTable/index.js
+++ b/node_modules/@payloadcms/ui/dist/elements/FolderView/FolderFileTable/index.js
@@ -205,7 +205,12 @@ export function FolderFileTable(t0) {
             if (index_1 === 0) {
               return _jsxs("span", {
                 className: `${baseClass}__cell-with-icon`,
-                children: [_jsx(DocumentIcon, {}), cellValue_0]
+                children: [typeof value_0.mimeType === "string" && value_0.mimeType.startsWith("image/") && value_0.url ? _jsx("img", {
+                  alt: "",
+                  className: `${baseClass}__thumbnail`,
+                  loading: "lazy",
+                  src: value_0.url
+                }) : _jsx(DocumentIcon, {}), cellValue_0]
               }, `${itemKey_0}-${name_1}`);

Plus a few lines of CSS for .folder-file-table__thumbnail (fixed size, object-fit: cover).

Environment
  • Payload: 3.86.0 (@payloadcms/ui 3.86.0, @payloadcms/db-postgres)
  • Next.js 16, Node 24

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the @payloadcms/ui FolderFileTable first-column cell renderer and compare it with the existing folder grid image preview behavior. Add the image thumbnail styling and account for the prebuilt dist/exports/client bundle mentioned in the issue. Done means image rows with a URL show lazy-loaded thumbnails in list view while non-image rows retain DocumentIcon behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, react, typescript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
86/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.