﻿# Changelog

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

<!-- markdownlint-disable MD024 -->

## [Unreleased]

- Planned: finer data selection and more regions/brackets configurable via repository variables
- Monitor scheduled alpha auto-updates and polish fetcher logging
- Fetcher (API): aggregate bySpec for Shuffle/Blitz and write into Data.lua (parity with scraper)
- Cleanup: remove legacy duplicate `PvPScout/Data.lua`; rely on root `Data.lua` only
- Workflows: scheduled data updates publish CurseForge alpha builds every 3h; optional GitHub prerelease can be enabled (CREATE_GH_PRERELEASE)

## [v0.1.42] – 2025-09-23

### Legendeneintrag

- Legende angepasst: statt „Deaktiviert: Grau“ wird nun der Platzhalter „—: Keine Daten vorhanden“ erklärt. Weiter unten bleibt der Hinweis bestehen, dass nur aktive Spieler der offiziellen Bestenlisten angezeigt werden.

## [v0.1.40] – 2025-09-23

### Minimap

- Fix: Border perfectly centered. Adopted Blizzard tracking button geometry exactly (54px tracking border around a 32px button with a 20px circular icon/mask) to correct the off‑center look.

### Options UI

- Professional two‑column layout with left‑aligned labels and constrained widths to prevent overflow
- Reset to defaults sets all brackets visible, Trend off by default; disabled brackets don’t render

### Tooltip

- When no brackets are selected, show header only
- Shuffle/Blitz: always use current spec with a “—” placeholder when the active spec has no rating

### CI/Workflows

- Scheduled alpha uploads fixed by removing an invalid packager flag; lint remains green

## [v0.1.41] – 2025-09-23

### Options UI

- Einspaltiges, aufgeräumtes Layout: Legende, Vorschau und Infotexte sind in einen eigenen Abschnitt am Seitenende gewandert
- Checkbox-Labels verbreitert; Buttons werden automatisch an ihre Textbreite angepasst (keine Überhänge)
- Bracket-Reihenfolge: professionelle ScrollUp/Down-Pfeile statt „^/v“-Textbuttons

### Minimap

- Ring exakt zentriert; Icon kreisförmig gemaskt (22 px) und sauber ausgerichtet
- Echter, runder Hover-Glow via SetHighlightTexture (Blizzard-Standard)

### Lint

- Luacheck: W212 (unused argument) im Minimap-Skript bereinigt

### Workflows & Daten

- Scheduled-Workflow stabilisiert: Runner-Pin auf ubuntu-22.04 und Packager mit Retry (3 Versuche)
- API-Fetcher respektiert jetzt MAX_ENTRIES_PER_BRACKET (0 = unlimitiert); Variablen werden an Fetcher und Scraper durchgereicht

## [v0.1.39] – 2025-09-23

### Bugfixes

- Tooltip: Fix nil dereference when current spec has no `bySpec` entry (always render a line with “—” instead of error/hide)
- Tooltip: Locale-agnostic specialization mapping using spec IDs → canonical slugs (e.g., 102 → `balance`) so Shuffle/Blitz matches data reliably

### Behavior

- Shuffle/Blitz now always use the player’s current spec when `bySpec` exists; if there’s no rating for that spec, a placeholder “—” is shown. The previous toggle was removed to avoid confusion.

### Options UI

- Removed the “Use current spec only for Shuffle/Blitz” checkbox; behavior is always-on
- Tightened layout: fixed text widths and wrapping so labels don’t overflow; scroll area sizing refined

### Minimap

- Made the button match Blizzard’s standard more closely (static tracking border, no dynamic recolor)

## [v0.1.38] – 2025-09-23

### Data pipeline

- Fetcher (API) now aggregates per-spec ratings for Shuffle/Blitz and writes `bySpec` to `Data.lua` (no `spec` tag)
- Matches the scraper behavior so tooltips can reliably show “current spec only” across both modes

### Maintenance

- No addon UI changes; relies on prior release behavior (v0.1.37)

## [v0.1.37] – 2025-09-23

### Data format & pipeline

- Remove spec tag from `Data.lua` entirely; keep `bySpec` only for Shuffle/Blitz to pick the current spec’s rating
- Scraper/Fetcher updated to stop serializing `spec = "…"` in output
- Scheduled workflow: always commits `Data.lua` after generation so “Updated X ago” stays fresh

