Open Bug 1964824 Opened 5 days ago Updated 5 days ago

Support nesting of settings in config-based settings

Categories

(Firefox :: Settings UI, enhancement)

enhancement

Tracking

()

People

(Reporter: mstriemer, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [recomp])

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

You need to log in before you can comment on or make changes to this bug.