Make WordPress Core

Opened 12 months ago

Closed 8 months ago

#63369 closed defect (bug) (fixed)

Unnecessary vertical space appears on Tags screen when no tags exist

Reported by: sainathpoojary's profile sainathpoojary Owned by: audrasjb's profile audrasjb
Milestone: 6.9 Priority: normal
Severity: normal Version: 3.0
Component: Administration Keywords: has-patch has-test-info dev-feedback
Focuses: ui Cc:

Description

On the Tags admin page (wp-admin/edit-tags.php?taxonomy=post_tag), when no tags exist, a container element intended for bulk actions and pagination is still rendered. Although its child elements are hidden via display: none, the container itself still occupies vertical space.

This results in a visible but functionally empty gap between the tags table and the “Tags can be selectively converted to categories using the tag to category converter.” message, creating a layout inconsistency and an impression that something is missing in that space.

Steps to Reproduce:

  1. Navigate to Posts > Tags in the admin dashboard.
  2. Ensure no tags exist.
  3. Observe the spacing between the table and the “No tags found.” paragraph.

Environment

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

Screenshot

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

Attachments (2)

63369.patch (896 bytes) - added by dilipbheda 12 months ago.
We remove the bottom table navbar section directly within the PHP script instead of simply hiding it with CSS.
fix-63369.png (219.6 KB) - added by dhruvang21 12 months ago.

Download all attachments as: .zip

Change History (22)

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


12 months ago
#1

  • Keywords has-patch added

Hides the bottom tablenav container on taxonomy term list screens when it contains a hidden .tablenav-pages.no-pages element. This prevents unnecessary vertical spacing when no tags exist and improves layout consistency in the admin UI.

Before:

https://github.com/user-attachments/assets/dcb2d809-47c0-4886-a87f-c7d84316a5a9

After:

https://github.com/user-attachments/assets/bf6bab77-53ac-4f36-8af2-7c332064b5c3

Trac ticket: #63369

@dilipbheda
12 months ago

We remove the bottom table navbar section directly within the PHP script instead of simply hiding it with CSS.

#2 @dilipbheda
12 months ago

@sainathpoojary I've attached the patch. Please review it and apply it to your PR.

#3 @sainathpoojary
12 months ago

Thanks for the patch @dilipbheda, I’ve reviewed it and it looks great. It handles the issue more cleanly by skipping the bottom tablenav at the DOM level, which avoids relying on CSS to hide unused markup. I’ll apply it to my PR and update the description accordingly.

Appreciate the contribution!

@abcd95 commented on PR #8757:


12 months ago
#4

I tested the patch and it works fine for me. I can see there is no extra DOM element even after the removal of the tags -

https://github.com/user-attachments/assets/e05d6628-b23e-4f89-8d7a-e3833a4f223e

However, I found this was the immediate state after removing the tags -

https://github.com/user-attachments/assets/c8ebe0e1-4cc4-4126-ba3e-025f27ab450c

Which does not look ideal. Can you maybe create another ticket and handle this issue separately?

@sainathpoojary commented on PR #8757:


12 months ago
#5

Agreed @himanshupathak95, I was able to reproduce the issue as well. I’ll open a separate ticket for it.

#6 @dhruvang21
12 months ago

Test Report

Description

This report validates the patch works as expected.

Patch tested: https://core.trac.wordpress.org/attachment/ticket/63369/63369.patch

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.22
  • Server: nginx/1.27.0
  • Database: mysqli (Server: 8.0.39 / Client: mysqlnd 8.2.22)
  • Browser: Chrome 135.0.0.0
  • OS: Linux
  • Theme: Twenty Ten 4.4
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

#7 @SirLouen
12 months ago

  • Focuses css removed
  • Keywords dev-feedback has-testing-info added
  • Version trunk deleted

#8 @wordpressdotorg
11 months ago

  • Keywords has-test-info added; has-testing-info removed

#9 @SirLouen
10 months ago

  • Keywords dev-feedback removed

@sainathpoojary check reviews when possible.

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

@SirLouen commented on PR #8757:


10 months ago
#10

Agreed @himanshupathak95, I was able to reproduce the issue as well. I’ll open a separate ticket for it.

Which is the other ticket you have opened?

@sainathpoojary commented on PR #8757:


10 months ago
#11

Hey @SirLouen, The other ticket I’ve opened is: #63547

@SirLouen commented on PR #8757:


10 months ago
#12

Hey @SirLouen, The other ticket I’ve opened is: #63547

@SainathPoojary I'm not sure that this ticket is related with this issue. And you are not participating there. Double check it please.

#13 @SirLouen
10 months ago

  • Version set to 3.0

@sainathpoojary commented on PR #8757:


10 months ago
#14

Sorry for the inconvenience caused, @SirLouen. I’ve updated the comment to point to the correct ticket

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


10 months ago

#16 @SirLouen
10 months ago

  • Keywords dev-feedback added
  • Severity changed from normal to trivial

6.9.0 Milestone proposed during today's <bug-scrub>
More information

#17 @audrasjb
10 months ago

  • Milestone changed from Awaiting Review to 6.9

Moving to 6.9 as per previous scrub.

#18 @audrasjb
10 months ago

  • Owner set to audrasjb
  • Status changed from new to reviewing

#19 @audrasjb
9 months ago

  • Severity changed from trivial to normal

#20 @audrasjb
8 months ago

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

In 60613:

Administration: Avoid rendering empty bottom tablenav container when pagination is hidden.

This changeset removes the bottom tablenav container on taxonomy term list screens when it contains a hidden .tablenav-pages.no-pages element, to prevent unnecessary vertical spacing when no tags exist.

Props sainathpoojary, dilipbheda, audrasjb, abcd95, dhruvang21, SirLouen.
Fixes #63369.

Note: See TracTickets for help on using tickets.