### Tooltip & behavior

- Shuffle/Blitz now strictly show only the rating of the player’s current specialization when `bySpec` exists (no spec tag text)
- If no entry exists for the current spec, the bracket is hidden for that player

### Options UI

- Settings page made scrollable to prevent overflow on smaller screens
- New option (default on): “Use current spec only for Shuffle/Blitz (hide ratings from other specs)”

### Lint

- Fix luacheck W611 (whitespace-only line) in `PvPScoutOptions.lua`

## [v0.1.36] – 2025-09-23

### AddOn UI/UX

- Setup Page: added icon+subtitle, clear section headers (General, Display, Data & Behavior)
- New Preview box: shows sample tooltip rows reflecting current settings (rank/trend and live color bands)
- Legend: visual color swatches for Top 0.01%, >=2400, >=2100, >=1800, <1800, and disabled gray
- Reset controls: “Reset to defaults” and “Clear trend history” buttons
- Localization: all new texts available in EN/DE; remaining prints/messages localized

### Minimap

- Visuals: switched to Blizzard’s MiniMap-TrackingBorder and common mouse highlight for a native look
- Kept freshness ring behavior by tinting the border; still green→yellow→red based on data age

### Compatibility

- Removed the “ElvUI/TipTac” compat toggle; tooltip hooking is automatic, idempotent, and works under Blizzard/ElvUI/TipTac

### Misc

- Startup log localized; bracket names in menus/prints are localized consistently

## [v0.1.35] – 2025-09-23

### Repo cleanup & structure

- Removed legacy duplicate addon folder `PvPScout/` (root layout is the single source of truth)
- Ignore backup data files (`Data.*.bak.lua`) and `tools/out/` in `.gitignore`

### Scraper & workflow

- Class/spec pagination: prefer path-style URLs exclusively to avoid redundant variants; fallback to query only when needed
- Scraper always writes `Data.lua` so `updatedAt` is refreshed each run
- Scheduled workflow now commits `Data.lua` back when changed (keeps Setup/Tooltip timestamps fresh)

## [v0.1.34] – 2025-09-22

### Scraper

- Increased default page limit for Shuffle/Blitz from 3 to 10 pages per class for more comprehensive data coverage
- Ensure class-filtered pages iterate up to the configured cap even when pagination links aren't visible on the site

### AddOn

- Settings: Added legend explaining that '—' symbol means no data available (rating likely too low for official leaderboards)
- Localization: Added legend text for English and German

## [v0.1.32] – 2025-09-22

### Scraper

- Pagination: scrape across multiple leaderboard pages per bracket (auto-discovered); configurable via `MAX_PAGES_PER_BRACKET`
- Caps: configurable `MAX_ENTRIES_PER_BRACKET` (default no cap) to keep `Data.lua` compact when desired
- Region filtering tightened using character links/payload to avoid mixed-region entries
- Shuffle/Blitz per spec: iterate all 39 class specializations (EU+US) and paginate each; dedupe players by best rank
- Performance: early-stop on empty pages, bracket-specific page caps (team vs class-filtered), keep-alive agent, moderate concurrency and polite delay
- Safety: skip-write-if-unchanged to avoid unnecessary file churn in CI

### Workflows

- Default `LOCALE` auto-selects `en_GB` if `eu` is among regions, else `en_US` (already active)
- Pass pagination/cap envs to scraper in scheduled and tag workflows
- Prepare env toggles for Shuffle/Blitz (e.g., `CLASS_FILTER_MODE=class-spec`, `MAX_CLASS_FILTERS_PER_BRACKET=39`, `MAX_PAGES_CLASS_BRACKETS`)

### Docs

- README updated with pagination and size controls, and clarification that releases generate `Data.lua` at tag time

## [v0.1.31] – 2025-09-22

### Documentation

- README: clarified addon size impact and that `Data.lua` is bounded (cap ~5k entries per bracket) and generated during tag releases as well as on schedule
- Minor wording tweaks around the temporary scraper fallback and schedule

## [v0.1.30] – 2025-09-22

### Scraper & local dev

