Closed Bug 1978145 Opened 1 year ago Closed 5 months ago

Implement dynamic toolbar on top in RDM

Categories

(DevTools :: Responsive Design Mode, task, P2)

task

Tracking

(firefox152 fixed)

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: ajakobi, Assigned: mstange)

References

(Blocks 2 open bugs)

Details

Attachments

(8 files, 6 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

The initial implementation of the dynamic toolbar in responsive design mode only shows the toolbar at the bottom.
This task should enable positioning the toolbar at the top.

Priority: -- → P2
Duplicate of this bug: 1989133

This makes it easier to line things up accurately.

The current contentScrolled message doesn't let us know when the mouse button is released.

I realized that we don't necessarily need tho dynamic toolbar mouse tracking to be done by the touch simulator.
We can just listen to mouse events in two different places.

This patch makes us no longer use the contentScrolled message. We can remove it again.

Alex, Markus, Any way DevTools team can help with this ongoing work?

This looks like a very useful feature to help WebCompat team investigate mobile issues from desktop.

Flags: needinfo?(mstange.moz)
Flags: needinfo?(ajakobi)

Hi Alex, sorry for the delay. It would be great if you could take these patches and drive them to completion!

I think the code itself is fine, it's more that the patch series isn't fully optimized for ease of review.

If I remember correctly, the things left to do were:

  • Merge and re-split the patches so that the visual look is maintained at any point in the patch stack. Specifically, there's one part which gets rid of the borders and shadows, and another part which adds a new element with the shadow to restore the original look, so I think it would make sense to move this "solution" to the start of the stack.
  • Split the "Move mouse motion detection to the parent, and add snap animation when the mouse button is lifted." patch into the two pieces described by its commit message
  • Do another review pass of the patches and maybe split out things that don't really belong in a patch. For example I see that D265176 is also centralizing the pref reading, and it's moving the initialization of the dynamic toolbar behavior down so that it's not interspersed between the DOM element creation that the rest of the function is doing. So maybe those things would be better in a separate patch.
Flags: needinfo?(mstange.moz)
Flags: needinfo?(ajakobi)
Assignee: ajakobi → nobody

I've picked this back up.

Assignee: nobody → mstange.moz
Status: NEW → ASSIGNED
Attachment #9513871 - Attachment is obsolete: true
Attachment #9513872 - Attachment is obsolete: true
Attachment #9513873 - Attachment is obsolete: true
Attachment #9513874 - Attachment is obsolete: true
Attachment #9514162 - Attachment is obsolete: true
Attachment #9514174 - Attachment is obsolete: true

Remove the --resizer-offset variable (which really meant "reserved space for side
resize handles") and replace the browser border with an outline, so that at zoom:1
the browser size exactly matches rdm-width x rdm-height. We use negative margins on
the side resize handles to center their interactable location on the respective
side border.

This makes the dynamic toolbar have the correct size when using page zoom in RDM.

There's one user-visible change that this introduces: The size of the resizer, as well
as the size of the interactive areas of the side resize handles, now depends on the zoom.

Just feels a bit cleaner and is more consistent with the .dynamic-toolbar-on-top
class which I'll be adding in a future patch.

This gives it a "URL bar" (just a shape with rounded endcaps) and a
"tab count indicator" (just a rounded rect with a 1 in it) just so
that it feels a bit more familiar.

This also moves the mouse motion detection to the parent, and removes the use of the
contentScrolled message.

The problem with the contentScrolled message is that it doesn't let us know when the mouse button is released.
Rather than adding another message, I think it's simpler to just do mouse tracking in two places.
There's not much value in having the touch simulator (which runs inside the content) do the
scroll tracking.

This patch doesn't remove the code that fires the contentScrolled message.
That might be worth doing in a follow-up, but I'm inclined to leave it for now, in case we want to use
it again in the future.

This is rather messy, because the approach of "toolbar pushes down browser"
matches the real implementation in Fenix which is also rather messy.

It works well enough to reproduce some formerly mobile-only bugs.

Having this functionality will be helpful during the work on the
"overlap model" (bug 1921331), and the result of that work should let us
simplify this RDM code again.

There's one known bug in this RDM implementation, which is that dragging the
page to scroll down can sometimes scroll the content at twice the desired speed
if the content is also moved by a growing / shrinking toolbar. The real Fenix
implementation does not have this bug. But it's not a big problem.

Attachment #9570807 - Attachment description: WIP: Bug 1978145 - Make RDM element sizes and positions easier to reason about. → Bug 1978145 - Make RDM element sizes and positions easier to reason about. r=#devtools-reviewers
Attachment #9570809 - Attachment description: WIP: Bug 1978145 - Simplify RDM resizer positioning in the presence of zoom, by introducing a scaled wrapper element. → Bug 1978145 - Simplify RDM resizer positioning in the presence of zoom, by introducing a scaled wrapper element. r=#devtools-reviewers
Attachment #9570810 - Attachment description: WIP: Bug 1978145 - Use a .dynamic-toolbar-enabled class instead of .style.visibility. → Bug 1978145 - Use a .dynamic-toolbar-enabled class instead of .style.visibility. r=#devtools-reviewers
Attachment #9570812 - Attachment description: WIP: Bug 1978145 - Make .rdm-dynamic-toolbar look more like an actual toolbar. → Bug 1978145 - Make .rdm-dynamic-toolbar look more like an actual toolbar. r=#devtools-reviewers
Attachment #9570813 - Attachment description: WIP: Bug 1978145 - Increase DYNAMIC_TOOLBAR_MAX_HEIGHT to 50px, because a 50px toolbar looks more realistic. → Bug 1978145 - Increase DYNAMIC_TOOLBAR_MAX_HEIGHT to 50px, because a 50px toolbar looks more realistic. r=#devtools-reviewers
Attachment #9570814 - Attachment description: WIP: Bug 1978145 - Make the RDM dynamic toolbar snap to fully-visible or fully-hidden when the mouse is released. → Bug 1978145 - Make the RDM dynamic toolbar snap to fully-visible or fully-hidden when the mouse is released. r=#devtools-reviewers
Attachment #9570816 - Attachment description: WIP: Bug 1978145 - Add support for toolbar-on-top to RDM's dynamic toolbar mode. → Bug 1978145 - Add support for toolbar-on-top to RDM's dynamic toolbar mode. r=#devtools-reviewers
Blocks: 2033112

Unrelated to this bug, but something I noticed while using RDM: After
exiting RDM, fixed-to-bottom toolbars would sometimes be in the wrong
spot.

Pushed by mstange@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ad32300ffdbf https://hg.mozilla.org/integration/autoland/rev/c7ebc7fdebec Make RDM element sizes and positions easier to reason about. r=devtools-reviewers,nchevobbe https://github.com/mozilla-firefox/firefox/commit/9a9555c4023f https://hg.mozilla.org/integration/autoland/rev/c58dfb858319 Simplify RDM resizer positioning in the presence of zoom, by introducing a scaled wrapper element. r=devtools-reviewers,nchevobbe https://github.com/mozilla-firefox/firefox/commit/e0c761fc081e https://hg.mozilla.org/integration/autoland/rev/7b0cb42dc962 Use a .dynamic-toolbar-enabled class instead of .style.visibility. r=devtools-reviewers,nchevobbe https://github.com/mozilla-firefox/firefox/commit/56abc6071736 https://hg.mozilla.org/integration/autoland/rev/5a5d73443044 Make .rdm-dynamic-toolbar look more like an actual toolbar. r=devtools-reviewers,nchevobbe https://github.com/mozilla-firefox/firefox/commit/afed24ab1ee2 https://hg.mozilla.org/integration/autoland/rev/ade2d231c9a6 Increase DYNAMIC_TOOLBAR_MAX_HEIGHT to 50px, because a 50px toolbar looks more realistic. r=devtools-reviewers,nchevobbe https://github.com/mozilla-firefox/firefox/commit/c5429f17ede6 https://hg.mozilla.org/integration/autoland/rev/c3ab11c4f10f Make the RDM dynamic toolbar snap to fully-visible or fully-hidden when the mouse is released. r=devtools-reviewers,nchevobbe https://github.com/mozilla-firefox/firefox/commit/56015cceeb39 https://hg.mozilla.org/integration/autoland/rev/a14aecb1b2f4 Add support for toolbar-on-top to RDM's dynamic toolbar mode. r=devtools-reviewers,nchevobbe https://github.com/mozilla-firefox/firefox/commit/de98b4b039cf https://hg.mozilla.org/integration/autoland/rev/ecb278dc62ea Reset setVerticalClipping and setDynamicToolbarMaxHeight when exiting RDM. r=devtools-reviewers,nchevobbe
QA Whiteboard: [qa-triage-done-c153/b152]

It's still behind a hidden pref. I think we can add it once we add an actual button / checkbox in the UI to enable it.

Flags: needinfo?(mstange.moz)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: