Implement a system for cross pane preference/setting dependencies
Categories
(Firefox :: Settings UI, task)
Tracking
()
People
(Reporter: hjones, Assigned: hjones)
References
(Blocks 1 open bug)
Details
(Whiteboard: [recomp])
Attachments
(2 external files)
We occasionally run into a scenario in about:preferences where code in one pane relies on a setting that was registered in another pane. Currently we don't have proper support for the case where:
- we have two panes,
paneOneandpaneTwo paneOneregisters a setting that depends on a pref added inpaneTwopaneOneloads beforepaneTwo
// paneOne.mjs
Preferences.addSetting({
id: "paneOnePref",
pref: "pane.one.pref",
deps: ["pane.two.pref"],
});
// paneTwo.mjs
Preferences.addSetting({
id: "paneTwoPref",
pref: "pane.two.pref",
});
When this happens currently we don't get reliable values/updates for the dependency in paneA.
As a workaround, we have been adding prefs/registering settings that are needed by more than one pane in main.js - these prefs are added here, and the settings are registered like this.
We should implement a better system to support this kind of cross pane dependency. Some things to consider:
- settings will effectively need some way to subscribe to prefs that are added/settings that are registered in a pane that loads later - we will need some way to notify subscribers that a pref/setting value is available
- we may need some way to determine and load the pane that is associated with a give pref
Updated•1 month ago
|
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•9 days ago
|
||
This patch makes the settings dependency system a bit more flexible by adding a mechanism to handle the case where settingA depends on settingB, but settingB gets loaded after settingA.
Updated•9 days ago
|
| Assignee | ||
Comment 2•9 days ago
|
||
This patch makes it possible to specify when settings panes depend on additional panes being loaded to work as expected.
Description
•