Make WordPress Core

Opened 9 months ago

Closed 8 months ago

#63243 closed defect (bug) (fixed)

Long user display names overflow container on Edit Media screen

Reported by: sainathpoojary's profile sainathpoojary Owned by: audrasjb's profile audrasjb
Milestone: 6.9 Priority: normal
Severity: minor Version:
Component: Media Keywords: has-patch has-test-info dev-feedback
Focuses: ui, css, administration Cc:

Description

When a user has a very long display name with no spaces (e.g. ThisIsAReallyLongDisplayNameWithNoBreaksWhatsoever), it causes layout overflow on the Edit Media screen (wp-admin/post.php?post=ID&action=edit for media attachments).

Steps to Reproduce

  1. Create a user with a very long display name (no spaces or breakable characters), e.g.: ThisDisplayNameIsUnreasonablyLongAndBreaksTheLayoutOfEditMediaScreen
  2. Set "Display name publicly as" to the long name.
  3. Log in as that user.
  4. Navigate to "Media" → "Add New" and upload a media file.
  5. Click "Edit" on the uploaded media item to open the Edit Media screen.
  6. Observe that the "Uploaded by" field overflows or breaks the layout due to the long display name.

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.28
  • Server: nginx/1.27.4
  • Database: mysqli (Server: 8.4.4 / Client: mysqlnd 8.2.28)
  • Browser: Chrome 135.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.1
  • MU Plugins: None activated
  • Plugins: Test Reports 1.2.0

Screenshot

https://rioudcpuyg.ufs.sh/f/PL8E4NiPUWyO7zjhzy9AWOSNT8iuxYqzcvCVIEKbQmF3njPo

Attachments (1)

image (2).png (116.5 KB) - added by renishsurani 9 months ago.
Test result screenshot

Download all attachments as: .zip

Change History (26)

This ticket was mentioned in PR #8658 on WordPress/wordpress-develop by @sainathpoojary.


9 months ago
#1

  • Keywords has-patch added

Fixes layout overflow on the Edit Media screen when a user has an excessively long display name. Applies word-break: break-all; to ensure proper wrapping in the “Uploaded by” section.

Before:
https://github.com/user-attachments/assets/fb0cafbb-8425-4c7a-bf45-997f6c92d8b2

After:
https://github.com/user-attachments/assets/1bcb172e-05ab-4ccf-a03d-38ba7f39c2d9

Trac ticket: #63243

#2 @audrasjb
9 months ago

  • Milestone changed from Awaiting Review to 6.9
  • Owner set to audrasjb
  • Status changed from new to reviewing
  • Version trunk deleted

@audrasjb commented on PR #8658:


9 months ago
#3

Thanks for the patch.
I'd suggest to apply this CSS rule to the container .misc-pub-section misc-pub-uploadedby instead of the link.

#4 @audrasjb
9 months ago

  • Keywords changes-requested added

Thanks for the ticket and patch. I suggested some changes in the PR.

#5 @sainathpoojary
9 months ago

Hi @audrasjb,

I’ve applied the CSS rule to .misc-pub-section .misc-pub-uploadedby instead. When you have a moment, I’d appreciate it if you could take a look.

Thanks again for the review!

#6 @sabernhardt
9 months ago

  • Component changed from Administration to Media
  • Focuses administration added
  • Keywords changes-requested removed

You made the requested changes, but using the word-wrap-break-word class instead is another possibility:
<div class="misc-pub-section misc-pub-uploadedby word-wrap-break-word">

@renishsurani
9 months ago

Test result screenshot

#7 @renishsurani
9 months ago

Test Report

Patch tested: https://core.trac.wordpress.org/ticket/63243

Test Environment [Playground]

  • WordPress: 6.9-alpha-20250408.024349
  • PHP: 7.4.31-dev
  • Server: PHP.wasm
  • Database: WP_SQLite_Translator (Server: 5.5 / Client: 3.40.1)
  • Browser: Chrome 135.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.1
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

The "Uploaded by" field overflows text was looks fixed and displayed as expected.

Test result Screenshot - https://core.trac.wordpress.org/attachment/ticket/63243/image%20(2).png

#8 follow-up: @sainathpoojary
9 months ago

Thanks, @sabernhardt, for the feedback. Using the predefined word-wrap-break-word class does seem like a better approach. Should we also make misc-pub-filename consistent and apply word-wrap-break-word to it as well? If so, should we also remove the misc-pub-filename class name from this section?

#9 in reply to: ↑ 8 @sabernhardt
9 months ago

Should we also make misc-pub-filename consistent and apply word-wrap-break-word to it as well?

In #55393, I apparently chose not to add the new class to the filename's element, which already wrapped the overflow with the misc-pub-filename class. If changing that is desirable, however, it would belong on a separate ticket (as an enhancement).

This ticket was mentioned in Slack in #core-test by oglekler. View the logs.


9 months ago

#11 @SirLouen
9 months ago

#63260 was marked as a duplicate.

#12 @SirLouen
9 months ago

  • Keywords changes-requested added; has-patch removed

@sainathpoojary I sent you a review of the code, I believe that just with what @sabernhardt proposed is enough to sort this issue and move it over to review.

#13 @SirLouen
9 months ago

  • Keywords has-patch dev-feedback added; changes-requested removed

@audrasjb everything ready for review.
I think this can go easily into 6.8.1

#14 follow-up: @audrasjb
9 months ago

  • Keywords commit added; dev-feedback removed

Given this issue wasn't introduced in 6.8 cycle, the better we can do is to include this fix for 6.8.3 or 6.8.4.
6.8.2 will most probably be reserved for urgent bugfixes directly related to 6.8/6.8.1.
Keeping it in 6.9 for now.

