﻿# 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

## [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.32...HEAD
[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
