Fix Recycle Bin Sync - #432
Merged
AllTerrainDeveloper merged 4 commits intoJul 28, 2026
Merged
Conversation
- Inject captured post types from PHP to JS (shell config and local config) - Refactor Recycle Bin window and Dock Badge to subscribe dynamically to changes in these post types - Map post types to My WordPress entities using a new 'post_type' attribute - Broadcast trash events from My WordPress and listen to external changes to trigger debounced refreshes - Update hooks documentation to explain 'post_type' usage for custom post types
- Verify My WordPress subscribes to mapped post types and debounces refresh on broadcast - Verify Dock Badge dynamically registers custom post type listeners from config - Assert post type property mappings on My WordPress entity array in PHPUnit - Assert shell config filter and localized scripts include captured post types
- Subscribe to cross-window broadcast change signals in the root view. - Reactively refresh folder counters without a page reload.
CookieDarb
marked this pull request as ready for review
July 28, 2026 10:43
AllTerrainDeveloper
approved these changes
Jul 28, 2026
AllTerrainDeveloper
left a comment
Collaborator
There was a problem hiding this comment.
Wonderful! Thanks again for your contributions!
Screen.Recording.2026-07-28.at.16.05.25.mov
AllTerrainDeveloper
enabled auto-merge (squash)
July 28, 2026 14:09
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 #421
Fixes cross-window live sync for Recycle Bin and My WordPress when items (posts, pages, media, and custom post types) are trashed, restored, or permanently deleted.
Why?
Previously, dragging an item into the Recycle Bin or restoring an item while My WordPress was open did not trigger cross-window updates. Additionally, broadcast topic subscriptions were hardcoded to built-in post types (
post,page,attachment), leaving custom post types and My WordPress root folder counters out of sync until a manual page reload.How?
includes/my-wordpress/window.php&src/my-wordpress/types.ts:post_typeattribute to default entities (post,page,attachment) and updatedMyWordPressEntityinterface so custom post types can register their post type slug viadesktop_mode_my_wordpress_entities.includes/recycle-bin/window.php:recycleBinPostTypesintodesktopModeConfigfromdesktop_mode_recycle_bin_capture_post_types().src/recycle-bin/badge.ts&src/recycle-bin/index.ts:desktop-mode.<post_type>.changed) for all registered post types.src/recycle-bin/rest.ts:untrashed/deleted) upon successful restore or permanent deletion REST requests.src/my-wordpress/index.ts:renderRootto dynamically update entity folder counters (e.g.,Posts · X,Pages · Y).docs/hooks-reference.md:post_typeproperty indesktop_mode_my_wordpress_entitiesfilter reference.tests/:my-wordpress-sync.test.ts,recycle-bin-badge-subscriptions.test.ts) for broadcast subscriptions and debouncing.myWordpress.phpandrecycleBinStore.phpverifying entity schemas and localized script configurations.Testing Instructions
Screencast
Screen.Recording.2026-07-28.at.3.57.39.PM.mov
Use of AI Tools
AI assistance: Yes
Tool(s): Antigravity
Model(s): Gemini
Used for: Reviewing the existing implementation, evaluating approaches and suggesting the changes. Final decisions and edits were made by me.