Add support for short spec names and related UI toggle#3
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a per-character UI toggle to display “short” vs “full” spec names, and normalizes previously saved raidset spec strings so they match the selected display mode.
Changes:
- Add short/full spec name selection logic and a migration helper to normalize saved raidset spec strings.
- Add a “Use short spec names” checkbox to the raidset UI and initialize it from saved variables.
- Persist the toggle via a new per-character saved variable and initialize it on addon enable.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
RaidBrowser/stats.lua |
Introduces short/full spec name selection helpers and normalization for saved raidset spec strings. |
RaidBrowser/raidset_frame.lua |
Adds UI checkbox toggle and selection normalization for raidset dropdown initialization. |
RaidBrowser/core.lua |
Initializes the new saved variable and calls raidset UI initialize during OnEnable. |
RaidBrowser/RaidBrowser.toc |
Adds the new per-character saved variable to the TOC. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| button:Show(); | ||
|
|
||
| -- Create short spec names checkbox | ||
| short_spec_check = CreateFrame("CheckButton", "RaidBrowserRaidSetShortSpecCheckButton", LFRBrowseFrame, "UICheckButtonTemplate") |
There was a problem hiding this comment.
short_spec_check is assigned without local, which creates/overwrites a global and can lead to hard-to-debug collisions between addons or files. Declare it as a local upvalue (e.g., local short_spec_check near the top) and keep the checkbox frame reference scoped to this module.
| short_spec_check = CreateFrame("CheckButton", "RaidBrowserRaidSetShortSpecCheckButton", LFRBrowseFrame, "UICheckButtonTemplate") | |
| local short_spec_check = CreateFrame("CheckButton", "RaidBrowserRaidSetShortSpecCheckButton", LFRBrowseFrame, "UICheckButtonTemplate") |
| RaidBrowser.check_button() | ||
| RaidBrowser.gui.raidset.initialize(); |
There was a problem hiding this comment.
RaidBrowser.check_button() runs before RaidBrowser.gui.raidset.initialize(), but check_button() depends on current_selection (set by initialize() via set_selection). With the current order, the Save button state can be incorrect on login until the user changes the dropdown. Call RaidBrowser.gui.raidset.initialize() before RaidBrowser.check_button(), or have initialize() call RaidBrowser.check_button() after setting the selection.
| RaidBrowser.check_button() | |
| RaidBrowser.gui.raidset.initialize(); | |
| RaidBrowser.gui.raidset.initialize(); | |
| RaidBrowser.check_button() |
…returns a default index
I vibe coded a toggle for the short spec name that was already in the repo as ToDo.
Works on my machine :)