Bug 1906657 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

As a followup to bug 1892762 which described a scenario in which snackbars might overlap the navbar we should look into ensuring that snackbars are only shown by the parent of the navbar - so that they can be shown above the navbar.

Fenix started adding a padding to the snackbar a long time ago - https://github.com/mozilla-mobile/fenix/issues/6413 to fake proper placement.
This padding was softly deprecated by the new `FenixSnackbarBehavior` (added in bug 1812518) which allowed to position the snackbar on top any other sibling, not just the toolbar.
But this is not currently used all throughout the app and there are still cases where the hardcoded padding will lead to UI bugs when the navbar is showing which can make double the height of the previous toolbar. 

My proposal is to remove the [`isDisplayedWithBrowserToolbar` param of `FenixSnackbar.make(..)`](https://searchfox.org/mozilla-central/rev/6936c4c3fc9bee166912fce10104fbe0417d77d3/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/FenixSnackbar.kt#129) in favor of ensuring that snackbars that should be shown on top of the toolbar are only shown from the screen also showing the toolbar. And ensuring that we use a behavior to handle the proper placement without caring about actual height of the anchor.
Eg: [this snackbar](https://searchfox.org/mozilla-central/rev/6936c4c3fc9bee166912fce10104fbe0417d77d3/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarMenuController.kt#163) will overlap the navbar even if `isDisplayedWithBrowserToolbar == true`. This is easily solved by ensuring that the controller can ask the View (here the BrowserFragment) to show the snackbar (process in which we also improve the separation of responsabilities between view/controller - a controller should not directly touch the view).
As a followup to bug 1892762 which described a scenario in which snackbars might overlap the navbar we should look into ensuring that snackbars are only shown by the parent of the navbar - so that they can be shown above the navbar which can have double the height of the previous toolbar.

Fenix started adding a padding to the snackbar a long time ago - https://github.com/mozilla-mobile/fenix/issues/6413 to fake proper placement.
This padding was softly deprecated by the new `FenixSnackbarBehavior` (added in bug 1812518) which allowed to position the snackbar on top any other sibling, not just the toolbar.
But this is not currently used all throughout the app and there are still cases where the hardcoded padding will lead to UI bugs when the navbar is showing.
Fiddling with the FenixSnackbar code to consider whether the app shows a toolbar or a navbar, whether it's shown at the top or bottom is just technical debt in my opinion.

My proposal is to remove the [`isDisplayedWithBrowserToolbar` param of `FenixSnackbar.make(..)`](https://searchfox.org/mozilla-central/rev/6936c4c3fc9bee166912fce10104fbe0417d77d3/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/FenixSnackbar.kt#129) in favor of ensuring that snackbars that should be shown on top of the toolbar are only shown from the screen also showing the toolbar. And ensuring that we use a behavior to handle the proper placement without caring about actual height of the anchor.
Eg: [this snackbar](https://searchfox.org/mozilla-central/rev/6936c4c3fc9bee166912fce10104fbe0417d77d3/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarMenuController.kt#163) will overlap the navbar even if `isDisplayedWithBrowserToolbar == true`. This is easily solved by ensuring that the controller can ask the View (here the BrowserFragment) to show the snackbar (process in which we also improve the separation of responsabilities between view/controller - a controller should not directly touch the view).

Back to Bug 1906657 Comment 0