Chromeless: keep Quick Edit and Bulk Edit alive across a soft reload - #502
Open
mmtr wants to merge 1 commit into
Open
Chromeless: keep Quick Edit and Bulk Edit alive across a soft reload#502mmtr wants to merge 1 commit into
mmtr wants to merge 1 commit into
Conversation
The soft reload replaced #wpbody-content wholesale, and Core's inline editors bind inside it rather than delegating on document. The swap threw away the elements those handlers were bound to, so Quick Edit, Bulk Edit and the comment inline editors kept rendering, kept taking focus, and did nothing from the first content-change broadcast onward. Keep the #wpbody-content node and swap only its children, then re-run Core's own init entry points before dispatching os-soft-reloaded. Fixes #419 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Fixes #419
Proposed changes
Quick Edit, Bulk Edit, the comment inline editors and the comment row actions keep working in classic list windows after the list soft-reloads itself.
Two affordances stay degraded and are noted in the code: an empty bulk action submits instead of showing "Please select at least one item", and the search box no longer clears a stale value on mousedown.
Why are these changes being made?
The soft reload added in #388 replaced the whole list body. Core's inline editors bind inside it, so the swap left them dead: the buttons still render and take focus, and clicking does nothing.
It only starts after the first content-change broadcast, so a freshly opened window works and then quietly stops. Any change on the site triggers it, including ones made by another user or a background process, which is why it reads as "Quick Edit doesn't work" rather than "Quick Edit broke after I did X".
Testing instructions
Native Posts and Pages windows must stay off (the default) so these windows render as classic iframes: OpenStation Settings > Features.
Pages:
wp.os.broadcast( 'os.page.changed', { source: 'test', action: 'updated', ids: [ 2 ] } ). The list updates in place, no spinner.Posts, for Bulk Edit:
os.post.changedas above, then repeat. Make sure it still opens, with exactly one Categories column and one Tags field.Comments (switch the native Comments window off in OpenStation Settings > Features to get the classic screen):
os.comment.changed.Narrow windows: