Closed Bug 2082393 Opened 1 month ago Closed 13 days ago

[customizable menu] Support persisting the reordered menu structure

Categories

(Firefox for Android :: Menu, task)

All
Android
task

Tracking

()

RESOLVED FIXED
161 Branch
Tracking Status
firefox161 --- fixed

People

(Reporter: petru, Assigned: petru)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][android-core])

Attachments

(8 external files, 1 obsolete file)

Fenix should handle the action informing about an updated menu structure in its own Middleware.

Assignee: nobody → petru
Status: NEW → ASSIGNED

This ensures a cleaner separation between the state and actions of
MenuStore and what we need for the customization screen, eg: what
menu sections to show as hidden and support for informing when the
menu structure has changed.

MenuConfigurations.browser can now order the menu sections as chosen by
the user, and there is a default structure with support for sections
which start hidden.
CustomizedMenuInfo.reconciledWith adapts a stored customization to the
sections available in the app: it drops unknown sections, keeps the
required ones visible, and adds sections new in this app version as shown
or hidden as in the default.

Also moves the mapping of a menu section to a MenuItemsGroup to
MenuSectionConfiguration so it can be reused outside of MenuBuilder.

Splits MenuConfigurations into BrowserMenuConfiguration, HomeMenuConfiguration
and CustomTabMenuConfiguration, each owning its own section ids, and moves
them, together with MenuSectionConfiguration and FenixMenuItem, to a new
components.menu.configuration package.
Only the browser menu supports customization, so this keeps that logic
separate from the other menus.

No behavior changes.

Add MenuCustomizationRepository, which reads and saves the user's browser
menu customization through the proto DataStore. Stored data is reconciled
with the sections currently available in the app every time it is read,
and only written back when the user changes the menu.

The browser menu is built from the stored customization, falling back to
the default structure while it is not read yet. The customize menu screen
shows the current structure and saves every change through the new
CustomizeMenuMiddleware, which also tells the screen whether the menu
differs from the default one.

The customization is read ahead of the menu being opened after visual
completeness, or when the customize menu screen is enabled in secret
settings.

CustomizeMenuMiddleware now fills the customize menu screen with the
actual items of every browser menu section, built by a MenuBuilder over
BrowserMenuConfiguration.allSections() so that sections the user hid are
also available.
Sections are shown in the user's order, with support for mandatory
sections and also hidden ones.

Two sections were skipped from showing in the "Customize menu screen".
We should allow all sections to be customized to ensure that when these
do show up in the menu they will follow the order the user wanted.

Remove the interactions support for items shown in this screen.
Reuse the shape, semantics and content helpers of the shared menu
composables instead of keeping private copies, and drop the unused
backgroundColor parameters.
Only pass the visible items of a collapsed section so that the hidden
ones are not read by TalkBack.
Show the "Drag sections to reorder" text as a marquee when it does not
fit next to the preview button.
Keep a bottom margin under the hidden sections placeholder.
Reuse more composables instead of duplicating the code.

Attachment #9671085 - Attachment description: Bug 2082393 - part 7 - Ensure we show all menu sections in the customize menu screen. r=#android-reviewers → Bug 2082393 - part 7 - Ensure the "Sign in" menu item does not show a summary in the "Customize menu" screen r=#android-reviewers
Attachment #9671087 - Attachment is obsolete: true
Pushed by plingurar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e38bbf61519c https://hg.mozilla.org/integration/autoland/rev/c9c709a41334 part 1 - New CustomizableMenuStore r=android-reviewers,giorga,android-build-system-reviewers https://github.com/mozilla-firefox/firefox/commit/41e2655fe6d1 https://hg.mozilla.org/integration/autoland/rev/6cd9d68a8013 part 2 - New proto datastore for the browser menu customization data r=android-reviewers,giorga https://github.com/mozilla-firefox/firefox/commit/9f149111cde3 https://hg.mozilla.org/integration/autoland/rev/726f72c263a8 part 3 - Build the browser menu from the user's customization data r=android-reviewers,giorga https://github.com/mozilla-firefox/firefox/commit/67a84c5b4288 https://hg.mozilla.org/integration/autoland/rev/ea10f180696e part 4 - Move the menu configurations to a new configuration package r=android-reviewers,giorga https://github.com/mozilla-firefox/firefox/commit/5892c8dc7855 https://hg.mozilla.org/integration/autoland/rev/d266905364e7 part 5 - Persist the browser menu customization made in the customize menu screen r=android-reviewers,giorga https://github.com/mozilla-firefox/firefox/commit/9830219c98d9 https://hg.mozilla.org/integration/autoland/rev/a67486a9d738 part 6 - Show the browser menu sections in the customize menu screen r=android-reviewers,giorga https://github.com/mozilla-firefox/firefox/commit/9cf23f09ce46 https://hg.mozilla.org/integration/autoland/rev/80520123d80f part 7 - Ensure the "Sign in" menu item does not show a summary in the "Customize menu" screen r=android-reviewers,giorga https://github.com/mozilla-firefox/firefox/commit/382980a420ae https://hg.mozilla.org/integration/autoland/rev/cd24f566d091 part 8 - Small updates to the items layout in the Customize menu screen r=android-reviewers,giorga
See Also: → 2082392
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: