Add extensibility API for LSB that allows LSMSettingsWidgets to register custom types for declarative controls.#102
Conversation
argium
commented
May 21, 2026
- Add extensibility API for LSB that allows LSMSettingsWidgets to register custom types for declarative controls.
- Fixed XML registration conflict when the lib is embedded in more than one addon.
…ter custom types for declarative controls. Fixed XML registration conflict when the lib is embedded in more than one addon.
Test Results890 tests ±0 890 ✅ ±0 1s ⏱️ -1s Results for commit b3f2b45. ± Comparison against base commit 8f1c483. This pull request removes 23 and adds 23 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
This PR introduces an extension mechanism in LibSettingsBuilder (LSB) so external libraries (notably LibLSMSettingsWidgets) can register reusable Lua-backed declarative row types (e.g., font, texture) without relying on XML templates, and updates this addon + docs/tests accordingly. It also removes the XML-based picker templates to avoid template name conflicts when embedded multiple times.
Changes:
- Added
LSB:RegisterRowType(name, descriptor)and migrated “custom/XML template” usage to “registered row types”. - Refactored LibLSMSettingsWidgets from XML-template widgets to pure-Lua row implementations that can register with LSB.
- Updated addon option specs, tests, and documentation to use
type = "font"/type = "texture"and the new extensibility model.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| UI/OptionUtil.lua | Stops depending on LibLSMSettingsWidgets templates for fontOverride row construction. |
| UI/GeneralOptions.lua | Switches texture/font options to declarative registered row types (texture, font). |
| Tests/TestHelpers.lua | Updates test stubs to register row types via the new LSB API. |
| Libs/LibSettingsBuilder/Tests/Controls_spec.lua | Updates tests to validate registered row types and initializer data. |
| Libs/LibSettingsBuilder/Tests/Architecture_spec.lua | Adds RegisterRowType to the allowed public exports list. |
| Libs/LibSettingsBuilder/Schema/Rows.lua | Removes custom row type and relies on dynamic registration for extensions. |
| Libs/LibSettingsBuilder/Registry/Runtime.lua | Adds runtime support for registered row types and updates fontOverride expansion. |
| Libs/LibSettingsBuilder/Interop/ListRows.lua | Extends custom row initializer creation to support a resetFrame hook. |
| Libs/LibSettingsBuilder/docs/TROUBLESHOOTING.md | Updates guidance away from type="custom" toward registered row types. |
| Libs/LibSettingsBuilder/docs/QUICK_START.md | Updates guidance away from type="custom" toward registered row types. |
| Libs/LibSettingsBuilder/docs/MIGRATION_GUIDE.md | Updates migration recommendations to registered row types instead of custom. |
| Libs/LibSettingsBuilder/docs/INSTALLATION.md | Reframes docs to emphasize registered row types (and removes XML-template guidance). |
| Libs/LibSettingsBuilder/docs/API_REFERENCE.md | Documents LSB:RegisterRowType(...) and removes the custom row docs. |
| Libs/LibSettingsBuilder/Core.lua | Implements RegisterRowType and stores registered descriptors. |
| Libs/LibSettingsBuilder/Builders/Rows.lua | Adds a builders.registered builder to render registered row types. |
| Libs/LibLSMSettingsWidgets/Tests/LibLSMSettingsWidgets_spec.lua | Reworks tests to validate the new Lua-based picker behavior and LSB registration. |
| Libs/LibLSMSettingsWidgets/README.md | Updates README for the new integration model (Register + declarative row types). |
| Libs/LibLSMSettingsWidgets/LibLSMSettingsWidgets.xml | Removed XML templates (prevents embedded template name conflicts). |
| Libs/LibLSMSettingsWidgets/LibLSMSettingsWidgets.lua | Implements pure-Lua font/texture picker rows and registers them with LSB. |
| EnhancedCooldownManager.toc | Loads LibLSMSettingsWidgets via Lua instead of XML. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8564cfeac1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…false or 0) into the empty-string fallback. Use an explicit nil check (e.g. descriptor.defaultValue ~= nil and descriptor.defaultValue or "") so registered row types can safely use boolean/number defaults. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…frame, but reactive reevaluation calls SetEnabled on initializers regardless of whether they still own that frame. After Blizzard recycles list frames, this can toggle enabled/disabled state (and hide/show preview) on the wrong visible row, because the old initializer still points at a frame now used by another initializer.