Problem/Motivation

The interaction target size of the contextual links is optimized for pointer devices. The size of the target is too small for fatter devices, like fingers.

contextual-links-interaction-target.png

The contextual links have already been updated to make them accessible on touch devices.

#1138844: Add touch support to contextual links

Work is underway to make them accessible to keyboard and blind users.

#849926: links wrapped in .contextual-links-wrapper divs are not accessible at all via keyboard alone also problems with screen readers

The current height of the links are about 28px. The touch target size should have a height of at least 40px and more if possible (ref: http://www.lukew.com/ff/entry.asp?1085). We'll need some design changes to allow users using fingers on touch devices to reliably select an item from the list of links.

Proposed resolution

tkoleary suggests this design.

contextual-touch-target-optimized.png

The details of the links in the design do not reflect the current contextual links, but the styling of the links represents the direct that we could take the links to make them better suited to touch input.

Remaining tasks

  • Refine the design.
  • Code it up.

User interface changes

Lots and TBD.

API changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jessebeach’s picture

This patch is very early on in development. I'm disappearing for a couple weeks, so I wanted to get my work online before I duck out.

The setup patch is necessary to put some contextual link fixes in place. These will be fixed in 8.x soon.

Gábor Hojtsy’s picture

Issue tags: +Usability, +mobile, +touch, +Spark

Tagging for Spark, mobile and touch.

Gábor Hojtsy’s picture

Status: Active » Needs review
Bojhan’s picture

Title: Make the presentation of contextual links' presentation more usable with touch input (fat fingers) by increasing the target size » Increase target size contextual links

Right now, we don't have any "edit in place" part of contextual links so I see no reason to switch to a pen.

Also is there a larger design here? Because switching to horizontal contextual links is quite a change, I am not sure I follow.

So I guess the main question, what is the scope? If its only to provide a better target area, why don't we just make the target area larger?

Gábor Hojtsy’s picture

Title: Increase target size contextual links » Make the presentation of contextual links' presentation more usable with touch input (fat fingers) by increasing the target size
FileSize
3.63 KB
16.76 KB

With the patch applied, all contextual menu items appear right away when hovering over a related item (not hidden under the gear dropdown). Note that the gear and the down arrow are still visible. The click/touch areas of the links are much bigger (not as big as on the design).

Contextual.png

Also attaching a better setup patch, since both #1304470: Add tests for module-provided contextual links on blocks and #1868348: Missing contextual links on system menu blocks are needed to fix underlying contextual menu bugs. If this is not applied, all blocks only exhibit a configure link...

Gábor Hojtsy’s picture

Title: Make the presentation of contextual links' presentation more usable with touch input (fat fingers) by increasing the target size » Increase target size of contextual links

Crosspost.

LewisNyman’s picture

Title: Increase target size of contextual links » Increase target size contextual links
FileSize
80.13 KB
92.9 KB

Nice, I was going to open an issue very similar to this.

My idea was to use an invisible select box to invoke the native UI. Not only does this provide more focused and arguably better UI elements than we are capable of doing with CSS, it's also adaptable to the form factor of the device and the conventions of the OS in use. See the UI differences on a phone and a tablet I've attached below.

For more information on implementation See this page

Gábor Hojtsy’s picture

Title: Increase target size contextual links » Increase target size of contextual links
FileSize
51.2 KB

@Bojhan: responding to your questions: the prime goal is to make contextual links touch friendly. Overall if it is a dropdown that appears on hover then it is not accessible on touch devices because there is no hover to make the dropdowns appear. @tkoleary's proposal is to achieve the touch compatibility by coupling this styling of the contextual links with the edit module. So the styling would not necessarily apply to Drupal without edit module being present. The patch changes Drupal as-is to make it easier to discuss (and figure out if we want to make it apply to Drupal in general as well without edit's global toggle).

Also, if the menu cannot be displayed above the block (for blocks at the top of the page), it would display vertically:

VerticalMenu.png

(That is not yet in the patch either).

Bojhan’s picture

@lewis That's a very interesting idea, @Gabor what do you think?

I dont think we should have any magical horizontal vs. vertical toolbars. The vertical contextual links will work just fine, across devices and scale much better than a horizontal one - which if it goes beyond the horizontal width (on sidebars easily achievable) looks off key. I really like the initial idea of #8, I dont know what those arrows do though

Gábor Hojtsy’s picture

I'm neither a designer nor a mobile expert, but my personal opinion on using select lists is that it puts in an intermediate "alien" interaction to the navigation. Eg. showing a select list on all blocks and wanting to go edit a block or a menu displayed would need to go into a select list interaction would not make it easier to edit blocks in quick succession. I'll ask @tkoleary to follow up as well. He designed these proposals.

jessebeach’s picture

Well, I think what @lewisnyman is suggesting is that the underlying HTML element be a select box. We can put window-dressing on top of the select when jS is present and make it look like the current contextual links design.

jessebeach’s picture

@Bohjan, yes, we could simply make the touch targets larger on .touch devices. I see that as an acceptable resolution to this issue.

I think what tkoleary is trying to do with these designs is explore ways to moving the contextual links from obscuring the content that they're meant to correspond to. It's something worth giving a little thought to.

