Closed Bug 1964824 Opened 1 year ago Closed 1 year ago

Support nesting of settings in config-based settings

Categories

(Firefox :: Settings UI, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: mstriemer, Assigned: mstriemer)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [recomp])

Attachments

(3 files)

We will need to nest some settings under the parent setting. Add support for a setting itself to have items within it, which will be treated like any other setting, but be nested under their parent and get disabled when the parent is not checked/pressed

Here's an example config for Home > Firefox Home Content > Recent activity

{
  id: "recent-activity",
  l10nId: "recent-activity-label",
  items: [
    { id: "recent-activity-rows", l10nId: "recent-activity-rows-label", control: "select" },
    { id: "recent-activity-visited", l10nId: "recent-activity-visited-label" },
    { id: "recent-activity-bookmarks", l10nId: "recent-activity-bookmarks-label" },
    { id: "recent-activity-downloads", l10nId: "recent-activity-downloads-label" },
  ],
}

here's a quick hack from the blocked bug 1961210 to recursively create settings-group when there's nested items:

       result = checkbox;
     }
+    if (item.items) {
+      const container = document.createXULElement("vbox");
+      const subgroup = document.createElement("setting-group");
+      subgroup.classList.add("indent");
+      subgroup.config = item;
+      subgroup.getSetting = this.getSetting;
+      container.append(result, subgroup);
+      result = container;
+    }
     if (item.subcategory) {
       result.dataset.subcategory = item.subcategory;

https://phabricator.services.mozilla.com/D247542 where it includes the parent checkbox in the subcategory, e.g., for about:preferences#general-link-preview

Assignee: nobody → mstriemer
Status: NEW → ASSIGNED
Pushed by elee@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/13b4bf2804b2 Part 1: Style parent disabled inputs as disabled r=reusable-components-reviewers,desktop-theme-reviewers,hjones https://hg.mozilla.org/integration/autoland/rev/0b349eefcafb Part 2: Remove XUL config-based settings r=reusable-components-reviewers,settings-reviewers,mconley,hjones https://hg.mozilla.org/integration/autoland/rev/9c3efb0aa027 Part 3: Nesting for config-based settings r=reusable-components-reviewers,settings-reviewers,hjones,mconley
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
QA Whiteboard: [qa-triage-done-c141/b140]
Regressions: 1976006
Regressions: 1983902
Blocks: 2021104
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: