WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 6 months ago

#35391 closed defect (bug) (fixed)

Remove title attributes: the Posts Date column full date and time

Reported by: afercia Owned by: afercia
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-screenshots title-attribute tooltips has-patch commit
Focuses: ui, accessibility Cc:

Description

Splitting this out from #35313.

See related #24766 and all the following tickets about title attributes.

The date column is a special case: in the "List View" there's an abbreviation with a title attribute that repeats the date and adds the time. In the "Excerpt View", the time is displayed in plain text next to the date. Pages don't have the "Excerpt View".

https://cldup.com/nNYQPFlGPa.png

Tried to rebuild some history and it's pretty interesting. Once upon a time :) the full date and time was displayed in plain text:

https://cldup.com/7i6gQWiyBP.png

Following relevant changes:

  • the title attribute was added in [6856] and the link to view the post was on the date
  • the abbreviation was added in [7168] and the link to view the post was moved to the status column
  • the post_date_column_time filter was introduced in [7640]
  • the "List View" and "Excerpt View" switch was added in preparation for the crazy horse redesign in [8682] see also #7552 but couldn't find any reference about the reason why the date is displayed differently in the two views
  • finally, the status was moved to the date column in [9167]

I'd say the published time is a relevant information, especially for sites with an intensive editorial flow, by the way touch devices users will miss this information, as well as assistive tech users.

I'd propose to always display the full date and time in plain text, both in the "List View" and the "Excerpt View".

Worth noting the recently added "Submitted On" column in the Comments screen displays the date and time in plain text, so for consistency I'd propose to use the same format.

https://cldup.com/CS-Aze48k2.png

Attachments (9)

35391.patch (3.2 KB) - added by afercia 5 years ago.
35391.1.diff (3.2 KB) - added by audrasjb 11 months ago.
Refreshes the patch and adds some fresh docs
35391-posts-desktop-after.png (125.8 KB) - added by audrasjb 11 months ago.
35391-posts-mobile-after.png (56.6 KB) - added by audrasjb 11 months ago.
35391-comments-desktop-after.png (157.7 KB) - added by audrasjb 11 months ago.
35391.2.diff (3.3 KB) - added by SergeyBiryukov 11 months ago.
35391.diff (3.7 KB) - added by afercia 7 months ago.
post date list view.png (88.9 KB) - added by afercia 7 months ago.
List view
post date excerpt view.png (152.1 KB) - added by afercia 7 months ago.
Excerpt view

Download all attachments as: .zip

Change History (42)

@afercia
5 years ago

#1 @afercia
5 years ago

  • Keywords has-screenshots has-patch added
  • Owner set to afercia
  • Status changed from new to assigned

First pass. Would appreciate some feedback about the post_date_column_time filter. Screenshot:

https://cldup.com/4sCBTTSNIs.png

#2 @ocean90
5 years ago

  • Version 4.4 deleted

That wasn't new in 4.4. :)

Last edited 5 years ago by ocean90 (previous) (diff)

#3 @TimothyBlynJacobs
5 years ago

In my mind, the reason the time is hidden by default, is that for most people in their day-to-day operations don't need to see the exact time a post was published or modified. It seems only relevant to people ( mostly publishers ) who are posting content multiple times per-day at a rapid frequency. When on mobile, it seems like the exact publish date is even less of a concern. But it is available by toggling to the excerpt view, if needed.

Comments are different, you would expect ( hope :) ) to have multiple comments within a day, so the time becomes an important differentiating factor.

Lastly, while increasing the width of the date column isn't too bad in a default install, once you have a couple of plugins adding extra columns to your posts list table, it is already incredibly cluttered and information dense.

Is there a way to have the full date hidden and still be accessible friendly? I'm by no means an accessibility expert, so please correct me if I am wrong. Would it be possible to display the full post time to screen readers using .screen-reader-text, but leave the <abbr> tag?

Not sure if at all it would work well, but just a thought.

<abbr title="full date">Day <span class="screen-reader-text">Time</span></abbr>

#4 @afercia
5 years ago

