Show duration options in an overlay

Created on 8 September 2024, 3 months ago
Updated 17 September 2024, 3 months ago

Problem/Motivation

As described in #3468866: UX optimizations to Date and Time entry fields for Events Recipe โ†’ , there is a common pattern in calendar software to show duration options in an overlay, to make it more obvious what end time will be created. As described by Jakob's Law of Usability, the use of familiar patterns improves user experience.

Here is how the interface currently looks, with the duration as a separate dropdown:

By contrast, here is an example of the Google Calendar interface:

Proposed resolution

Implement a similar pattern in the Smart Date widget. Ensure that the implementation includes keyboard navigation and other accessibility considerations.

Here is an example of how the Smart Date interface looks with the changes in the current MR:

โœจ Feature request
Status

Fixed

Version

4.2

Component

User interface

Created by

๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @mandclu
  • Merge request !149Durations overlay โ†’ (Merged) created by mandclu
  • Status changed to Needs review 3 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

    Here's a preview of how the updated widget looks, based on the MR

  • ๐Ÿ‡ช๐Ÿ‡ธSpain ckrina Barcelona

    โ€œthere is a common pattern in calendar software to show duration options in an overlayโ€ is not a good enough reason to merge this into Drupal CMS, just a good enough reason to test it and evaluate if we want it.

    I'd love that, if possible UX or UI improvements are identified, we highlight them first and discuss them, before assuming they are correct and merging them. Because as a consequence you'll start building things on top of that, others reusing them, and then changing things will be a headache.

    So I'd recommend not merging this, but first test it to make sure it's an improvement.

  • Status changed to Needs work 3 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

    Based on the discussions here and in Drupal slack, I'm going to update this to only use the new overlay if the site builder has opted into it in the formatter settings, and I will mark it as experimental

  • Status changed to Needs review 3 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

    Here's an updated look at how the overlay is formatted, now entirely with CSS, using separate spans for the duration and related end time.

    Also, the changes won't be visible unless this new configuration is opted-into.

  • Status changed to Needs work 3 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Tirupati_Singh

    Hi @mandclu, I've applied the provided MR as a patch and it applied cleanly with no errors. After applying the patch Use an overlay to display duration options. - EXPERIMENTAL option is now being shown in smart_date field widget. When enabling the new overlay display duration, duration is shown between the time in the node edit page. However, there's a spacing/alignment issue in the overlay as shown in the attached screenshot. The extra spaces issue can be resolved if width: 3.75rem; is removed from the class .smart-date--duration-list--time. After removing the extra space is not visible and the time duration is displayed properly. I've attached screenshots of before and after fixes for your reference. As the design issue is present hence moving the issue status to Needs work.

    Thanks!

  • Assigned to mandclu
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

    @tirupati_singh Thank you for the feedback. The challenge underlying your feedback is that this widget needs to accommodate parts of the world that display time in a 12-hour format (e.g. 8:47pm) and the more widely used 24-hour format (e.g. 20:47). You can probably guess which of these I typically use ;-)

    I believe the code can be updated to accommodate both properly. I can work on this.

  • Issue was unassigned.
  • Status changed to Needs review 3 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

    The updated MR should only apply the 12h formatting (notably, the wider width) if needed. Please test.

  • Status changed to RTBC 3 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Tirupati_Singh

    Hi @mandclu, now I can confirm that the styling issue for the duration has been fixed. I've tested the overlay duration for both 12h and 24h formatting and the overlay design is working perfectly. I'm attaching the screenshots for your reference. RTBC.

    Thanks!

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

    Updated issue summary.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

    More IS updates.

  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

    Updated to target a new 4.2.x branch.

  • Pipeline finished with Skipped
    3 months ago
    #285300
    • mandclu โ†’ committed 5c6657e0 on 4.2.x
      Issue #3472863 by mandclu, tirupati_singh: Show duration options in an...
  • Status changed to Fixed 3 months ago
  • ๐Ÿ‡จ๐Ÿ‡ฆCanada mandclu

    Merged in, and will include in a beta release for the 4.2.x branch.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024