- Scraper: optional TLS options for corporate proxies/SSL interception
  - `CA_CERT_PATH`/`NODE_EXTRA_CA_CERTS` to trust a PEM bundle
  - `INSECURE_TLS=1` for local testing only (disables verification)
- Fix: Cheerio ESM import (`{ load as cheerioLoad }`)
- README: added guidance for local scraping behind TLS-inspecting proxies

## [v0.1.29] – 2025-09-22

### Data pipeline: temporary HTML scraper fallback

- New tools/scrape.js: polite HTML scraper for public bracket leaderboards as a temporary fallback when Blizzard API credentials are unavailable
- Workflow “Update PvP data (scheduled alpha)” now auto-selects mode:
  - API mode (default) when BLIZZARD_CLIENT_ID/SECRET are present
  - Scraper mode fallback when they are not; identifies with a UA, rate-limits (~1 req/s), and retries on transient errors
- Maintainer override: Actions variable DATA_MODE can force `fetch` or `scrape`

### Documentation

- README: clarified data sources (full bracket lists, not per-class filters), 3‑hour schedule, temporary scraper fallback, and maintainer inputs

## [v0.1.28] – 2025-09-21

### Compatibility & features

- Optional “Compatible tooltip hook (ElvUI/TipTac)” setting: uses an alternate GameTooltip hook path to play nicely with popular tooltip addons (off by default)

### Workflow: scheduled updater

- Hardened “Update PvP data (scheduled alpha)” workflow: clearer logs, default inputs when variables are unset, retry on fetch failure, timeout, manual dispatch, and explicit skip messaging when required secrets are missing

### Documentation

- README: added a Compatibility section for the new hook and clarified scheduled updater behavior

## [v0.1.27] – 2025-09-21

### Fixes

- Minimap: resolve leftover merge markers that caused luacheck E011 near line 159
- Minimap: silence W212 by marking the dropdown initializer's first arg as intentionally unused
- Packaging: new patch tag to include the lint fix in a released build

## [v0.1.26] – 2025-09-21

### Fixes & adjustments

- Minimap: fixed error when right-clicking if `EasyMenu` isn’t available by falling back to `UIDropDownMenu_*` APIs
- Tooltip: when no ladder data exists for a bracket, still show placeholders for Rank and Trend if those options are enabled
- Tooltip: removed bracket icons per feedback for a cleaner, more compact look

## [v0.1.25] – 2025-09-21

### UI/UX polish

- Minimap: normalized button further to 28px and kept the slim circular rim for better consistency with default buttons
- Minimap ring: color-coded by data age (fresh → green, warning → yellow, stale → red; black when unknown)
- Tooltip: added small bracket icons before each line for quick recognition
- Tooltip header: shortened localized title to “Rating” (enUS) / “Wertung” (deDE)

### Sharing & parity

- New: quick “Share ratings to chat” via the minimap context menu inserts a compact, editable line into the chat input
- Rank placeholder parity: when “Show rank” is on but rank is unknown, both tooltip and chat output show “(Rank —)”
- Trend placeholder parity: when Trend is enabled but no history exists yet, a compact “—” is shown

### Lint & maintenance

- Fixed luacheck warnings in the minimap file (avoid shadowing a local and guard `ChatEdit_*` via `_G`)
- Minor string and localization adjustments

## [v0.1.24] – 2025-09-21

### UI/UX tweaks

- Minimap: normalized the button to 31px and slimmed the border ring for a consistent look with other minimap buttons

### Tooltip & slash parity

- Rank placeholder parity: when “Show rank” is enabled but no rank is known, chat output now shows “(Rank —)” like the tooltip

### Optional 7‑day trend (local)

- New option: “Trend” (off by default). Shows a compact 7‑day delta per selected bracket in the tooltip, e.g. “[Trend +12]”
- Local snapshots: on login, the addon stores your character’s current ratings to SavedVariables to compute deltas later
- Placeholder: when not enough data is available yet, a compact “—” is shown instead of a number

## [v0.1.23] – 2025-09-21

### Cleanup & Packaging

- Removed the gallery automation and generated artifacts from the repository
  - Deleted `tools/prepare-curseforge-content.js` and `dist/curseforge/*`
  - Removed `screenshots/gallery.json` and related scaffolding
