Fix(window): refine page-title-action button redundancy and layout positioning - #443
Open
CookieDarb wants to merge 1 commit into
Open
Fix(window): refine page-title-action button redundancy and layout positioning#443CookieDarb wants to merge 1 commit into
CookieDarb wants to merge 1 commit into
Conversation
…sitioning - Extract and pass absolute submenu tab URLs from PHP into the chromeless bridge configuration payload. - Update the chromeless iframe bridge MutationObserver to dynamically intercept and remove redundant `.page-title-action` buttons that match window tabs before they paint. - Enforce strict `action` query parameter matching for `admin.php` routing to prevent false-positive removals of action buttons (e.g., WooCommerce's 'Add order' button). - Apply a universal block-clearing layout format to `.page-title-action` in chromeless.css to prevent inline wrapping next to `.subsubsub` filter links on non-tabbed pages. - Remove the redundant page-specific `.themes-php` CSS override since it is now dynamically covered by the URL matcher. - Add test coverage in desktopModeRender.php to verify submenu URLs are successfully extracted and injected into the chromeless config. - Update technical documentation (docs/plugin-compat-layer.md) and inline code comments to align with the new MutationObserver-based button matching architecture.
CookieDarb
marked this pull request as ready for review
July 29, 2026 07:08
AllTerrainDeveloper
requested changes
Jul 29, 2026
Contributor
Author
Collaborator
|
No worries :) I think we can dedupe for now, the Add Post would be just a few pixels far away from where the original button was. Let's deal with the change, deduping is always nice. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What?
Closes #391
This PR proposes a proposal to refine the visual experience of in-page action buttons (like "Add New", "Add Post", "Add User") in Desktop Mode. It removes these buttons when they duplicate tabs in the window header, and correctly positions them on their own row when they are kept.
Why?
Having an in-page "Add New" button is redundant when the window already has a dedicated tab for the same action in the top header. Additionally, it floats awkwardly next to filter links without breathing room unless an admin notice pushes it onto its own line. This proposal makes the experience cleaner and more consistent.
How?
includes/render/chromeless-bridge.php:desktop_mode_dock_itemfilter to ensure custom tabs like "Add Theme" are included).MutationObserverto intercept.page-title-actionelements and remove them if their destination matches a tab URL (comparing pathnames and query parameters likepost_type,taxonomy,page, andaction).assets/css/chromeless.css:themes.php..page-title-actionto ensure preserved buttons always clear filter links and sit on their own row.tests/phpunit/tests/desktopModeRender.php:docs/plugin-compat-layer.md:Testing Instructions
edit.php) in Desktop Mode. Verify that the in-page "Add New" button is removed (since it matches the "Add New" tab).themes.php). Verify that the "Add Theme" button is removed (since it matches the "Add Theme" tab).Screenshots
1. When tab is present
2. When tab is present + admin notice
3. When tab is absent (WooCommerce Orders list)
4. When tab is absent (WooCommerce Coupons list)
Use of AI Tools
AI assistance: Yes
Tool(s): Antigravity
Model(s): Gemini
Used for: Reviewing the existing implementation and suggesting the changes. Final decisions and edits were made by me.