Bug 165579

Summary: Providing Touch Bar buttons from JavaScript based on editor cursor position
Product: WebKit Reporter: Andrew Herron <thespyder>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: bdakin, dino, pkoszulinski, rmondello, sam, simon.fraser, wenson_hsieh
Priority: P2    
Version: Safari Technology Preview   
Hardware: Mac   
OS: macOS 10.12   
Attachments:
Description Flags
contextual features video none

Andrew Herron
Reported 2016-12-07 19:06:19 PST
In many rich text editors contextual buttons are made available to the user based on cursor position. This seems like a perfect use case for having the buttons appear on the Touch Bar to provide detailed access to potentially obscure features. We have a couple of examples at Ephox: https://www.tinymce.com has floating toolbars that appear in scenarios such as when an image is selected or the cursor is in a table https://textbox.io has buttons that appear on the end of the main toolbar in the same scenarios. We've discussed moving them to a floating toolbar but the Touch Bar would be an awesome alternative. In particular, the textbox.io table buttons could make great use of a dynamic Touch Bar slider to adjust cell border width, or an expanded colour picker for the cell border and background buttons. The same could even be applied to other more common features such as font size adjustment and text/highlight colour pickers. I'm not asking for complete canvas-like access to the Touch Bar, that seems like it would be too easy to abuse (an "allow access" popup may alleviate that but there are already a lot of those). I think a way to replicate contextual buttons as seen in native editors would be a great start.
Attachments
contextual features video (989.11 KB, video/mp4)
2016-12-08 17:07 PST, Andrew Herron
no flags
Beth Dakin
Comment 1 2016-12-08 11:10:29 PST
Interesting feedback! I definitely get the idea, but would you be willing to attach screenshots of the extra buttons / floating toolbars just out of curiosity? I haven't yet succeeded in making them appear by playing around with these sites, and it would be nice to have a visual of the request.
Andrew Herron
Comment 2 2016-12-08 17:07:38 PST
Created attachment 296596 [details] contextual features video Hmm. We have had feedback that the textbox.io buttons aren't obvious enough, but the TinyMCE floating toolbars are fine. Curious that you couldn't spot them in either editor. I'll do one better than screenshots; here's a video of the features I described.
Piotrek KoszuliƄski (Reinmar)
Comment 3 2017-01-04 05:10:29 PST
Note You need to log in before you can comment on or make changes to this bug.