Bojhan’s picture

@jessebeach Cool, I really like the idea of making the contextual links better hit targets. I am not so sure about the horizontal vs. vertical decision, but definitely open for more discussion about. Some background on this at http://bojhan.nl/contextual-links, where we actually tested both options. Also the contextual links issue has some discussion around this.

tkoleary’s picture

Bojhan, fyi the designs above came from this prototype: http://invis.io/DTAMV1JF which I just finished a video on that Dries is about to include in a blog post.

LewisNyman’s picture

Sorry guys, I'm able to give a better example now. It's a link that looks like any styled element (not a select box) that invokes the same UI that a select box triggers. I actually used this technique for the filter dropdown in my first prototype and you can check it out by visiting nav.d8mux.org and drilling down to the content listing page and tapping on the filter icon (cheesy I know)

Screen shot of content listing page on an iPhone

Select box UI invoked on an iphone

Select box UI invoked on an iPad

Seems like we might have some scope creep here... If we are going to broadly redesign contextual links anyway then we might as well close this issue.

jessebeach’s picture

Just a reroll of the patch in #1 to remove a change to the menu.module that should have been part of the setup patch that Gábor posted in #5.

lewisnyman, I think we can make a valuable change in this issue without boiling the ocean :)

tkoleary’s picture

@lewisnyman This looks like a really interesting approach. Have you explored how it would work across multiple devices?

LewisNyman’s picture

@tkoleary Sure, most modern mobile OS' use their own native widgets to make some form widgets more usable. All these styles are documented in each OS hig.

If we are targeting just touch devices in this patch we would be relying on detection of the Javascript touch event. That means that less modern non-touch devices will simply fall back to the current behavior.

@all,

I'm not sure if I still understand the intent of this issue, for the sake of discussion I've created an MVP patch that solves this issue with one additional CSS selector.

tkoleary’s picture

@lewisnyman This does seem to simplify implementation. I will test it out and think about how it integrates with the other interactions, especially the ones that involve moving blocks around. Also, what about the variety of flavors of Android? Will that be a problem?

tkoleary’s picture

@lewisnyman Urgh. Applied the patch to my local but cant seem to get it to work in xcode ios emulator. Any ideas?

LewisNyman’s picture

Hey Kevin,

Sorry, I should of explained the above patch, all this one does is increase the text size of the contextual links on a touch device, which makes the links bigger targets, purely a minimal solution.

If you want me to knock up a prototype of my proposed concept for testing purposes... I'll have a look, splitting the contextual links theme function looked a bit over my head, I might be able to do it using javascript to modify the html.

tkoleary’s picture

@ lewisnyman that would be *awesome*. Meantime i'm installing squid so I can get my ipad to see all my Dev Desktop local installs. My first experience installing software directly from the command line.

LewisNyman’s picture

A patch!

I gave it a pretty thorough test on iOS. Haven't got time to break out the phones but feel free to try it out. I'm trying to get it up on a publicly accessible server and failing...

Status: Needs review » Needs work

The last submitted patch, drupal-1879386-contextual-links-23.patch, failed testing.

Gábor Hojtsy’s picture

Some discussion around the display of the contextual links when coupled with edit mode is also at #1882482: [meta] Unify editing approaches in Drupal.

LewisNyman’s picture

I got this patch working now. It uses Tinynav.js

LewisNyman’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, drupal-1879386-contextual-links-26.patch, failed testing.

jessebeach’s picture

Lewis Nyman, what about making the contextual links a select box by default? And transforming them into a list for .no-touch UAs? This puts less stress on devices that probably have less computing power, like phones.

If that idea strikes your fancy, I can code it up.

LewisNyman’s picture

Hey Jesse, yeah that would be my preferred implementation. It makes no sense to put front end strain on mobile devices. I haven't seen any third party libs that handle this, maybe it's worth forking and reversing an existing lib like tinynav.js? Maybe not.

Wim Leers’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: +Needs usability review
FileSize
641 bytes

We all lost track of this for some reason a long time ago. I particularly like the extremely minimal MVP patch of LewisNyman in #18. It works rather well. It's an incremental improvement.

Bojhan’s picture

Perhaps this can get a screenshot?

Wim Leers’s picture

FileSize
4.22 KB
4.07 KB
Before
After
Bojhan’s picture

Status: Needs review » Reviewed & tested by the community

Nice! Ok, lets do this

Wim Leers’s picture

Wim Leers’s picture

Title: Increase target size of contextual links » Increase target size of contextual links on touch devices

Better title.

jessebeach’s picture

This increases the font-size to an equivalent 18px. The height of the touch area is increased to about 28px. The changed is limited to UAs that support touch, so point-and-click desktops will maintain the current, smaller text size.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

That looks a bit too B I G to me, but apparently people with better design sense than I have think this is a good idea, so cool. :) Plus I'm not sure how to make it smaller without moving to em/px instead of nice semantical stuff, so...

Committed and pushed to 8.x. Thanks!

Wim Leers’s picture

Issue tags: -sprint

Status: Fixed » Closed (fixed)

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