Make WordPress Core

Opened 2 months ago

Last modified 20 hours ago

#63372 accepted defect (bug)

Tags page UI inconsistencies when adding or deleting tags

Reported by: sainathpoojary's profile sainathpoojary Owned by: joedolson's profile joedolson
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch has-test-info changes-requested
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 (11)

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


2 months 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
2 months 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://f003.backblazeb2.com/file/wordpress-videos/wp-videos/2025/05/63372.mp4

Last edited 7 weeks ago by SirLouen (previous) (diff)

#3 @joedolson
2 months ago

  • Focuses accessibility added

#4 @wordpressdotorg
2 months ago

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

#5 @sainathpoojary
3 weeks ago

  • Keywords changes-requested removed

Thanks for the detailed test report @SirLouen! I’ve since updated the PR to address all reported issues, and it’s now ready for review.

#6 @SirLouen
3 weeks ago

  • Keywords needs-testing added

#7 @rishabhwp
2 weeks ago

Reproduction Report

Description

This report validates whether the issue can be reproduced.

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 137.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty 2.9
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Error condition occurs (reproduced).

Supplemental Artifacts

https://ifnmp28oya.ufs.sh/f/0nfskUTEKfUZUOlu5SNmYySW2Gs6Vh5nKvcp49ITxeMZNwbA

#8 @yashjawale
2 weeks ago

Test Report

Description

This report validates whether the indicated patch works 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 137.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-One 2.5
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

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

Additional Notes

  • In general, when adding/deleting tags, the pagination doesn't update accordingly. eg. if viewing a fixed number of tags & deleting all of them, the next set of tags don't appear until full page refresh

Supplemental Artifacts

Screencast: https://files.catbox.moe/40dqpy.mov

#9 @SirLouen
2 weeks ago

  • Keywords changes-requested added; needs-testing removed

This ticket was mentioned in Slack in #accessibility by joedolson. View the logs.


20 hours ago

#11 @joedolson
20 hours ago

  • Owner set to joedolson
  • Status changed from new to accepted
Note: See TracTickets for help on using tickets.