- Simplified the tag-release workflow to rely solely on the packager (release notes still come from `CHANGELOG.md`)
- Added `CURSEFORGE_GALLERY.md` as a simple manual copy sheet for the CurseForge Gallery

### UI/UX

- Minimap: centered black circular border (cleaner, consistent with other minimap buttons)
- Tooltip: when “Show rank” is enabled but the rank isn’t known yet, display a compact placeholder: “(Rank —)”
- Tooltip: for brackets without data yet, use a short placeholder “—” on the right side to keep the tooltip narrow

### Additional notes

- No changes to the data fetcher or SavedVariables; CI lint remains in place
- Manual updates to the CurseForge Overview/Gallery are still recommended (see `CURSEFORGE_DESCRIPTION.md` and `CURSEFORGE_GALLERY.md`)

## [v0.1.22] – 2025-09-21

### Gallery & Description

- Added a screenshots gallery pipeline:
  - `screenshots/` folder with `gallery.json` (order, titles, captions)
  - `tools/prepare-curseforge-content.js` generates `dist/curseforge/description.md`, `gallery.json`, and copies images
  - Tag workflow uploads a `curseforge-content` artifact for easy copy/paste into the CurseForge project
- New, polished `CURSEFORGE_DESCRIPTION.md` for a clean project page

### Lint/Time Safety

- Guard time/date via `_G` in tooltip and options to satisfy luacheck and ensure correct timestamps
- Options now show the absolute timestamp for the actual fetch time (not current time)

### Packaging

- `.pkgmeta`: ignore `screenshots/` and `dist/` so images and artifacts don’t ship in the addon ZIP

## [v0.1.21] – 2025-09-21

### Fixes & Lint

- Lint: guard date() usage in options via _G to satisfy luacheck W113

### Options

- Show "Last updated: X ago (YYYY-MM-DD HH:MM)" in the settings page based on the fetched data timestamp
- Add a short explanation of what the stale-data threshold does

### Minimap tweaks

- Border aligned and scaled to match the default tracking button style more closely
- Hover tooltip now has a title (PvPScout) and shows "Brackets shown in Settings: …" with the currently selected brackets

## [v0.1.20] – 2025-09-21

### Tooltip polish

- Header now titled "Bracket Rating" (localized) and shows the detected region dynamically (EU/US/etc.)
- Season is displayed only when known (> 0); avoids showing "S0" early on
- Rank label localized and only shown when available (> 0)

### Minimap

- Added subtle hover glow and a proper circular border so the icon blends in with other minimap buttons
- On hover, a small tooltip now appears:
  - Left-click: opens settings
  - Lists which brackets are currently shown (localized)

### Maintenance

- Minor string tweaks and i18n additions

## [v0.1.19] – 2025-09-21

### Fixes & UX

- Minimap: ensure visibility and apply a reliable circular mask; keep position updated on show
- Tooltip: show placeholder rows per bracket when no data is available yet
- Options: added "Reload UI" button; bracket order updates now immediately affect tooltips
- Lint: silence remaining warnings by guarding globals and adjusting calls

## [v0.1.18] – 2025-09-21

### UX improvements

- Minimap: icon uses a circular mask (looks like other minimap buttons)
- Options navigation: registered under AddOns via the modern Settings API; improved fallbacks
- New slash command: /pvpscoutaddons opens the AddOns pane directly

## [v0.1.17] – 2025-09-21

### Quality of Life

- Startup message on login (English): shows version, where to find settings (/pvpscout), minimap visibility, and selected brackets

### Fixes & compatibility

- Tooltip hook: use TooltipDataProcessor with fallback to avoid errors on modern clients
- Options: slider label updates no longer rely on global names (fixes nil concatenation)
- Icons: prefer .blp/.tga for minimap icon; TOC IconTexture points to .blp

## [v0.1.16] – 2025-09-21

### UX

- Minimap: right-click menu now has
  - Show/Hide minimap icon
  - Reset minimap position (back to 45°)
- Options: added a "Reset minimap position" button next to the visibility toggle

### Fixes & Maintenance

- TOC: Interface bumped to 110200 (Retail 11.0.2)
- Lint: removed usage of math.atan2 (not available in WoW) with a safe angle helper
- Docs/Fetcher: added an offline fallback for local testing (JSON/CSV via OFFLINE_SOURCE)

