Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#37595 closed enhancement (fixed)

Better titles for the Quick Draft dashboard widget

Reported by: afercia's profile afercia Owned by: afercia's profile afercia
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-screenshots good-first-bug has-patch
Focuses: ui Cc:

Description

The "Quick Draft" dashboard widget shows the recent drafts below the form, with a title that says "Drafts":

https://cldup.com/bJfUsOstKl.png

And when JS is off, the widget hides the form and shows just the recent drafts with a "Drafts" title:

https://cldup.com/sc-qAQwCXT.png

By the way, these are just the drafts created by the current user, so if there are drafts from other users, the widget will display just your ones. It's a minor thing for sure, but it's not clear at first sight because the two titles can be a bit misleading. Users may think it's a list of all the drafts (from all users), while it is not.

At the very least, I'd suggest to consider to change the two titles to make them a bit more clear. Maybe using something like "Your Recent Drafts" instead of just "Drafts".

Maybe also worth considering if limiting this list to the current user's drafts makes sense or if it should list all the drafts or maybe both types in two separated lists. Personally, I'd be in favor of keeping it simple.

Worth noting when there are more than 3 drafts from the current user, a "View all" link will appear:

https://cldup.com/9GdGj9hLsI.png

and this link points to the list of drafts from all users which is OK I guess, maybe just needs to be clarified.

Feedback from the UI team more than welcome :)

Attachments (7)

dashboard.patch (803 bytes) - added by soniakash 8 years ago.
37595.patch (705 bytes) - added by sudar 7 years ago.
dashboard.php.patch (654 bytes) - added by bhargavbhandari90 7 years ago.
37595.2.patch (709 bytes) - added by zachwtx 7 years ago.
Add "My" before "Draft(s)" and relocate patch index relative to root directory
37595-dashboard.patch (1.3 KB) - added by johnroper100 7 years ago.
37595-quick-draft.patch (1.5 KB) - added by rcutmore 7 years ago.
Change title of recent drafts section to "Your Recent Drafts" and view drafts link text to "View all drafts".
37595-quick-draft.2.patch (1.5 KB) - added by rcutmore 7 years ago.
Change title of recent drafts section to "Your Recent Drafts" and view drafts link text to "View all drafts".

Download all attachments as: .zip

Change History (20)

@soniakash
8 years ago

#1 @ocean90
8 years ago

In 38225:

Dashboard: Don't escape widget titles in screen reader text.

Introduced in [37972]. The title for the Quick Draft widget contains HTML to provide a JS/no-JS version.

Props SergeyBiryukov for review.
See #37595.
Fixes #37594.

#2 @ocean90
8 years ago

In 38226:

Dashboard: Don't escape widget titles in screen reader text.

Introduced in [37972]. The title for the Quick Draft widget contains HTML to provide a JS/no-JS version.

Merge of [38225] to the 4.6 branch.

Props SergeyBiryukov for review.
See #37595.
See #37594.

#3 @soniakash
8 years ago

Hi @ocean90

Can you see my patch dashboard.patch for "Quick Draft" dashboard widget shows list of draft title " Drafts "

Currently if only one draft show on site then it's so " Drafts " title.

So i write code if one draft have in site then show " Draft " title And more then one draft have then show " Drafts " title.

Tell me it's Write / Wrong think?

#4 follow-up: @sudar
7 years ago

  • Keywords has-patch added

@soniakash There is _n (https://codex.wordpress.org/Function_Reference/_n) function which allows us to use different strings based on a variable count.

I have updated your patch to use this function.

@sudar
7 years ago

@zachwtx
7 years ago

Add "My" before "Draft(s)" and relocate patch index relative to root directory

#5 in reply to: ↑ 4 @SergeyBiryukov
7 years ago

Replying to sudar:

There is _n (https://codex.wordpress.org/Function_Reference/_n) function which allows us to use different strings based on a variable count.

It's not suitable in this case though, see https://codex.wordpress.org/I18n_for_WordPress_Developers#Plurals:

Note that some languages use the singular form for other numbers (e.g. 21, 31 and so on, much like '21st', '31st' in English). If you would like to special case the singular, check for it specifically:

if ( 1 === $count ) {
	printf( esc_html__( 'Last thing!', 'my-text-domain' ), $count );
} else {
	printf( esc_html( _n( '%d thing.', '%d things.', $count, 'my-text-domain' ) ), $count );
}

dashboard.patch is correct in that sense, although it doesn't quite do what the ticket suggests.

"My Drafts" is also an option, there's a related discussion in #26769 about "Your Profile" vs. "My Profile" (no consensus at this time though).

#6 @johnroper100
7 years ago

  • Version set to trunk

37595-dashboard.patch

I updated the text to read "Your Recent Draft" if there is only one draft, and "Your Recent Drafts" if there are more than one.

#7 @afercia
7 years ago

Thanks everyone for the patches. What I was originally suggesting in this ticket wasn't about singular/plural forms but more about trying to clarify the difference between "your drafts" and "all drafts" (i.e. drafts from all users). Personally, I wouldn't be opposed to use a plural form for the title, even when there's just one draft. See screenshot below:

https://cldup.com/TymZADlRUl.png

For sure, I'd try to clarify the "View all" link. There's an aria-label on that link with a value View all drafts (Note: it's not escaped 😬 ). I'd probably consider to remove the aria label and use the View all drafts text for the link.

@rcutmore
7 years ago

Change title of recent drafts section to "Your Recent Drafts" and view drafts link text to "View all drafts".

#8 @rcutmore
7 years ago

Hi @afercia

I added 37595-quick-draft.patch which contains the following changes:

  1. Changes the title for the recent drafts section to "Your Recent Drafts".
  2. Changes the view drafts link text to "View all drafts". Also removes the aria-label on the link.

This is my first contribution so please let me know if I made any mistakes or if the patch is missing anything.

#9 @afercia
7 years ago

@rcutmore thanks! The patch looks good to me, just one small thing:
before, this was using _x() to specify that "View All" was about drafts:
_x( 'View all', 'drafts' )
where _x() was used to avoid collisions with other similar strings and give translators some context to translate the string differently
Now the string is:
_x( 'View all drafts', 'drafts' )
and maybe there's no need to use _x() and it could simply be __( 'View all drafts' )

@rcutmore
7 years ago

Change title of recent drafts section to "Your Recent Drafts" and view drafts link text to "View all drafts".

#10 @rcutmore
7 years ago

@afercia Thanks, that makes sense. I uploaded 37595-quick-draft.2.patch for that change.

#11 @afercia
7 years ago

  • Milestone changed from Awaiting Review to 4.9
  • Version trunk deleted

#12 @afercia
7 years ago

Screenshot with the patch applied:

https://cldup.com/i6GjJK75rx.png

#13 @afercia
7 years ago

  • Owner set to afercia
  • Resolution set to fixed
  • Status changed from new to closed

In 40877:

Dashboard: Better titles for the Recent Drafts widget.

  • changes "Drafts" to "Your Recent Drafts" to clarify displayed drafts are the ones from the current user
  • clarifies and simplifies the "View all" link

Props soniakash, sudar, bhargavbhandari90, zachwtx, johnroper100, rcutmore.
Fixes #37595.

Note: See TracTickets for help on using tickets.