Closed Bug 1976535 Opened 1 month ago Closed 29 days ago

[composable toolbar] Using the navbar breaks searching mode

Categories

(Firefox for Android :: Toolbar, defect, P2)

All
Android
defect

Tracking

()

RESOLVED FIXED
143 Branch
Tracking Status
firefox143 --- fixed

People

(Reporter: petru, Assigned: petru)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][group3][composable toolbar])

Attachments

(2 files, 2 obsolete files)

Steps to reproduce

  1. Enable both the composable toolbar and the toolbar redesign feature from secret settings
  2. Enable the expanded toolbar layout from the "Customize" settings screen
  3. Tap on the toolbar from the home screen

Expected behavior

The toolbar enters in search mode

Actual behavior

Nothing happens

Looking more into this it seems to be happening because HomeNavigationBar is instantiated before HomeToolbarComposable and it will create a new BrowserToolbarStore without the search related middlewares.

Ideally we should only use one BrowserToolbarStore per screen/fragment.
Since HomeNavigationBar only needs a simple store and HomeToolbarComposable needs more configuration it seems like we need to have a way to have HomeToolbarComposable instantiate first the BrowserToolbarStore and then pass it to HomeNavigationBar.

Setting S4 since this bug only reproduces in the context of 2 not released features.

Severity: S2 → S4
Assignee: nobody → petru
Status: NEW → ASSIGNED
Whiteboard: [fxdroid][group3][composable toolbar]

Considered adding the navbar in the HomeToolbarComposable / BrowserToolbarComposable. This could work but the contract of these classes is to return the toolbar layout so then these would do more than expected.
Also considered just passing to HomeNavigationBar / BrowserNavigationBar the BrowserToolbarStore instance from HomeToolbarComposable / BrowserToolbarComposable in a similar way to how it happens for the awesomebar but the navbar might be instantiated separately from the toolbar when the toolbar is to be shown at the top of the screen.

The easiest though is just to ensure the the navbar is instantiated after the toolbar composable. This would ensure that it will be able to access the same BrowserToolbarStore previously setup by the toolbar composable.

This would ensure the navbar will see the BrowserToolbarStore previously set up
by the composable toolbar.

Previously both the navbar and the addressbar would build their own BrowserToolbarStore
but have this persisted as a ViewModel in the containing fragment.
This meant that whoever would try to build the store the second time would get the
initially built store, with potentially different middlewares set.

This patch brings one clear API to build the BrowserToolbarStore that can be used by multiple
separate features which would get the store instance properly configured to support them all.

Attachment #9500340 - Attachment is obsolete: true
Pushed by plingurar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8127efa0b48c https://hg.mozilla.org/integration/autoland/rev/ad7a36306f2b Use the same BrowserToolbarStore builder for both the navbar and the addressbar r=android-reviewers,Roger

This brings a matching initialization flow to what is used in the browser screen.

Backed out for fenix failures.

Push with failures

Failure log

Backout link

See Also: → 1978626
Pushed by plingurar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/bc69e8fbdfeb https://hg.mozilla.org/integration/autoland/rev/60e5e776efad Use the same BrowserToolbarStore builder for both the navbar and the addressbar r=android-reviewers,Roger https://github.com/mozilla-firefox/firefox/commit/5ea4161e2d8a https://hg.mozilla.org/integration/autoland/rev/a4c712ffead5 Only instantiate the home navbar if the composable toolbar is enabled r=android-reviewers,Roger
Status: ASSIGNED → RESOLVED
Closed: 29 days ago
Resolution: --- → FIXED
Target Milestone: --- → 143 Branch

This reverts commit 5ea4161e to get back in the state where we observed memory leaks

Attachment #9502683 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: