Opened 4 months ago

Last modified 7 days ago

#23312 new task (blessed)

Post Lock Interface for Post List Screen

Reported by: dh-shredder Owned by:
Priority: normal Milestone: 3.6
Component: Autosave Version:
Severity: normal Keywords: autosave-redo has-patch
Cc:

Description

For 3.6, we'd like to improve the experience for users with post locks!

For the Post List screen, we'd like to:

  • Make it easy for users to tell which posts are locked directly from the post list screen.
  • Realtime lock update using Heartbeat API (#23216)

Maybe:

  • Make it visible which user holds the lock
  • Meta editing allowed while post is locked

Attachments (17)

lock_16x16x32.png (335 bytes) - added by dh-shredder 4 months ago.
Temporary Lock Icon. Source: CC0: http://thenounproject.com/noun/lock/#icon-No9362
23312.diff (2.8 KB) - added by dh-shredder 4 months ago.
Initial Pass.
23312-2.patch (5.2 KB) - added by azaozz 4 months ago.
lock.png (3.2 KB) - added by empireoflight 4 months ago.
lock in classic and flat style
lock.psd (59.9 KB) - added by empireoflight 4 months ago.
psd of lock in classic and flat style
23312.no_bulk_edit_hidden.diff (533 bytes) - added by dh-shredder 4 months ago.
Don't check hidden checkboxes on bulk select/deselect.
23312-3.patch (4.0 KB) - added by azaozz 3 months ago.
23312-4.patch (4.0 KB) - added by azaozz 3 months ago.
23312-5.patch (4.0 KB) - added by azaozz 3 months ago.
23312-6.patch (4.2 KB) - added by azaozz 3 months ago.
lock-2x.png (716 bytes) - added by dh-shredder 3 months ago.
Sliced New Lock Image - 2x (32x32)
lock.2.png (338 bytes) - added by dh-shredder 3 months ago.
Sliced New Lock Image (16x16)
lock_avatars.diff (1.9 KB) - added by dh-shredder 3 months ago.
Avatars on locked post list
post_list_lock_with_avatar.png (15.3 KB) - added by dh-shredder 3 months ago.
Screenshot with new post lock icon + avater in list
new_icon_css.diff (748 bytes) - added by dh-shredder 3 months ago.
Align new icon and add CSS for 2x version.
23312-7.patch (10.0 KB) - added by azaozz 2 months ago.
locks.png (5.5 KB) - added by azaozz 2 months ago.

Download all attachments as: .zip

Change History (43)

Temporary Lock Icon. Source: CC0: http://thenounproject.com/noun/lock/#icon-No9362

Initial Pass.

Rough first pass for discussion.

Requires lock image in wp-admin/images/lock_16x16x32.png.

  • Displays lock in lieu of checkbox if post is locked. This has the intended secondary effect of disabling bulk edit when a post is locked.
  • Removes link to Quick Edit for any locked post.
Version 1, edited 4 months ago by dh-shredder (previous) (next) (diff)
  • Milestone changed from Awaiting Review to 3.6
  • Type changed from enhancement to task (blessed)

azaozz4 months ago

Extended 23312.diff a bit to use css class to show/hide the lock icon and show "Currently edited by.." under the post title as discussed with @dh-shredder. That would make it easier to (eventually) update which posts are locked dynamically.

Looks good! The display is a little odd when only one row is a different height than the rest, but I really like the increased information available.

here is a screenshot of the UI: http://cl.ly/image/3h0R261k1O2Z

In 23371:

Posts screen: show when a post is "locked", hide the checkbox, Quick Edit and Trash links, props dh-shredder, see #23312

In 23372:

Clean up rendering of the title column in the posts list table. Simplify branching. Use get_userdata() rather than get_user_by( 'id' ). Change string to '%s is currently editing'. see #23312.

lock in classic and flat style

psd of lock in classic and flat style

comment:8 follow-up: ↓ 10   empireoflight4 months ago

I've uploaded lock graphics in classic and flat styles; 16x16 and 32x32 versions for retina. Sorry no time to slice at the moment...

Don't check hidden checkboxes on bulk select/deselect.

Since we're not suppressing the creation of the checkboxes when locked, 23312.no_bulk_edit_hidden.diff keeps the hidden checkboxes from being checked, thus keeping them from being selected for bulk edit.

comment:10 in reply to: ↑ 8   dh-shredder4 months ago

Replying to empireoflight:

I've uploaded lock graphics in classic and flat styles; 16x16 and 32x32 versions for retina. Sorry no time to slice at the moment...

Thanks! Those look great.

azaozz3 months ago

23312-3.patch adds "live" update of locked posts using heartbeat.

azaozz3 months ago

23312-4.patch fixes the removal of locks and escapes the user name when adding a lock.

In 23485:

Post locks: don't check hidden checkboxes on bulk select/deselect, props dh-shredder, see #23312

azaozz3 months ago

In 23312-5.patch​: when displaying the lock, uncheck the checkbox.

azaozz3 months ago

23312-6.patch: don't check the lock if the current user cannot edit the post.

In 23487:

Post locks: use heartbeat to dynamically update locked posts on the Posts screen, first run, see #23312

comment:17 follow-up: ↓ 19   azaozz3 months ago

Perhaps we can optimize this a bit: merge inline-edit-post.js and the new edit-post.js. Both would need to work well when displaying CPTs.

In 23488:

Add edit-post.min.js for bumpbot's sake, see #23312

comment:19 in reply to: ↑ 17 ; follow-up: ↓ 20   nacin3 months ago

Replying to azaozz:

Perhaps we can optimize this a bit: merge inline-edit-post.js and the new edit-post.js. Both would need to work well when displaying CPTs.

Yes, makes sense.

23312-6.patch: don't check the lock if the current user cannot edit the post.

This made me wonder, if the user can see the post in the list (even if they cannot edit it) what is the harm in seeing current user activity?

comment:20 in reply to: ↑ 19   azaozz3 months ago

This made me wonder, if the user can see the post in the list (even if they cannot edit it) what is the harm in seeing current user activity?

We were talking with @dh-shredder about that too. Maybe sites with a lot of authors and contributors wouldn't want editor and admin users activities to be visible to all, although don't think it's an "information leak".

Sliced New Lock Image - 2x (32x32)

Sliced New Lock Image (16x16)

Avatars on locked post list

Screenshot with new post lock icon + avater in list

Forgot to add a comment last night. Two things!

  • New sliced lock icons from @empireoflight's original PSDs (lock.2.png & lock-2x.png) added
  • First pass lock_avatars.diff to add avatars to post list locks added. This currently does send the HTML for the avatar itself from get_avatar() through heartbeat. If we need to avoid that, can do so as well, although this method is significantly simpler.

You can see a screenshot with both attached above.

Edit: Right now, the avatar is sized to match the new revision sized ones, at 18x18. We can reduce to 16x16, if it's not important to match sizes there.

Last edited 3 months ago by dh-shredder (previous) (diff)

Align new icon and add CSS for 2x version.

In new_icon_css.diff, add CSS for new icon, realign, and add lines to handle 2x version. Note that for this to work, you'll need to add the above lock.2.png (as lock.png) and lock-2x.png to your wp-admin/images directory.

azaozz2 months ago

azaozz2 months ago

In 23312-7.patch:

  • Merged @dh-shredder's patches.
  • Merged the new edit-post.js with inline-edit-post.js (no need for two JS files).
  • Tweaked the size and position of the gravatars, the 18px were looking too small on a large monitor:


In 23681:

Post locks on the posts list screen: new icons for the lock, props empireoflight, show avatar for the user currently editing, props dh-shredder, see #23312

In 23725:

Post locks: add Preview button when post is locked, fix the suggested places, see #23312

Anything left here?

Note: See TracTickets for help on using tickets.