Repository navigation
Themes: Restore the browse URL when re-selecting the active tab. - #16200
umeshnevase wants to merge 1 commit into
Conversation
On Appearance > Add Themes, opening the feature filter drawer from a browse tab such as Favorites strips `?browse=` from the URL. Clicking the still-active tab afterward closed the drawer but returned early, leaving the URL stuck at `theme-install.php`. Update the URL to match the active tab when `onSort()` bails because the tab is already active. Add a QUnit test, and load the real `theme.js` in the QUnit suite, with its screen initialization disabled, so it can be tested.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
On Appearance > Themes > Add New, opening the Feature Filter drawer from a browse tab such as Favorites strips
?browse=from the URL (moreFilters()navigates to the baretheme-install.php) but leaves the tab marked as active. Clicking the same tab again closes the drawer, butonSort()returns early because the tab is already active, so the URL stays attheme-install.phpinstead of returning totheme-install.php?browse=favorites.This updates the router URL in that early-return branch of
themes.view.Installer.onSort(), so the URL matches the active tab again. When the URL already matches,Backbone.history.navigate()does nothing.Steps to reproduce (before the fix):
theme-install.php?browse=favorites).theme-install.php).Expected: the URL returns to
theme-install.php?browse=favorites.Actual: the drawer closes, but the URL stays at
theme-install.php.Tests:
Theme Installer sorting, that clicks the active tab with the drawer open. It asserts that the URL is restored and the drawer is closed. It fails without the fix.tests/qunit/index.htmlnow loads the realtheme.js, because the existing theme QUnit file only tested a mock. It stops the screen from booting on DOM ready, because that interfered with the TinyMCEwptextpatterntests.npx grunt qunitpasses: 716 of 716.Trac ticket: https://core.trac.wordpress.org/ticket/66798
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5.5
Used for: Reproducing the issue in the browser, identifying the cause, drafting the fix and the QUnit test, and drafting this description. I reviewed the changes and ran the tests.