@TimothyBlynJacobs thanks for your feedback. Have already considered all your points but the primary goal of this ticket is to remove the title attribute. I wouldn't recommend any solution that still relies on the title attribute for several reasons you can find expanded in all the previous tickets related to title attributes. 42 tickets at the moment :) Some points:

  • the "Excerpt view" is for Excerpts, that's why is called "Excerpt view" and not "Full date and time view". Also wondering how many users have ever noticed the full date/time displayed there or how many have ever used the Excerpt view at all :)
  • plugins: unfortunately yes, but if they're breaking the table that would likely happen anyways, the date column width is in percentage so the exact size will vary but the difference is something about just 50/60 pixels
  • it's not just about accessibility: title attributes exclude a lot of users: the Web is evolving and title attributes are more and more the best way to hide content from users
  • please also consider relying on the title attribute is currently discouraged in HTML5 http://www.w3.org/TR/html5/dom.html#the-title-attribute

I'm open to suggestions, but I really see title attributes as a thing of the past, ideally we should strive to find new ways to convey expanded information to all users, on hover, focus and mobile-friendly as pointed out by @joedolson in a recent comment.

#5 @truonght
5 years ago

#35525 was marked as a duplicate.

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


5 years ago

#7 @afercia
5 years ago

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 4.5 to Future Release

Discussed this during today's a11y bugscrub on Slack and agreed we can't think of an optimal solution for now. The current patch doesn't make things better for all users because the short, human readable, date is valuable when looking for quick infos, while the expanded date make sense when looking for details and when there are, for example, several sequential posts all saying today's date.
Moving out of the 4.5 report. Brilliant, new, ideas are very welcome :)

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


4 years ago

#9 @afercia
4 years ago

  • Milestone Future Release deleted
  • Resolution set to maybelater
  • Status changed from assigned to closed

#10 @afercia
4 years ago

  • Keywords title-attribute added

#11 @afercia
15 months ago

  • Keywords tooltips added

#12 @afercia
15 months ago

  • Milestone set to Future Release
  • Resolution maybelater deleted
  • Status changed from closed to reopened

The new block editor (Gutenberg) introduced tooltips for interactive controls. They could be an option to solve this issue. I'd like to propose to reopen this ticket from closed / maybelater to open / future release.

@audrasjb
11 months ago

Refreshes the patch and adds some fresh docs

#13 follow-up: @audrasjb
11 months ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Future Release to 5.4

Hi,

In my opinion, it would be better to reconsider the initially proposed patch as it still solves the issue. Also, I tested it it's looking pretty good on my side.

35391.1.diff refreshes the previous patch and adds some fresh docs.
Concening the mode @param tag, I'm wondering if we should use "Optional" (like I did in the patch) or "Deprecated", as this parameter is no longer needed.

Cheers,
Jb

Last edited 11 months ago by audrasjb (previous) (diff)

#14 @audrasjb
11 months ago

  • Keywords 2nd-opinion added

This ticket was mentioned in Slack in #accessibility by audrasjb. View the logs.


11 months ago

#16 in reply to: ↑ 13 @SergeyBiryukov
11 months ago

Replying to audrasjb:

Concening the mode @param tag, I'm wondering if we should use "Optional" (like I did in the patch) or "Deprecated", as this parameter is no longer needed.

  • Optional is not needed here, it only makes sense for function parameters, not for hook parameters.
  • Deprecated is also not needed here. Although the $mode global is no longer used in the method, it's still passed to the filter, so plugin authors may choose to differentiate between 'excerpt' and 'list'.

Keeping the existing parameter description seems the most appropriate here.

35391.2.diff expands the @since note and removes the unused $h_time variable.

It's worth noting that the patch removes the short, human-readable, date ("1 hour ago") in favor of full date and time, which provides more details, but makes the list harder to scan at a glance.

As previously noted in comment:3 and comment:7, this is not ideal. I'm not sure I like that either. Any ideas welcome :)

#17 @afercia
10 months ago

Ideally, the date/time string should use the same format of the Comments one: date and time separated by at

$t_time = sprintf(
	/* translators: 1: Post date, 2: Post time. */
	__( '%1$s at %2$s' ),
	/* translators: Post date format. See https://www.php.net/date */
	get_the_time( __( 'Y/m/d' ), $post ),
	/* translators: Post time format. See https://www.php.net/date */
	get_the_time( __( 'g:i:s a' ), $post )
);

