[v4] Upload edit view: a wide custom `filePreview` widens the file panel and collapses the fields column
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- css, next.js, react, typescript
- Domain
- frontend
Research direction
Start with the linked packages/ui/src/views/Edit/index.css rules at lines 176–188 and inspect the upload edit layout around .file-manager and .document-fields. Reproduce with the provided reproduction steps using a wide custom filePreview, then check that the file panel stays within its flex share and the fields, including the Alt input, remain visible while the preview scrolls or scales inside the panel.
Written by the indexing model from the issue text.
Description
Describe the Bug
On an upload collection's edit view, when the edit-main container is at least 1024px wide, the file panel (.file-manager) sits next to .document-fields with flex: 2 (views/Edit/index.css#L176-L188). The panel has no min-width: 0, so as a flex item it can't get narrower than its content's min-content width.
A custom preview from upload.admin.components.filePreview whose content has a large intrinsic width pushes the panel past its share. Think of a spreadsheet grid, a document page at 100%, a wide table or a canvas. The fields column then shrinks to nothing. This happens even when the preview scrolls inside its own overflow: auto box.
In the repro with a 1920px window, the row is 1645px wide:
.file-manager |
.document-fields |
Alt input |
|
|---|---|---|---|
| as is | 1645px | 0px | 18px |
.file-manager { min-width: 0 } added |
1097px | 548px | 484px |
The Alt field can't be seen or edited at all. Payload's own previews don't trigger this: the thumbnail scales down, and the PDF iframe has no intrinsic width.
Expected: the panel keeps its flex share whatever the preview renders, and the preview scrolls or scales inside it.
Current:
With min-width:0:
Link to the code that reproduces this issue
https://github.com/VeiaG/payload-4-reproductions/tree/repro-file-panel-widens-with-wide-preview
Reproduction Steps
pnpm install, thenpnpm devinapps/next.- Upload any image to Media and open its edit view in a wide window (≥ 1024px content area).
- The file panel takes the whole width, and the
Altfield column is gone. - In devtools, add
.collection-edit__main-wrapper--has-upload-panel .file-manager { min-width: 0 }. The columns go back to about 2:1, and the preview scrolls inside the panel.
Which area(s) are affected?
area: ui
Environment Info
payload: 4.0.0-beta.7
@payloadcms/ui: 4.0.0-beta.7
@payloadcms/next: 4.0.0-beta.7
next: 16.4.4
Node: 24
Browser: Chrome
- Dominant language
- TypeScript
- Stars
- 45.6k
- Forks
- 4.4k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 237
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from payloadcms/payload
-
plugin-multi-tenant: `isGlobal` collections redirect tenant-scoped users to `/admin` since 3.93.0 (GlobalViewRedirect prop-name mismatch)Possibly taken A pull request linked to this issue is open or already merged. OpenBug plugin: multi-tenant
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19420 ·
Maintainers usually reply within 1 day
-
area: ui Bug created-by: Contributor status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
payloadcms/payload#19413 ·
Maintainers usually reply within 1 day
-
area: ui Bug created-by: Contributor status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
payloadcms/payload#19403 ·
Maintainers usually reply within 1 day
-
area: ui Bug created-by: Contributor status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
payloadcms/payload#19396 ·
Maintainers usually reply within 1 day
-
area: ui Bug created-by: Contributor status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
payloadcms/payload#19395 ·
Maintainers usually reply within 1 day
All issues in payloadcms/payload
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
documentation easy good first issue help wanted
Difficulty 1/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
Billion-context documentation addendum: nudge is independent of window occupancy. | billion-context 文档补充:nudge 与窗口占用无关Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
ranxianglei/billion-context#5893 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
microsoft/monaco-editor#5575 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100