Skip to content

Add support for short spec names and related UI toggle#3

Open
armin-l wants to merge 2 commits into
MassCraxx:devfrom
armin-l:dev
Open

Add support for short spec names and related UI toggle#3
armin-l wants to merge 2 commits into
MassCraxx:devfrom
armin-l:dev

Conversation

@armin-l

@armin-l armin-l commented Apr 23, 2026

Copy link
Copy Markdown

I vibe coded a toggle for the short spec name that was already in the repo as ToDo.
Works on my machine :)

Copilot AI review requested due to automatic review settings April 23, 2026 21:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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")

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
short_spec_check = CreateFrame("CheckButton", "RaidBrowserRaidSetShortSpecCheckButton", LFRBrowseFrame, "UICheckButtonTemplate")
local short_spec_check = CreateFrame("CheckButton", "RaidBrowserRaidSetShortSpecCheckButton", LFRBrowseFrame, "UICheckButtonTemplate")

Copilot uses AI. Check for mistakes.
Comment thread RaidBrowser/core.lua
Comment on lines 1263 to +1264
RaidBrowser.check_button()
RaidBrowser.gui.raidset.initialize();

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

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.

Suggested change
RaidBrowser.check_button()
RaidBrowser.gui.raidset.initialize();
RaidBrowser.gui.raidset.initialize();
RaidBrowser.check_button()

Copilot uses AI. Check for mistakes.
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