Question: is it really important to show the seconds? Comments show only hour and minutes.

The visual issues stay though, including lack of visual hierarchy between the status (Published, Scheduled, etc.) and the date/time. Overall, I'm not sure this is a case where the "decisions not options" philosophy is the best approach. Users have different needs. A default format based on an assumption doesn't fit all needs.

Some users would prefer a "cleaner" view, with a friendly human readable date/time format. Other users would prefer or even need a detailed date/time format. Applications designed for a large, diverse, audience provide options for that. For example. Gmail provides three options for the "Display density" setting:

  • Default
  • Comfortable (cleaner)
  • Compact (smaller rows)

I do realize this should apply to the whole table. It would also be an opportunity to improve one of the long-standing issues with the various tables in the admin: cluttered UI and information density.

The current "Excerpt View" isn't really the right place for an option to change the way the date/time is displayed because:

  • the UI makes its best to hide this setting under the "Screen options": I wonder how many users are aware an "Excerpt View" exists
  • it's not explained anywhere that it also changes the date/time display
  • it's called "Excerpt View": a name that doesn't clarify what it does

For now, I'd be in favour of just displaying the full date/time. Loss of information should never happen because "there's no available space in the UI". That's a UI problem. A good UI should be designed around the content it is supposed to display, not the other way around.

This ticket was mentioned in Slack in #accessibility by audrasjb. View the logs.


10 months ago

#19 @joedolson
10 months ago

I think we should remove seconds from the time string (unnecessary clutter - I don't think we need that level of detail.)

Otherwise, I think that we should go ahead and commit this - as @afercia says, we should allow loss of information because of a lack of space; we should provide the information, then solve the design problem.

I also think we should open a new ticket to propose developing display options for tables. Giving users options to control their needed level of detail would give this a lot more flexibility down the road.

#20 @afercia
10 months ago

  • Keywords needs-refresh added; 2nd-opinion removed

The patch needs to be updated as per comment:17 and comment:19

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


10 months ago

#22 @afercia
10 months ago

This ticket was discussed during today's accessibility bug-scrub: the team agrees full information needs to be provided to users and is in favor of committing this change.

The team also aims to create a new ticket fo explore new display options for the WordPress pages based on tables. In this case, the team feels display options are the only way to address one of the long-standing issues in the admin i.e. cluttered tables.

This ticket was mentioned in Slack in #core by valentinbora. View the logs.


10 months ago

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


10 months ago

#25 @afercia
10 months ago

  • Milestone changed from 5.4 to 5.5

This ticket was discussed during today's accessibility bug-scrub: With 5.4 Beta 3 approaching we agreed to move it to 5.5. The patch still needs to be updated as per comment:17 and comment:19

This ticket was mentioned in Slack in #design by joedolson. View the logs.


9 months ago

This ticket was mentioned in Slack in #accessibility by sabernhardt. View the logs.


8 months ago

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.


8 months ago

This ticket was mentioned in Slack in #accessibility by nrqsnchz. View the logs.


7 months ago

@afercia
7 months ago

#30 @afercia
7 months ago

  • Keywords commit added; needs-refresh removed

35391.diff updates the patch accordingly to comment:17 and comment:19.

  • the date/time format is now the same as the one of the comments: {post date} at {post time}
  • added bonus: the string __( '%1$s at %2$s' ) is already translated
  • removed the seconds: the default time format is now g:i a, note that this may change based on the user locale

See attached screenshot of the List view and the Excerpt view (they use the same date/time format).

@afercia
7 months ago

List view

@afercia
7 months ago

Excerpt view

#31 @audrasjb
7 months ago

Thanks for the new patch @afercia, it looks good to me 👍

Also, I think we'll want to commit this before the other Alternate list modes patch ;)

#32 @afercia
6 months ago

Related: #49715.

#33 @whyisjake
6 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 47879:

Administration: Unify the date structure in list view and excerpt view.

Both views now show a full date string. Something like Published 2020/05/27 at 10:25 pm.

Fixes: #35391.
Props: afercia, ocean90, TimothyBlynJacobs, audrasjb, SergeyBiryukov, joedolson.

Note: See TracTickets for help on using tickets.