#15 @audrasjb
9 months ago

  • Keywords commit removed

@valentingrenier commented on PR #8658:


8 months ago
#16

## Test Report

Patch tested: https://core.trac.wordpress.org/ticket/63243

### Environment

  • OS: macOS 15.5
  • Web Server: nginx/1.27.5
  • PHP: 8.2.28
  • WordPress: 6.9-alpha-60093-src
  • Browser: Chrome 136
  • Theme: Twenty Twenty-Five

### Actual Results

  • Attachment detail: Long username is correctly wrapped ✅
  • Media Library (grid view): Long username is correctly wrapped ✅
  • Edit Media: Long username is not wrapped ❌

### Screenshots

#### Attachment detail ✅

https://github.com/user-attachments/assets/64488ca1-aab2-4873-ba40-557462263453

#### Media Library(grid view) ✅

https://github.com/user-attachments/assets/98290f3b-b862-4cc7-8132-b65dc0ba3854

#### Edit Media ❌

https://github.com/user-attachments/assets/9d3caf82-cd1b-4c49-9059-d0fe8ac8b007

@valentingrenier commented on PR #8658:


8 months ago
#17

## Test Report

Patch tested: https://core.trac.wordpress.org/ticket/63243

### Environment

  • OS: macOS 15.5
  • Web Server: nginx/1.27.5
  • PHP: 8.2.28
  • WordPress: 6.9-alpha-60093-src
  • Browser: Chrome 136
  • Theme: Twenty Twenty-Five

### Actual Results

  • Attachment detail: Long username is correctly wrapped ✅
  • Media Library (grid view): Long username is correctly wrapped ✅
  • Edit Media: Long username is not wrapped ❌

### Screenshots

#### Attachment detail ✅

https://github.com/user-attachments/assets/64488ca1-aab2-4873-ba40-557462263453

#### Media Library (grid view) ✅

https://github.com/user-attachments/assets/98290f3b-b862-4cc7-8132-b65dc0ba3854

#### Edit Media ❌

https://github.com/user-attachments/assets/9d3caf82-cd1b-4c49-9059-d0fe8ac8b007

@valentingrenier commented on PR #8658:


8 months ago
#18

## Test Report

Patch tested: https://core.trac.wordpress.org/ticket/63243

### Environment

  • OS: macOS 15.5
  • Web Server: nginx/1.27.5
  • PHP: 8.2.28
  • WordPress: 6.9-alpha-60093-src
  • Browser: Chrome 136
  • Theme: Twenty Twenty-Five

### Actual Results

  • Attachment detail: Long username is correctly wrapped ✅
  • Media Library (grid view): Long username is correctly wrapped ✅
  • Edit Media: Long username is not wrapped ✅

### Steps to validate the fix

Add this CSS rule in /wp-admin/css/common.css.

.misc-pub-section {
	padding: 6px 10px 8px;
	word-wrap: break-all;
}

### Screenshots

#### Attachment detail

https://github.com/user-attachments/assets/5fcee47c-82c4-4826-9a75-a34b53d3c642

#### Media Library (grid view)

https://github.com/user-attachments/assets/c8d88715-8ad1-4d6e-aef6-a8658de38bcf

#### Edit Media

https://github.com/user-attachments/assets/013f2b87-f1a5-4440-aa79-81e30c95c820

#19 @valentingrenier
8 months ago

Sorry for spamming, first contributions 😁

Only the last comment should be taken into consideration.

#20 in reply to: ↑ 14 ; follow-up: @SirLouen
8 months ago

@valentingrenier to avoid this my recommendation is never using Github for test reporting but using Trac. Have GH used exclusively for code reviews.

Also, yesterday we were discussing this in dev-chat, what has motivated you to test a patch that doesn't have a needs-testing keyword?

Replying to audrasjb:

Given this issue wasn't introduced in 6.8 cycle, the better we can do is to include this fix for 6.8.3 or 6.8.4.
6.8.2 will most probably be reserved for urgent bugfixes directly related to 6.8/6.8.1.
Keeping it in 6.9 for now.

Wondering how you are going to remember this when the time comes 🤔

Also why 6.8.3 has not been already opened?

Last edited 8 months ago by SirLouen (previous) (diff)

#21 follow-up: @valentingrenier
8 months ago

A list of needs testing tickets have been shared during the contributors day by @audrasjb. We were not asked to look at dev-chat before, but I'll have a look the next times.

#22 in reply to: ↑ 21 @SirLouen
8 months ago

  • Keywords has-test-info dev-feedback added

Replying to valentingrenier:

A list of needs testing tickets have been shared during the contributors day by @audrasjb. We were not asked to look at dev-chat before, but I'll have a look the next times.

Ok np, I was just surveying.

Maybe you could be interested in our patch-testing-scrub every Monday @ 5PM CET (Slack #core-test channel)

#23 in reply to: ↑ 20 @audrasjb
8 months ago

Replying to SirLouen:

Also why 6.8.3 has not been already opened?

It has been decided a few weeks ago to only open the next milestone and not the other following ones.

This ticket was mentioned in Slack in #core by sirlouen. View the logs.


8 months ago

#25 @audrasjb
8 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 60266:

Media: Fix overflow of long user display names on Edit Media screen.

This changeset resolves an issue where long usernames in the media uploader modal would overflow their container. By adding the dedicated word-wrap-break-word class, usernames now properly break into multiple lines.

Follow-up to [59834], [59835].

Props sainathpoojary, audrasjb, sabernhardt, renishsurani, SirLouen, valentingrenier.
Fixes #63243.

Note: See TracTickets for help on using tickets.