Open Bug 1965540 Opened 6 days ago

Store config-based settings config in a file

Categories

(Firefox :: Settings UI, enhancement)

enhancement

Tracking

()

People

(Reporter: mstriemer, Unassigned)

References

(Blocks 1 open bug)

Details

Managing the configuration of settings in JS is fairly inconvenient, we will also need to generate a new configuration when we change the IA of the settings page. Moving the base configuration to a file will greatly simplify this process.

Current example:

Preferences.addSetting({
  id: "useFullKeyboardNavigation",
  pref: "accessibility.tabfocus",
  visible: () => AppConstants.platform == "macosx",
  get(prefVal) { ... },
  set(checked) { ... },
});

Moving the base configuration to a file will result in something like this:

Preferences.configureSetting("useFullKeyboardNavigation", {
  visible: () => AppConstants.platform == "macosx",
  get(prefVal) { ... },
  set(checked) { ... },
});

For cases where there is no code (visible, get, set, onUserChange, getControlConfig) associated with the current Prerences.addSetting() call, no code should be required to register the setting.

Acceptance criteria:

  • Preferences.configureSetting() API is created to extend an already registered Setting
  • A config file can be read and it will register the Preference.addSetting() calls
  • Unit testing
You need to log in before you can comment on or make changes to this bug.