## [v0.1.15] – 2025-09-21

### Enhancements

- Localization: enUS and deDE for UI labels, tooltip text, and minimap menu
- Options panel: added toggles for “Show header”, “Show updated X ago”, and “Color by rating”
- New slider: configurable stale-data threshold (1–72h, default 24h)
- Tooltip/minimap strings localized; consistent bracket labels

### Internal changes

- Added luacheck/stylua configs and a CI lint workflow
- Removed a duplicate, unused tooltip file from the old subfolder

## [v0.1.14] – 2025-09-21

### Features

- Options panel: enable/disable addon, show rank toggle, show minimap icon, and per-bracket visibility
- Bracket ordering: reorder which brackets appear first in the tooltip via Up/Down controls
- Minimap button: draggable icon with a right-click context menu for quick toggles (enable, show rank/header/updated age, per-bracket)
- Tooltip polish:
  - Header with region and season, optional “updated X ago” timestamp
  - Optional stale-data notice when older than a configurable threshold
  - Color-by-rating option, aligned values (AddDoubleLine), and a clear “No data” fallback
- Slash command: `/pvpscout` opens options; `/pvpscout enable` and `/pvpscout disable` still supported

### Data & automation

- Scheduled alpha updates continue to run every 3 hours (if secrets are configured)
- No changes to tag-based releases: create a tag like `v0.2.0` to publish a proper release

### Internal maintenance

- SavedVariables migration: backfills new fields with safe defaults (e.g., `bracketOrder`, UI toggles)
- Docs & lint: changelog formatting and markdownlint config adjusted

## [v0.1.13] – 2025-09-21

### Fixes & Packaging

- Flatten addon layout to repository root (TOC + Lua files at root)
- Stabilize packager (BigWigsMods/packager v2.4.3); fix 400 changelog error
- Simplify .pkgmeta (manual changelog; drop move-folders)

## [v0.1.12] – 2025-09-21

### Fixes

- Correct TOC detection for the packager; resolve conflicts caused by `move-folders`
- Add debug steps to workflows

## [v0.1.11] – 2025-09-21

### Workflow fixes

- Remove duplicate `run` keys in YAML; harden upload workflow when secrets are missing

## [v0.1.10] – 2025-09-21

### New

- Set up tag-triggered release workflow (CurseForge upload); first successful release

## Data pipeline

- New scheduled workflow “Update PvP data (scheduled alpha)”: fetches data via Blizzard Game Data API and uploads alpha builds to CurseForge – without tagging
- Fetcher (`tools/fetch.js`) improvements:
  - Auto-discover leaderboard slugs via the season index (with fallback probing)
  - Configurable locale (default: `en_US`)
  - Writes `Data.lua` either to the WoW Addon directory (when `WOW_ADDON_DIR` is set) or to the repository root

## Notes

- Required Actions secrets for automatic data updates: `BLIZZARD_CLIENT_ID`, `BLIZZARD_CLIENT_SECRET`, `CF_API_KEY`
- Optional Actions variables: `REGIONS` (e.g. `eu,us`), `BRACKETS` (e.g. `2v2,3v3,shuffle,rbg,blitz`), `LOCALE` (e.g. `de_DE`)

[Unreleased]: https://github.com/dominikreckziegel/PvPScout/compare/v0.1.38...HEAD
[v0.1.38]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.38
[v0.1.37]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.37
[v0.1.36]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.36
[v0.1.32]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.32
[v0.1.31]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.31
[v0.1.30]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.30
[v0.1.29]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.29
[v0.1.28]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.28
[v0.1.27]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.27
[v0.1.26]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.26
[v0.1.25]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.25
[v0.1.24]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.24
[v0.1.23]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.23
[v0.1.22]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.22
[v0.1.21]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.21
[v0.1.20]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.20
[v0.1.19]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.19
[v0.1.18]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.18
[v0.1.17]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.17
[v0.1.16]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.16
[v0.1.15]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.15
[v0.1.14]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.14
[v0.1.13]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.13
[v0.1.12]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.12
[v0.1.11]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.11
[v0.1.10]: https://github.com/dominikreckziegel/PvPScout/releases/tag/v0.1.10
