# Changelog

All notable changes to this project will be documented in this file.

## [1.1.5] - 2026-04-06

- **Fix:** Button no longer stays visible after teleporting during combat.
- **Fix:** Button no longer reappears as a ghost icon when combat ends after a successful teleport.
- **Fix:** Teleport spell detection now works even if internal state was cleared by another event.

## [1.1.4] - 2026-03-28

- **Fix:** Fixed button not re-appearing when group re-lists in LFG after completing a dungeon. A race condition was causing the addon to think it was already showing the correct dungeon when it wasn't.
- **Fix:** Button state is now fully cleaned up when M+ starts/completes, regardless of previous state.
- **New:** `CheckActiveGroup` now clears stale dungeon state when a listing is removed.
- **New:** After dungeon completion, the addon schedules automatic re-checks at 3s, 8s, and 15s to catch re-listings faster.
- **New:** Errors from tainted LFG data are now logged to chat instead of silently swallowed.

## [1.1.3] - 2026-03-28

- **Fix:** Added alternate spell support for Skyreach teleport. The addon now tries "Path of the Skies" (159898) if the primary Skyreach teleport spell (1254557) isn't known, fixing "spell not learned" errors for some players.
- **Improvement:** Alt spell resolution also applies to M+ UI overlay buttons and spell cast detection.
- **Improvement:** `/tpbutton debug` and `/tpbutton test` now show resolved spell info and alt spell status.

## [1.1.2] - 2026-03-27

- **New:** Added "Show only when cooldown is ready" option in settings. When enabled, the teleport button only appears when the spell is known and off cooldown — nothing is shown if the spell is on cooldown or not yet learned.
- **New:** Button automatically appears when the cooldown finishes and hides again when the spell goes on cooldown (while the option is enabled).

## [1.1.1] - 2026-03-26

- **Fix:** Fixed activity ID matching not working, which caused the button to not appear when your party listed in LFG.
- **Fix:** Button dismiss state now resets when you leave a party, so it reappears correctly for the next group.
- **Fix:** Button now instantly detects when you join an already-listed group instead of waiting up to 5 seconds.
- **New:** Overlay text now shows "Your party has joined to" when the button appears from a party listing, or "You have been invited to" when from an LFG invite.

## [1.1.0] - 2026-03-26

- **Fix:** Fixed a bug where the button and invite text would never go away, even after the key started. Only a /reload would fix it.
- **Fix:** Fixed invite acceptance not being detected properly in some cases.
- **Fix:** Button now correctly hides when your application is declined, the group is full, or the listing is removed.
- **New:** Button now automatically hides when a M+ key is activated or a run completes.
- **Fix:** Fixed M+ dungeon icon tooltips sometimes getting stuck on screen.
- **New:** Button now instantly appears when your party lists in LFG for a supported dungeon.

## [1.0.9] - 2026-03-19

- **Compat:** Updated Interface version to `120005` for WoW 12.0.5.
- **Refactor:** Replaced deprecated `C_Spell.IsSpellKnownOrOverridesKnown` with `C_SpellBook.IsSpellKnownOrInSpellBook` (removed in 12.0).
- **Refactor:** Removed deprecated fallbacks `IsPlayerSpell`, `IsSpellKnown`, and `C_Spell.IsSpellKnown` from spell knowledge checking.
- **Refactor:** Replaced `C_Spell.GetSpellInfo()` with specific getters `C_Spell.GetSpellName()` and `C_Spell.GetSpellTexture()`.
- **Fix:** Fixed "attempt to index a secret string value" errors caused by tainted LFG API returns during raids.
- **Fix:** Wrapped `norm()`, `matchDungeonFromActivity()`, `matchDungeonFromActivityIDs()`, and `CheckActiveGroup()` in `pcall` to gracefully handle tainted/secret values from `C_LFGList` APIs.
- **Docs:** Updated README with full feature list, all slash commands, and compatibility info.

## [1.0.8] - 2026-02-21

- **Fix:** Fixed Lua error in options panel when AceGUI is loaded but AceGUI-3.0-SharedMediaWidgets is missing.

## [1.0.7] - 2026-01-13

- **New Feature:** Added "Host/Active Group Check". The button will now automatically appear if your group is listed in LFG for a supported dungeon (checks every 5 seconds), ensuring the host sees the button even without an invite notification.
- **Refactor:** Overhauled internal event handling system using a dispatch table pattern for better reliability and code maintenance.
- **Fix:** Fixed a bug where dungeon detection via Activity ID was failing due to a missing internal lookup table.
- **Improvement:** Optimized dungeon matching logic to remove redundant code.

## [1.0.6] - 2025-12-13

- Updated Interface version to `120001` for Midnight Beta 12.0.1 (build 64889).

## [1.0.5] - 2025-12-06

- Button auto-hides during combat and reappears after.
- Fixed "secret value" errors when checking spell cooldowns in combat.

## [1.0.4] - 2025-12-06

- Added M+ UI overlay buttons on dungeon icons in Challenges frame.
- Click dungeon icons to teleport directly from M+ UI.

## [1.0.3] - 2025-12-05

- Fixed bug where second invite overwrote first pending invite.
- Now supports multiple pending invites at once.
- Spell icon IDs now fetched from API.
- Cached Lua functions for performance.
- Removed unused code.
- Code cleanup.

## [1.0.2] - 2025-12-04

- Added a fallback check when `C_Spell.IsSpellKnownOrOverridesKnown` is missing on beta clients.

## [1.0.1] - 2025-11-28

- Refactored code to remove legacy API calls and simplified comments for better maintainability.

## [1.0.0] - 2025-11-24

### Added

- **Midnight Season 1 Support**: Added support for all 8 Season 1 dungeons:
  - Magisters' Terrace
  - Maisara Caverns
  - Nexus-Point Xenas
  - Windrunner Spire
  - Al'gethar Academy
  - Pit of Saron
  - Seat of the Triumvirate
  - Skyreach
- **New Spell IDs**: Updated with Challenge Mode Teleport spell IDs for 12.0.
- **New Icons**: Updated with specific dungeon icons.
- **Activity IDs**: Added Mythic Keystone Activity IDs for auto-detection.

### Changed

- **Target Version**: Updated Interface to `120000` (Midnight).
- **Addon Name**: Renamed to `LFGTeleportButtonMidnight`.
- **API**: Built on the modernized API foundation from `LFGTeleportButton` v1.2.0.
