Fix video controls, reaction scroll loss, and PHP warning#604
Merged
Conversation
- Add missing `controls` attribute and `</video>` closing tag for video attachments in ActivityPub and Microformats feed parsers (#602, #588) - Replace window.location.reload() with in-place DOM updates for reactions to preserve scroll position (#589) - Guard against undefined 'friend' array key in dashboard widget loop (#597)
Test this PR in WordPress PlaygroundYou can test this pull request directly in WordPress Playground: This will install and activate the plugin with the changes from this PR. |
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.
Summary
I looked at the open issues and found three that are fixable for the 4.0 release:
Video controls not visible (Video controls not visible and no way to play video except if activate and disable picture-in-picture #602, Video from Mastodon in Feed - only preview image shown #588): I added the missing
controlsattribute to<video>tags in the ActivityPub attachment path and the Microformats parser. The detailed video handler already hadcontrols="controls"but the simpler attachment fallback was missing it. I also added the missing</video>closing tag which was causing invalid HTML.Page reloads on setting reaction (Friends feed page reloading on setting reaction #589): I replaced
window.location.reload()in both reaction handlers with in-place DOM updates. Toggling an existing reaction now updates the count and pressed state directly. Picking a new reaction from the emoji picker either increments an existing button or inserts a new one. This preserves scroll position so you don't lose your place in the feed.PHP warning "Undefined array key 'friend'" (Warning when updating a feed #597): I added a
! empty()guard when iterating dashboard widgets, since widget entries may not always have a'friend'key (e.g. format-only widgets). This matches the pattern already used elsewhere in the same file.I also looked at the other open issues — #595 is already fixed, #569 is already fixed in the current code, and the rest (#596, #555, #590, #564, #558, #570) are either user-specific config/cron issues or need deeper architectural work.
Closes #602, closes #588, closes #589, closes #597
Test plan
WordPress Playground: https://playground.wordpress.net/#{%22steps%22:[{%22step%22:%22installPlugin%22,%22pluginData%22:{%22resource%22:%22git:directory%22,%22url%22:%22https://github.com/akirk/friends%22,%22ref%22:%22fix/issue-fixes-for-4.0%22,%22refType%22:%22branch%22},%22options%22:{%22activate%22:true}}]}