Add initial macOS touchbar support
Categories
(Core :: Widget: Cocoa, enhancement, P2)
Tracking
()
People
(Reporter: bwinton, Assigned: bugzilla)
References
(Blocks 1 open bug, )
Details
(Keywords: feature, Whiteboard: tpi:+)
Attachments
(13 files, 5 obsolete files)
|
25.41 KB,
image/png
|
Details | |
|
25.46 KB,
image/png
|
Details | |
|
33.86 KB,
image/png
|
Details | |
|
33.86 KB,
image/png
|
Details | |
|
25.26 KB,
image/png
|
Details | |
|
44.18 KB,
patch
|
Details | Diff | Splinter Review | |
|
59 bytes,
text/x-review-board-request
|
gfritzsche
:
review+
|
Details |
|
8.52 KB,
application/zip
|
Details | |
|
30.43 KB,
image/png
|
Details | |
|
21.47 KB,
image/png
|
Details | |
|
46 bytes,
text/x-phabricator-request
|
Details | Review | |
|
2.71 KB,
text/plain
|
chutten
:
review+
|
Details |
|
925 bytes,
patch
|
mikedeboer
:
review+
ntim
:
checkin+
|
Details | Diff | Splinter Review |
Comment 1•9 years ago
|
||
Updated•9 years ago
|
| Reporter | ||
Comment 2•9 years ago
|
||
Comment 3•9 years ago
|
||
Updated•9 years ago
|
Comment 4•9 years ago
|
||
Comment 5•9 years ago
|
||
Comment 6•9 years ago
|
||
Comment 7•9 years ago
|
||
| Reporter | ||
Comment 8•9 years ago
|
||
Updated•9 years ago
|
Updated•9 years ago
|
Comment 10•9 years ago
|
||
Updated•9 years ago
|
Comment 11•9 years ago
|
||
Updated•9 years ago
|
Updated•9 years ago
|
| Comment hidden (mozreview-request) |
Comment 13•9 years ago
|
||
| Comment hidden (mozreview-request) |
Comment 15•9 years ago
|
||
Comment 16•8 years ago
|
||
Updated•8 years ago
|
Comment 17•8 years ago
|
||
Comment 18•8 years ago
|
||
Comment 19•8 years ago
|
||
Comment 20•8 years ago
|
||
Comment 21•8 years ago
|
||
Comment 22•8 years ago
|
||
Comment 23•8 years ago
|
||
Updated•8 years ago
|
Updated•8 years ago
|
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 25•8 years ago
|
||
Comment 26•8 years ago
|
||
| Assignee | ||
Comment 27•8 years ago
|
||
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 29•8 years ago
|
||
Comment 30•8 years ago
|
||
Comment 31•8 years ago
|
||
Comment 32•8 years ago
|
||
Comment 33•8 years ago
|
||
Comment 34•8 years ago
|
||
| mozreview-review | ||
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 37•8 years ago
|
||
Comment 38•8 years ago
|
||
| mozreview-review | ||
Comment 39•8 years ago
|
||
Comment 40•8 years ago
|
||
| mozreview-review | ||
Comment 41•8 years ago
|
||
Comment 42•8 years ago
|
||
| Assignee | ||
Comment 43•8 years ago
|
||
Comment 44•8 years ago
|
||
Comment 45•8 years ago
|
||
Comment 46•8 years ago
|
||
| mozreview-review | ||
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 49•8 years ago
|
||
Comment 50•8 years ago
|
||
| mozreview-review | ||
Comment 51•8 years ago
|
||
Comment 52•8 years ago
|
||
Comment 53•8 years ago
|
||
| mozreview-review | ||
Comment 54•8 years ago
|
||
Comment 55•8 years ago
|
||
Updated•8 years ago
|
Updated•8 years ago
|
Comment 56•8 years ago
|
||
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 59•8 years ago
|
||
Comment 60•8 years ago
|
||
| mozreview-review | ||
Comment 61•8 years ago
|
||
Comment 62•8 years ago
|
||
Comment 63•8 years ago
|
||
| mozreview-review | ||
Comment 64•8 years ago
|
||
| mozreview-review | ||
Comment 65•8 years ago
|
||
Comment 66•8 years ago
|
||
| Assignee | ||
Updated•8 years ago
|
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
Comment 69•8 years ago
|
||
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 72•8 years ago
|
||
| Comment hidden (mozreview-request) |
| Comment hidden (mozreview-request) |
| Assignee | ||
Comment 75•8 years ago
|
||
Comment 76•8 years ago
|
||
Comment 77•8 years ago
|
||
Comment 78•8 years ago
|
||
Comment 79•8 years ago
|
||
Comment 80•8 years ago
|
||
Comment 81•8 years ago
|
||
Comment 82•8 years ago
|
||
Comment 83•8 years ago
|
||
Comment 84•8 years ago
|
||
Comment 85•7 years ago
|
||
Comment 86•7 years ago
|
||
| Assignee | ||
Comment 87•7 years ago
|
||
| Assignee | ||
Comment 88•7 years ago
|
||
Updated•7 years ago
|
| Assignee | ||
Comment 89•7 years ago
|
||
| Assignee | ||
Comment 90•7 years ago
|
||
Comment 91•7 years ago
|
||
| Assignee | ||
Comment 92•7 years ago
|
||
Updated•7 years ago
|
Comment 93•7 years ago
|
||
| Assignee | ||
Comment 94•7 years ago
|
||
Updated•7 years ago
|
Comment 95•7 years ago
|
||
| Assignee | ||
Comment 96•7 years ago
|
||
Comment 97•7 years ago
|
||
Comment 98•7 years ago
|
||
Comment 99•7 years ago
|
||
Comment 100•7 years ago
|
||
Updated•7 years ago
|
Comment 101•7 years ago
|
||
| Assignee | ||
Comment 102•7 years ago
|
||
Comment 103•7 years ago
•
|
||
Harry, since you already have an updateTouchBarInput() function that can update a touch bar input at any point in time, maybe it's possible to await the promise on the front-end side, and then use updateTouchBarInput() (or some modified version of it) after the promise has been awaited. And initially, in get layout(), you could return dummy strings.
That wouldn't be a very elegant solution (because updateTouchBarInput is probably not meant to be used that way), but I think it could work, and from there you probably will be able to refactor a bit to make it a bit more elegant.
What do you think ?
| Assignee | ||
Comment 104•7 years ago
|
||
Hi Tim, thanks for the nudge. That's a great idea! I hadn't thought of that. Working through it in my head I don't see there being issues with that approach, other than it being a bit inelegant, as you mentioned. I'll give an implementation a shot and report back here soon on if it works or not.
| Assignee | ||
Comment 105•7 years ago
|
||
It worked -- thanks Tim! I posted a new revision on Phabricator. The change affects both the main JS and .mm files, so :mikedeboer and :spohl, could you please take another look?
Updating the Touch Bar inputs after their initial load leads to the buttons loading before their text labels. This only affects the "mainButton" type inputs (the wide ones, like the main focus URL Bar button in the middle). I've handled this by blanking out the entire input while the "load in" happens. On my machine, this takes about half a second. I've added some caching so there's no delay on opening new windows or when Firefox was running in the background. I'd appreciate feedback on if the "load in" effect is acceptable.
Comment 106•7 years ago
|
||
Nice, excited to see this awesome work closer to landing! I've pushed this to try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=7f8b680342bd3fb894d0b0dc77ef8164baff2669 (with the .properties file removed)
ni? mikedeboer and spohl for comment 105. Here's the interdiff since the last review in case it makes things easier: https://phabricator.services.mozilla.com/D5496?vs=34190&whitespace=ignore-all#toc
Comment 107•7 years ago
|
||
New try push with the macOS build failure fixed (see my comment on Phabicator): https://treeherder.mozilla.org/#/jobs?repo=try&revision=1b4a0c7dccf2d96f002a5c4ea365bdeb6baaa990
Comment 108•7 years ago
|
||
(In reply to Tim Nguyen :ntim from comment #106)
Nice, excited to see this awesome work closer to landing! I've pushed this to try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=7f8b680342bd3fb894d0b0dc77ef8164baff2669 (with the .properties file removed)
ni? mikedeboer and spohl for comment 105. Here's the interdiff since the last review in case it makes things easier: https://phabricator.services.mozilla.com/D5496?vs=34190&whitespace=ignore-all#toc
Thanks, :ntim and :harry!
Comment 109•7 years ago
|
||
Tim - if you cache the results of localization, can you also invalidate the cache (using intl:app-locales-changed event)?
Comment 110•7 years ago
|
||
(In reply to Zibi Braniecki [:gandalf][:zibi] from comment #109)
Tim - if you cache the results of localization, can you also invalidate the cache (using
intl:app-locales-changedevent)?
Harry already seems to be doing it in the observe function of MacTouchBar.js.
Comment 111•7 years ago
|
||
Ahhh, you're right! Looks good to me!
Comment 112•7 years ago
|
||
Comment 113•7 years ago
|
||
browser_touchbar_tests.js seems to crash (this is after rebasing the patch, and fixing up the input names in the test).
Comment 114•7 years ago
|
||
This looks relevant: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=222170933&repo=try&lineNumber=12871-12885
02:09:48 INFO - GECKO(1080) | 2019-01-16 02:09:48.125 firefox[1080:16262] -[ToolbarWindow touchBar]: unrecognized selector sent to instance 0x11c05de20
02:09:48 INFO - GECKO(1080) | Hit MOZ_CRASH(Unhandled exception) at /builds/worker/workspace/build/src/toolkit/crashreporter/nsExceptionHandler.cpp:1369
02:09:48 INFO - GECKO(1080) | #01: libc++abi.dylib + 0x260a1
02:09:48 INFO -
02:09:48 INFO - GECKO(1080) | #02: libc++abi.dylib + 0x25b30
02:09:48 INFO -
02:09:48 INFO - GECKO(1080) | #03: libobjc.A.dylib + 0xe898
02:09:48 INFO -
02:09:48 INFO - GECKO(1080) | #04: CoreFoundation + 0x1670ad
02:09:48 INFO -
02:09:48 INFO - GECKO(1080) | #05: CoreFoundation + 0xace24
02:09:48 INFO -
02:09:48 INFO - GECKO(1080) | #06: CoreFoundation + 0xac998
02:09:48 INFO -
02:11:19 INFO - GECKO(1080) | #07: nsTouchBarUpdater::UpdateTouchBarInput(nsIBaseWindow*, nsITouchBarInput*) [widget/cocoa/nsTouchBarUpdater.mm:41]
02:11:19 INFO -
Comment 115•7 years ago
|
||
I can't actually reproduce the crash locally.
Here's a try push with the localization code commented out though: https://treeherder.mozilla.org/#/jobs?repo=try&revision=add09e506fb6cf8b21e3e4c4e569ce418c8aca3e
Just to bisect what's actually causing the crash.
| Assignee | ||
Comment 116•7 years ago
|
||
Ditto to not being able to reproduce locally before and after rebasing on central. The [ToolbarWindow touchBar]: unrecognized selector sent to instance error might indicate that the call to updateTouchBarInput() after the l10n Promise is fulfilled is beating the initialization of the Touch Bar, so there's nothing to update on ToolbarWindow's instance of touchBar. I'll work on a fix for that to see if that's the issue.
Comment 117•7 years ago
|
||
unrecognized selector sent to instance means that the object does not respond to this method. Since our test machines run on hardware without touchbars, this isn't too surprising. We should add a respondsToSelector: check in nsTouchBarUpdater::UpdateTouchBarInput before calling updateItem.
Comment 118•7 years ago
|
||
Comment 119•7 years ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: New feature
[Affects Firefox for Android]: Mac specific
[Suggested wording]: Add OSX touchbar support
[Links (documentation, blog post, etc)]:
Updated•7 years ago
|
| Assignee | ||
Comment 120•7 years ago
•
|
||
This patch collects telemetry, so here is the data review form.
(ed: whoops, it didn't render inline. I'll copy here for convenience:)
Request for data collection review form
-
What questions will you answer with this data?
What buttons on the MacBook Pro Touch Bar are used most often? -
Why does Mozilla need to answer these questions? Are there benefits for users? Do we need this information to address product or business requirements?
Determine what inputs should be placed in the Touch Bar to maximize the benefit to users of Firefox's Touch Bar functionality. -
What alternative methods did you consider to answer these questions? Why were they not sufficient?
We could determine what users have Touch Bars then measure if their engagement with Firefox changes based on different Touch Bar layouts.
This is very imprecise, seeing as overall engagement with the Touch Bar might be quite low, and Touch Bar layout is likely to have a low impact on overall Firefox engagement. -
Can current instrumentation answer these questions?
No. The Touch Bar is an entirely new component and we do not currently have any tools to measure it. -
List all proposed measurements and indicate the category of data collection for each measurement, using the Firefox data collection categories on the Mozilla wiki.
<table>
<tr>
<td>Measurement Description</td>
<td>Data Collection Category</td>
<td>Tracking Bug #</td>
</tr>
<tr>
<td>Using a histogram, count the number of times a labeled button on the Touch Bar is pressed (e.g. "New Tab" pressed 45 times, "Share" pressed 3 times).</td>
<td>Interaction data</td>
<td>1313429</td>
</tr>
</table>
-
How long will this data be collected? Choose one of the following:
I want to collect this data until the release of version 71 (about 8.5 months). -
What populations will you measure?
Any users with a MacBook Pro with Touch Bar, in all countries and locales.
Measurement will start in Nightly and continue through Beta into Release as the Touch Bar feature matures. -
If this data collection is default on, what is the opt-out mechanism for users?
If users blank out the ui.touchbar.layout preference, no buttons will appear on the Touch Bar and thus there will be nothing to measure. -
Please provide a general description of how you will analyze this data.
We will look at which Touch Bar inputs are pressed most often in A/B experiments on the layout.
For instance, is the Share button pressed more often when it is on the left side of the Touch Bar versus the right side?
We will determine what buttons are the most or lesat popular based on the number of times they are pressed. -
Where do you intend to share the results of your analysis?
Internally, with those working on the Touch Bar feature. The UX team might also review the data if they request it.
Comment 121•7 years ago
|
||
Comment 122•7 years ago
|
||
Updated•7 years ago
|
Comment 124•7 years ago
|
||
| bugherder | ||
Comment 125•7 years ago
|
||
(In reply to Sylvestre Ledru [:sylvestre] from comment #119)
Release Note Request (optional, but appreciated)
[Why is this notable]: New feature
[Affects Firefox for Android]: Mac specific
[Suggested wording]: Add OSX touchbar support
[Links (documentation, blog post, etc)]:
Added to Nightly notes with this wording until we get a better one and probably a SUMO page explaining the feature we could link to:
Added Touch Bar support on macOS
Comment 127•7 years ago
|
||
Comment 128•7 years ago
|
||
Coverity is complaining about:
CID 19373 (#1 of 1): Missing break in switch (MISSING_BREAK)unterminated_case: The case for value "intl:app-locales-changed" is not terminated by a 'break' statement.
here:
https://searchfox.org/mozilla-central/source/browser/components/touchbar/MacTouchBar.js#310
is that expected?
Comment 129•7 years ago
|
||
(In reply to Sylvestre Ledru [:sylvestre] from comment #128)
Coverity is complaining about:
CID 19373 (#1 of 1): Missing break in switch (MISSING_BREAK)unterminated_case: The case for value "intl:app-locales-changed" is not terminated by a 'break' statement.
here:
https://searchfox.org/mozilla-central/source/browser/components/touchbar/MacTouchBar.js#310
is that expected?
Definitely not! Luckily, locales don't change too frequently but we should fix this.
Comment 130•7 years ago
|
||
Comment 131•7 years ago
|
||
| Assignee | ||
Comment 132•7 years ago
|
||
Thank you for covering this spohl!
Comment 133•7 years ago
|
||
Updated•7 years ago
|
Comment 134•7 years ago
|
||
| bugherder | ||
Comment 135•7 years ago
|
||
Adding a release note, currently just "Initial macOS touchbar support".
Tim, or Mike, or anyone really: Can you suggest better wording with more detail? Or, is there anything you can link to that explains further?
Comment 136•7 years ago
|
||
"Basic support for macOS touchbar" would probably work, although I have to admit I'm not an expert in wording.
As for links, the best I have is a reddit post: https://www.reddit.com/r/firefox/comments/aitx1q/psa_macos_touch_bar_support_is_in_the_latest/
I don't think that's a good official resource though.
Comment 137•7 years ago
|
||
This might be good to include at https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/66.
Updated•7 years ago
|
Comment 138•7 years ago
|
||
I don't think there's anything to report for developers. Once we add a WebExtension API to control the touchbar, we should, but not for now.
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
| Assignee | ||
Comment 140•6 years ago
|
||
I'm removing the alias so the new Touch Bar meta (bug 1603568) can use it.
Description
•