Make WordPress Core

Opened 13 days ago

Last modified 32 hours ago

#63372 new defect (bug)

Tags page UI inconsistencies when adding or deleting tags

Reported by: sainathpoojary's profile sainathpoojary Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch changes-requested has-test-info
Focuses: ui, accessibility, javascript, css Cc:

Description

There are several UI issues on the Tags page in the WordPress admin when adding or deleting tags:

1. "No tags found." message not shown after last tag is deleted:
When all tags are removed using the JavaScript interface, the message "No tags found." does not appear until the page is manually refreshed. Also, the .tablenav sections (top and bottom) are not removed immediately and remain visible until refresh.

2. Bulk action and item count does not reappear when a new tag is added via JS:
If there are no tags and a new tag is added using the input form (handled via JavaScript), the .tablenav sections remain hidden and do not reappear unless the page is refreshed.

3. Pagination count not updated:
When tags are added or deleted via JavaScript and the tag list is paginated, the pagination count is not updated accordingly. This leads to inconsistencies between the actual number of tags and what's shown in the pagination controls.

These issues appear to stem from the fact that while tag creation and deletion are handled client-side via JavaScript, updates to .tablenav visibility and pagination count are handled by PHP and only rendered on full page reload.

Steps to reproduce

  1. Go to Posts > Tags.
  2. Delete all tags using the delete links in the table (handled via JS).
    • Notice that the "No tags found." message does not appear.
    • .tablenav sections remain visible.
  3. Refresh and Add a new tag using the "Add New Tag" form.
    • The new tag appears in the list via JavaScript.
    • However, the .tablenav sections remain hidden and do not reappear.
  4. Add or delete tags while viewing a paginated list.
    • The pagination count does not reflect the updated number of tags.

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

Screencast

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

Change History (4)

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


13 days ago
#1

  • Keywords has-patch added

This PR fixes:

  • Display the "No tags found." message immediately when the last tag is deleted via JavaScript.
  • Hide .tablenav sections when no tags are present.
  • Show .tablenav sections when a new tag is added via JS if none previously existed.
  • Ensure pagination count is updated dynamically when tags are added or removed.

Trac ticket: #63372

#2 @SirLouen
13 days ago

  • Keywords changes-requested has-testing-info added

Combined Reproduction and Patch Test Report

Description

❌ This report can't validate that the indicated patch works completely as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/8761.diff

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: Windows 10/11
  • Theme: Twenty Twenty-One 2.5
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Reproduction Steps

  • Screen Options ⇒ Fixed to Number of items per page (10) for pagination
  • Create some tags
  • Remove all tags
  • 🐞 First bug reproduced (no "No tags found", message)
  • Start adding tags
  • 🐞 Second bug reproduced (tablenav appears)
  • 🐞 Third bug reproduced The number of items don't update
  • 🐞 Extra potential bug: When reaching the fixed number of items per page (10 in my case), pagination doesn't appear when we have more than 10 items, until we refresh.

Expected results

  1. When all tags are removed, "No tags found" should appear
  2. The tablenav should appear as soon as there are new tags to be able to deal with them
  3. The number of items should update every new tag we create
  4. Reaching the Number of items per page, should add a pagination control.

Actual Results with Patch

  1. ✅ "No tags found" appears correctly when all tags removed
  2. tablenav still doesn't appear after adding new tags
  3. ❌ Number of items don't appear
  4. ❌ With a refresh number of items appear, but they don't update with each new tag
  5. ❌ When reaching the "Number of items per page", the pagination control still doesn't appear without refresh.

Additional Notes

Added a screencast to showcase the problems that still exist

Supplemental Artifacts

Screencast: https://streamable.com/zdp0ro

Last edited 13 days ago by SirLouen (previous) (diff)

#3 @joedolson
13 days ago

  • Focuses accessibility added

#4 @wordpressdotorg
32 hours ago

  • Keywords has-test-info added; has-testing-info removed
Note: See TracTickets for help on using tickets.