[customizable menu] Add an "Edit menu items" screen for the Tools menu section
Categories
(Firefox for Android :: Menu, task)
Tracking
()
People
(Reporter: petru, Assigned: petru)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxdroid][android-core])
Attachments
(5 external files)
The Tools section of the customize menu screen gets a new pencil icon, between the section and its drag handle. Tapping it opens a new "Edit menu items" screen.
Part 1: show the text and icons of the menu items in the customize menu screen tinted with onSurfaceVariant instead of onSurface, so the new pencil icon has more contrast. Only for the customize screens, the browser menu is not affected.
Part 2: the "Edit menu items" screen, read only:
- A new
EditMenuItemsFragmentwith its own toolbar title and store. - A "Drag items to reorder" header and a "Preview" button.
- The Tools items one per row, each with a drag handle, then "More", expanded by default and collapsible, with its sub items indented and a divider above and below.
- A "Hidden items" area.
- The pencil icon is shown only when the "Enable tools menu customization" secret setting is on.
Updated•11 days ago
|
| Assignee | ||
Comment 1•2 days ago
|
||
Muting them sets the menu items apart from the edit button that the Tools
section gets next, which keeps the menu's default colors.
Updated•2 days ago
|
| Assignee | ||
Comment 2•2 days ago
|
||
A fragment outlives its views. A store declared as a fragment property with
by fragmentStore was built for the first view and then kept by the
property's Lazy for as long as the fragment lived. When the fragment came
back from the back stack with a new view, it kept using that first store:
its middleware still held the destroyed view's scope and references, and
actions dispatched when a store is created, like Init, never ran again.
The Lazy now follows the fragment's view lifecycle, as the Android
guidance on fragment lifecycles recommends for anything tied to the view:
the view has a lifecycle separate from the fragment's, and references to it
should be dropped once it is destroyed. The Lazy keeps the view lifecycle
its store was built in and, once that is destroyed and the fragment has a
new view, builds a new store from the last state. Reads while the fragment
has no view, like onDismiss called from onDestroyView, still get the
last store.
activityStore, navBackStackStore and composableStore are not
affected. Their Lazy belongs to something that ends together with the
owner of the store: a new activity, the fragments of a popped back stack
entry and a new composition all come with a new Lazy.
The browser screen now builds its store from the restored state, so reader
mode, translations and custom tab colors keep their state when coming back
to the browser. The downloads screen keeps its first store, so a delete can
still be undone after coming back from the downloads settings.
| Assignee | ||
Comment 3•2 days ago
|
||
The reset to default dialog was its own fragment, so the customize menu screen kept its store in the
back stack entry of its nav graph for the dialog to reach. That entry, and the fragment, outlive the
screen's view: once another screen replaces this one, as the upcoming edit menu items screen will,
coming back reused the old store, whose middleware scope was cancelled with the old view, so
resetting and saving stopped working and the customization was not read again.
The customize menu screen now shows the dialog itself and only tells its store once the user
confirms, so no other fragment needs the store. It becomes a fragmentStore, built again from its
last state for each new view of the screen. The dialog's strings move to the menu component with it,
and ResetToDefaultClicked, which only opened the dialog, is removed.
To test:
- Open the browser menu, then Customize menu, and tap Reset to default: the confirmation dialog is
shown. - Tap Cancel, tap outside the dialog or press Back: the dialog closes and nothing is reset.
- Move a section, tap Reset to default, then Reset: the default sections are shown.
- Open the dialog and rotate the device: the dialog is still shown.
| Assignee | ||
Comment 4•2 days ago
|
||
The upcoming edit menu items screen shows the Tools items laid out like the customize menu screen,
with More as an expandable header whose expanded state the screen's store keeps. So the header of
an expandable menu item becomes its own composable, given whether it is expanded and what to do on
click, and the layout that centers the customize menu list in the window becomes its own composable
too.
The Tools group in the customize menu screen shows only part of its last item. That part was
measured to fit the reported height, so once the group sits in a row sized to its content, as it
will next to the edit button, its last item is squeezed. It is now measured for its full height,
which changes nothing in the screen as it is today.
To test:
- Open the browser menu, expand More and collapse it again: it works and looks as before.
- Open Customize menu: the sections look as before, also with the device rotated.
| Assignee | ||
Comment 5•2 days ago
|
||
With tools menu customization enabled, the Tools section of the customize menu screen gets an edit
button, which opens the edit menu items screen. That screen lists the section's items as they are
saved, the shown ones first and the hidden ones below the hidden items title, with More expanded
to show its items while shown and collapsed while hidden. Items can't be moved yet; this only sets
up the screen that the next patches let the user change the items in.
The button is not shown while the section is hidden or dragged. Screen readers get it as an action
of the section, since the section is read as one element.
To test:
- In Secret settings, enable "Enable tools menu customization".
- Open the browser menu, then Customize menu: the Tools section has an edit button. Drag Tools or
hide it: the button goes away while it is dragged or hidden. - Tap the edit button: the Edit menu items screen slides in and shows the Tools items, with More
expanded. Tap More to collapse and expand it. - Tap Preview: the menu opens as a preview. Press Back: the Edit menu items screen is shown again.
Press Back again: Customize menu is shown. - Disable the setting: the Tools section has no edit button.
Description
•