Skip to content

Add extensibility API for LSB that allows LSMSettingsWidgets to register custom types for declarative controls.#102

Merged
argium merged 7 commits into
mainfrom
feature/lsb_custom_controls
May 23, 2026
Merged

Add extensibility API for LSB that allows LSMSettingsWidgets to register custom types for declarative controls.#102
argium merged 7 commits into
mainfrom
feature/lsb_custom_controls

Conversation

@argium
Copy link
Copy Markdown
Owner

@argium 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.
Copilot AI review requested due to automatic review settings May 21, 2026 05:00
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

Test Results

890 tests  ±0   890 ✅ ±0   1s ⏱️ -1s
  5 suites ±0     0 💤 ±0 
  5 files   ±0     0 ❌ ±0 

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.
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:129 ‑ LibLSMSettingsWidgets SetupDropdown is a no-op until Init provides a setting
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:144 ‑ LibLSMSettingsWidgets updates font and texture previews from LibSharedMedia fetch results
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:198 ‑ LibLSMSettingsWidgets FontPicker SetEnabled disables dropdown and hides preview
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:198 ‑ LibLSMSettingsWidgets TexturePicker SetEnabled disables dropdown and hides preview
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:234 ‑ LibLSMSettingsWidgets FontPicker Init bridges initializer.SetEnabled to frame
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:234 ‑ LibLSMSettingsWidgets TexturePicker Init bridges initializer.SetEnabled to frame
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:53 ‑ LibLSMSettingsWidgets returns sorted font values and fallback statusbar values
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:66 ‑ LibLSMSettingsWidgets invalidates cached media names when LibSharedMedia registers new media
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:82 ‑ LibLSMSettingsWidgets font dropdown radio selections update the setting and preview
Libs/LibSettingsBuilder/Tests.Builder_spec_lua:190 ‑ LibSettingsBuilder Builder rejects deprecated desc fields at registration time
…
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:112 ‑ LibLSMSettingsWidgets invalidates cached media names when LibSharedMedia registers new media
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:128 ‑ LibLSMSettingsWidgets applies a font picker row and updates the setting from menu selection
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:158 ‑ LibLSMSettingsWidgets rebinds a recycled row from font to texture and reset hides picker children
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:185 ‑ LibLSMSettingsWidgets bridges initializer enabled state to the active picker frame
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:201 ‑ LibLSMSettingsWidgets registers declarative font and texture row types with LibSettingsBuilder
Libs/LibLSMSettingsWidgets/Tests.LibLSMSettingsWidgets_spec_lua:99 ‑ LibLSMSettingsWidgets returns sorted font values and fallback statusbar values
Libs/LibSettingsBuilder/Tests.Builder_spec_lua:190 ‑ LibSettingsBuilder Builder falls back to a dropdown for fontOverride without a registered font row
Libs/LibSettingsBuilder/Tests.Builder_spec_lua:233 ‑ LibSettingsBuilder Builder uses fontFallback as the default fontOverride dropdown value source
Libs/LibSettingsBuilder/Tests.Builder_spec_lua:268 ‑ LibSettingsBuilder Builder keeps registered font rows for fontOverride when available
Libs/LibSettingsBuilder/Tests.Builder_spec_lua:305 ‑ LibSettingsBuilder Builder rejects deprecated desc fields at registration time
…

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Libs/LibSettingsBuilder/Core.lua Outdated
Comment thread Libs/LibSettingsBuilder/Registry/Runtime.lua Outdated
Comment thread Libs/LibSettingsBuilder/Registry/Runtime.lua
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread Libs/LibLSMSettingsWidgets/LibLSMSettingsWidgets.lua Outdated
Comment thread Libs/LibSettingsBuilder/Registry/Runtime.lua Outdated
Comment thread Libs/LibSettingsBuilder/Registry/Runtime.lua
argium and others added 5 commits May 23, 2026 10:37
…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.
@argium argium merged commit 0b3fcd7 into main May 23, 2026
@argium argium deleted the feature/lsb_custom_controls branch May 23, 2026 07:00
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