# Changelog — Leaderboards Pro

All notable changes to this module are documented here.
Format loosely follows [Keep a Changelog](https://keepachangelog.com/).

## [1.1.2] — 2026-06-10

### Changed
- **Top Voters: native VotePro integration (single source of truth).** Removed
  all table-probing heuristics (`votepro_votes` / `votingplugin_users` candidates,
  `columnsExist`, prefix logic, `SHOW TABLES` probe, temporary diagnostics). The
  board now calls VotePro's own `Leaderboard::getAllTime()` — the exact method
  VotePro uses for its own leaderboard (reads `nl2_votepro_leaderboard`). If
  VotePro changes its internal storage, only VotePro needs maintenance.
- Detection uses `Util::isModuleEnabled('VotePro')` + on-demand load of VotePro's
  Leaderboard class (it ships no autoloader). Diagnostic shows
  "VotePro · Leaderboard::getAllTime() · active".

### Fixed
- The previous false "Unavailable" was caused by probing the raw-log table
  `votepro_votes` instead of VotePro's leaderboard source `nl2_votepro_leaderboard`.

## [1.1.1] — 2026-06-10

### Fixed
- **Custom table-prefix support (vote source detection):** `columnsExist()` and
  the Top Voters query no longer hard-code `nl2_`; they resolve the configured
  prefix via `Config::get('mysql.prefix')` (`tablePrefix()`). Fixes a false
  "Unavailable (data source not installed)" on installs whose prefix is not
  `nl2_`, where the table was found by `showTables()` (real prefix) but the
  column check (`SHOW COLUMNS FROM nl2_…`) failed.
- Added a temporary source-probe log line in `VotesLeaderboard::resolveCandidate()`
  (prefix used · candidate tables found/missing · selected) to confirm detection
  on a live server.

## [1.1.0] — 2026-06-10

### Fixed (post-RC1)
- **Native VotePro support:** Top Voters now detects VotePro from its data table
  (`nl2_votepro_votes`) instead of relying solely on module enumeration. Fixes a
  false "Unavailable (data source not installed)" when VotePro was installed. The
  board reads all-time votes per linked player
  (`SELECT user_id, COUNT(*) … WHERE user_id > 0 GROUP BY user_id`), and the
  StaffCP diagnostic reports "VotePro detected · nl2_votepro_votes · active".
- **"Unconfirmed Member" badge removed from public leaderboards:** accounts with
  no group membership (e.g. SQL-imported users) are auto-assigned NamelessMC's
  default group; that fallback badge is now excluded. The real username is always
  shown; entries with no display name are excluded cleanly.

### Added
- **Appearance settings (StaffCP):** 9 configurable colours (primary, secondary,
  value/metric, text, muted text, card background, gold, silver, bronze) plus an
  "auto-darken in dark mode" toggle. No CSS editing required.
- **MinecraftThemesLab first-class integration:** the leaderboards and widgets
  automatically inherit the active MTL preset (Default / Ender / Cyber / Forest /
  Inferno / Aqua…) and recolour live when the preset changes. StaffCP colour
  overrides always take precedence. Pure CSS-variable cascade — no theme
  detection, graceful fallback on other themes.
- **Per-board display styles:** Podium / Compact List / Auto (podium at ≥3
  entries, otherwise compact list). Stored per leaderboard.
- **Homepage widgets (×5):** Top Reputation, Top Posts, Top Reactions, Top
  Voters, Newest Members. Enable/position from StaffCP → Widgets. Themed,
  cached, hide themselves when empty.
- **Vote integration diagnostics (StaffCP):** shows the detected vote module, the
  data source found (if any) and a clear status message.
- **Vote backend support:** VotePro (`votepro_votes`) detected and read as
  all-time votes per linked player.
- **Future-proofing seams** for the v2.0 source platform: `display_style`
  column, `getValueFormat()`, `identifier_type` provider contract, and
  provider registration ready for DB-defined custom leaderboards.

### Changed
- New Members now stores a raw timestamp and is formatted centrally via the value
  format (no behavioural change to the displayed date).
- Stylesheet hardened: explicit `box-sizing` and a `flex`-based mobile podium so
  boards never overflow on small screens.
- Widget templates are auto-provisioned into the active theme (incl. MTL / custom
  themes), so widgets render natively instead of showing a widget-error box.

### Database
- `nl2_leaderboards_settings` gains a `display_style` column (added automatically
  on upgrade via a lazy, version-gated schema reconcile — no manual migration).
- `nl2_settings` (module `LeaderboardsPro`): adds `schema_version`,
  `appearance_enabled`, `appearance_auto_darken`, and `appearance_*` colour keys.

### Upgrade notes
- Drop-in over v1.0 — do **not** re-install. The schema reconcile runs on the
  first page load and stamps `schema_version = 110`. Existing configuration is
  preserved; appearance defaults keep the look identical until configured.

## [1.0.0] — 2026-06-07

### Added
- Initial release. Public leaderboards page with a 3-place podium + ranked list.
- Five native leaderboards: Top Reputation (net reaction score), Top Forum Posts,
  Top Reactions, Newest Members, Top Voters (when a compatible vote module is
  present).
- StaffCP panel: enable/disable, display order, result limit per board; clear
  cache; configurable public route.
- Permissions (`admincp.leaderboards`), navbar + StaffCP integration, caching,
  banned/private/ghost user filtering, DefaultRevamp template.
