Skip to content

feat: add SelectPreference component#2091

Merged
AprilSylph merged 1 commit intomasterfrom
aprilsylph/select-preference-component
Feb 6, 2026
Merged

feat: add SelectPreference component#2091
AprilSylph merged 1 commit intomasterfrom
aprilsylph/select-preference-component

Conversation

@AprilSylph
Copy link
Owner

Description

Creates a SelectPreferenceElement class and SelectPreference shorthand function, for rendering colour-type preferences.

Like previous preference components, this PR does not implement any usages of the component, just the component itself.

This one was fun, because I found out that setting HTMLSelectElement.value does actually work, provided it matches the value of one of the <option> elements. I've opted to keep the code simple by leveraging this, which does come at the cost of component instances needing to set options before setting its own value, but I think that's fine—the JSdoc already says that value must match one of the options.

Testing steps

  1. Pull this branch locally
  2. Apply this patch: select-preference.patch
  3. Load the modified addon
  4. Open the XKit control panel and enable Vanilla Audio
    • Expected result: The "Default Volume" preference renders without issue
    • Expected result: The "Default Volume" preference renders showing 100% selected, which is notably not the first option in the list
  5. Change a select-type preference in any feature
    • Expected result: The changed preference value is reflected in the Backup tab
  6. Close and reopen the XKit control panel
    • Expected result: Any changed select-type preferences render showing their saved value selected, instead of their default

@AprilSylph AprilSylph marked this pull request as ready for review February 5, 2026 11:27
@AprilSylph AprilSylph merged commit 763b8b4 into master Feb 6, 2026
5 checks passed
@AprilSylph AprilSylph deleted the aprilsylph/select-preference-component branch February 6, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants