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.
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.
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.
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.
Comment | File | Size | Author |
---|---|---|---|
#33 | after.png | 4.07 KB | Wim Leers |
#33 | before.png | 4.22 KB | Wim Leers |
#31 | contextual_touch_mvp-1879386-31.patch | 641 bytes | Wim Leers |
#26 | drupal-1879386-contextual-links-26.patch | 3.73 KB | LewisNyman |
#23 | drupal-1879386-contextual-links-23.patch | 3.77 KB | LewisNyman |
Comments
Comment #1
jessebeach CreditAttribution: jessebeach commentedThis 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.
Comment #2
Gábor HojtsyTagging for Spark, mobile and touch.
Comment #3
Gábor HojtsyComment #4
Bojhan CreditAttribution: Bojhan commentedRight 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?
Comment #5
Gábor HojtsyWith 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).
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...
Comment #6
Gábor HojtsyCrosspost.
Comment #7
LewisNymanNice, 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
Comment #8
Gábor Hojtsy@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:
(That is not yet in the patch either).
Comment #9
Bojhan CreditAttribution: Bojhan commented@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
Comment #10
Gábor HojtsyI'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.
Comment #11
jessebeach CreditAttribution: jessebeach commentedWell, 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.
Comment #12
jessebeach CreditAttribution: jessebeach commented@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.
Comment #13
Bojhan CreditAttribution: Bojhan commented@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.
Comment #14
tkoleary CreditAttribution: tkoleary commentedBojhan, 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.
Comment #15
LewisNymanSorry 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)
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.
Comment #16
jessebeach CreditAttribution: jessebeach commentedJust 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 :)
Comment #17
tkoleary CreditAttribution: tkoleary commented@lewisnyman This looks like a really interesting approach. Have you explored how it would work across multiple devices?
Comment #18
LewisNyman@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.
Comment #19
tkoleary CreditAttribution: tkoleary commented@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?
Comment #20
tkoleary CreditAttribution: tkoleary commented@lewisnyman Urgh. Applied the patch to my local but cant seem to get it to work in xcode ios emulator. Any ideas?
Comment #21
LewisNymanHey 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.
Comment #22
tkoleary CreditAttribution: tkoleary commented@ 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.
Comment #23
LewisNymanA 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...
Comment #25
Gábor HojtsySome discussion around the display of the contextual links when coupled with edit mode is also at #1882482: [meta] Unify editing approaches in Drupal.
Comment #26
LewisNymanI got this patch working now. It uses Tinynav.js
Comment #27
LewisNymanComment #29
jessebeach CreditAttribution: jessebeach commentedLewis 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.
Comment #30
LewisNymanHey 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.
Comment #31
Wim LeersWe 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.
Comment #32
Bojhan CreditAttribution: Bojhan commentedPerhaps this can get a screenshot?
Comment #33
Wim LeersComment #34
Bojhan CreditAttribution: Bojhan commentedNice! Ok, lets do this
Comment #35
Wim LeersComment #36
Wim LeersBetter title.
Comment #37
jessebeach CreditAttribution: jessebeach commentedThis 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.
Comment #38
webchickThat 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!
Comment #39
Wim Leers