Closed Bug 1920489 Opened 2 years ago Closed 1 year ago

Add pref branch for introduction of new tools in the sidebar launcher

Categories

(Firefox :: Sidebar, task, P1)

task

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
firefox138 --- fixed

People

(Reporter: Gijs, Assigned: sclements)

References

Details

(Whiteboard: [fidefe-sidebar])

Attachments

(1 external file)

Right now the list of actions in the new launcher sidebar is configured via the sidebar.main.tools pref. We ship this with a given default value (at time of writing, aichat,syncedtabs,history). When users turn individual tools off using the "Customize sidebar" pane, the value of this pref changes, being a comma-separated list of the tools shown there.

Sidebars can be "invisible", based on the pref with which they are configured (which controls the sidebar.visible property which in turn controls the tool.hidden property). Such sidebars are included in the pref value when the user toggles other sidebar panes through the customize sidebar controls (even if/when there is no checkbox for the given sidebar in "customize sidebar"). In other words, on nightly by default the AI chat sidebar is not enabled, but if I check/uncheck history/bookmarks/synced tabs, the aichat value stays in sidebar.main.tools.

The discussion on phabricator was about whether we should add review checker to the list of sidebar panes given it is disabled right now.

There seem to be some conflicting requirements:

  • of course under no circumstances do we want to overwrite user settings to hide a given item, once they are able to do so using the checkboxes in customize sidebar
  • for 132 we'll want to use Nimbus to control the [default] value of this pref.
  • we don't want each sidebar pane that we add (ai chat, review checker, contextual passwords) to have to write its own code to add the item "by default" for users who may have customized the visible sidebar tools items at the point where that sidebar is introduced.

It looks to me like right now the default already makes the "aichat" sidebar visible, and whether it is actually visible is controlled by the other pref (browser.ml.chat.enabled) feeding into sidebar.visible and/or tool.hidden.

ISTM that we probably want to do the same for review checker (RC), as this would basically guarantee that the item will be in the list for users, even if they customize the list, if/when we enable the RC sidebar for them, without requiring other/further work to do a "migration" or similar.

I'm curious if I'm missing a reason this is the wrong approach, or a way this interferes with Nimbus recipes.

More generally I'd be interested in suggestions that would make it easier for future consumers of the sidebar (thinking particularly of contextual password mgmt) to integrate without having to do "manual" migration work (which would be error-prone). Do we need Yet Another Pref, or something?

Flags: needinfo?(sclements)
Flags: needinfo?(fchasen)
Whiteboard: [fidefe-sidebar]
Assignee: nobody → sclements
Severity: -- → S4
Status: NEW → ASSIGNED
Flags: needinfo?(sclements)
Priority: -- → P1
See Also: → 1944101

What was discussed and decided is to use a pref branch for each new tool, ie "CPM", "review-checker", etc and then use the Services.prefs.getChildList API to iterate over all prefs in the branch and add them to sidebar.main.tools once based on properties stored in the individual prefs. This will also allow the introduction of the tool to users by adding the pref in-tree or via nimbus for an experiment.

This bug will handle this part, but it only covers these use cases:

  • Add a tool once to all users in-tree, which would apply even if multiple tools are added over several releases and an existing user later upgrades (ie, goes from 133 to 138).
  • Alternatively, add a tool once to all users via nimbus, or via special targeting of only new profiles or only existing profiles

What it doesn't cover is for the bookmarks scenario, where Ania has asked for us to introduce it to new sidebar.revamp users - which may or may not be a new profile - but not to existing sidebar.revamp users. I think for this we'd want to take the approach outlined in my proposal to change how we use tools (default empty state rather than a fixed value that can't be changed), and do a migration. But I've filed a separate bug for that which can land independently of this since it solves the immediate need for Review Checker.

Type: defect → task
Summary: Figure out how to deal with multiple new sidebar panes, nimbus experiments, and user control → Add pref branch for introduction of new tools in the sidebar launcher
See Also: → 1947997
Flags: needinfo?(fchasen)
Attachment #9465473 - Attachment description: Bug 1920489 - Set up pref branch for introducing tools to users r=#sidebar-reviewers → WIP: Bug 1920489 - Set up pref branch for introducing tools to users r=#sidebar-reviewers
Blocks: 1952285
Attachment #9465473 - Attachment description: WIP: Bug 1920489 - Set up pref branch for introducing tools to users r=#sidebar-reviewers → Bug 1920489 - Set up pref branch for introducing tools to users r=#sidebar-reviewers
Attachment #9465473 - Attachment description: Bug 1920489 - Set up pref branch for introducing tools to users r=#sidebar-reviewers → WIP: Bug 1920489 - Set up pref branch for introducing tools to users r=#sidebar-reviewers
Attachment #9465473 - Attachment description: WIP: Bug 1920489 - Set up pref branch for introducing tools to users r=#sidebar-reviewers → Bug 1920489 - Set up pref branch for introducing tools to users r=#sidebar-reviewers
Pushed by sclements@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9274c74a9e45 Set up pref branch for introducing tools to users r=sidebar-reviewers,Gijs
Pushed by sclements@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e59ec9fe6316 Set up pref branch for introducing tools to users r=sidebar-reviewers,Gijs
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: