Opened 6 years ago
Last modified 4 years ago
#44900 new enhancement
add post lock display to Media Library
Reported by: | pbiron | Owned by: | |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | |
Component: | Media | Keywords: | has-patch has-screenshots needs-design |
Focuses: | ui, administration | Cc: |
Description
WP_Posts_List_Table
shows which posts are currently being edited by other users (screenshot coming).
WP_Media_List_Table
should do so as well (screenshot coming).
Much of the support for post locks on media already exists in core:
- when media is edited (in list mode, see below for discussion on grid mode), core already correctly updates the
_edit_lock
and_edit_last
postmetas for the attachment - both ends of the "Take Over" modal dialog already function as expected when editing media (screenshots coming)
To support post locks for media several other things need to happen:
- add the appropriate markup to the output of
WP_Media_List_Table
(in list mode, see below for discussion on grid mode) /wp-admin/upload.php
needs to enqueue:- the Heartbeat API
- JS that uses the Heartbeat API to update the post lock display
A patch that does the above is coming shortly.
As hinted at above, handling post locks in grid mode will require more work:
- design work will be needed for how to display the fact that there is a post lock in grid mode (screenshot coming)
- once that design work is done then code (probably JS) will need to be written to implement the design
- several changes will be needed to the "Attachment Details" screen that comes up when an attachment is clicked on from grid mode:
- the
_edit_lock
and_edit_last
postmetas will need to be updated when the user enters this screen - some JS based on the Heartbeat API will need to check for newly acquired post locks and fire the "Take Over" modal dialog
- I think the previous item will take care of things when the user clicks on the "Edit Image" button from the "Attachment Details" screen, but that remains to be seen
- Note: when a user clicks on the "Edit more details" link the existing core functionality and the changes to list mode above take over and no more changes are needed to handle that
- the
I'm unfamiliar with the JS-side of grid mode so at this point can't provide a patch for those changes, but would gladly help someone else work on that (if only so I can learn that JS piece).
Attachments (7)
Change History (24)
#1
follow-up:
↓ 3
@
6 years ago
44900-list-mode.diff covers the needed changes for list mode.
Of note is that the new /wp-admin/js/post-lock.js
file (heartbeat API code to update the display when post locks change) is extracted from /wp-admin/js/inline-edit-post.js
. If this ticket is accepted I would suggest removing that code from inline-edit-post.js
(so that it only truly handles the inline editing stuff) and having /wp-admin/edit.php
enqueue the new post-lock.js
file in addition to inline-edit-post.js
.
#2
@
6 years ago
disregard taken-over.2.png. I accidentally uploaded the same image twice. take-over.png is what I had meant to upload for "this show the other end of the "Take Over" modal dialog for media".
#3
in reply to:
↑ 1
@
6 years ago
Replying to pbiron:
44900-list-mode.diff covers the needed changes for list mode.
Also note that in order to test this, after applying the patch you'll need to run grunt
to move the new post-lock.js
file into the correct location.
#4
follow-up:
↓ 5
@
5 years ago
- Milestone changed from Awaiting Review to Future Release
Hi @pbiron,
I think this would be a really nice enhancement. I'm going to mark it for a future release for now, but let's consider it for 5.3 if you're up for seeing it through.
#5
in reply to:
↑ 4
@
5 years ago
Replying to joemcgill:
I think this would be a really nice enhancement. I'm going to mark it for a future release for now, but let's consider it for 5.3 if you're up for seeing it through.
I'm definitely up for it...although I'm pretty swamped for the next month or so, thus it depends on when 5.3-beta1 will be.
As mentioned, I'll need help with the grid mode JS. It would also be helpful if you could wrangle some design input ASAP.
This ticket was mentioned in Slack in #core-media by pbiron. View the logs.
5 years ago
This ticket was mentioned in Slack in #design by pbiron. View the logs.
5 years ago
This ticket was mentioned in Slack in #core-media by pbiron. View the logs.
5 years ago
#10
@
5 years ago
When someone is editing a post and they are managing an image, I believe that any changes made there (to the title, alt text, etc.) are currently saved to the attachment and are not specific to the current post.
If post locking were to be implemented for attachments, the images should probably also be locked in the post edit context as well. This would need to be explored in both the block editor and Classic Editor contexts (for backwards compatibility).
#11
@
5 years ago
thanx for the comment @desrosj. I thought that's what you were referring to in slack.
I think that the changes required for grid mode, covered in this ticket's description
- several changes will be needed to the "Attachment Details" screen that comes up when an attachment is clicked on from grid mode:
- the _edit_lock and _edit_last postmetas will need to be updated when the user enters this screen
will cover the case of an image edited from the within the post edit context, since it uses the same JS as the grid mode does.
But once the design work for grid mode is done and I dig in to implement the changes to the media JS I'll be sure to verify that the above supposition is actually true.
This ticket was mentioned in Slack in #design by pbiron. View the logs.
5 years ago
#13
@
5 years ago
- Keywords needs-design added; needs-design-feedback removed
Changing the keyword back from needs design feedback to needs design.
As this ticket is in need for a design for the media grid mode when locked. Would also be good to get some design eyes on the list mode, as this is a little different from post lists mode, since it has a thumbnail.
Great project for a starting design contributor to make some suggestions in mockups.
this is how WP_Posts_List_Table displays post locks