JustInTime — Changelog
=======================

v0.4.1 — Cap reference clear-time at keystone timer + visible ref source (2026-05-18)
-------------------------------------------------------------------------------------

Fixes:
- Reference clear-times no longer exceed the keystone timer. The data
  pipeline now filters out depleted runs at three layers: Blizzard
  leaderboard discovery (`duration_ms > timer_ms`), Raider.IO real-split
  enrichment (`num_chests <= 0`), and observed-ratio synthesis. Previously
  the "slowest 10 % timed" sample silently included depleted runs, pushing
  the published median 10-12 % past the timer (e.g. AA +15: 34:28 vs
  31:00 timer). Re-run `make data` to regenerate Data.lua with the fix.
- Key-end chat recap (KEY_END_TIMED / KEY_END_DEPLETED) now honors the
  active reference_mode instead of hard-coding "public ref". When the
  user runs in `perso_*` mode the recap labels the comparison correctly,
  and falls back to "public ref (fallback)" only when no personal run
  exists for that (dungeon, level, affix).

UX:
- The overlay reference row now shows which source is active:
  "Réf publique" / "Réf perso ⚡" / "Réf perso ↻" / "Réf perso ~", with a
  "(fallback)" suffix on the value when a perso mode silently falls back
  to public for lack of personal runs.

v0.4.0 — Data.lua schema v2: keystone +15-22 coverage (2026-05-09)
------------------------------------------------------------------

Features:
- Reference data now covers Mythic+ keystone levels +15 to +22
  (previously +18 to +20).
- Reference timers now sourced from the Battle.net mythic-keystone-leaderboard
  API for full level coverage. Boss splits at low levels are synthesized from
  observed ratios at higher levels where real per-encounter data is available.

Schema:
- Data.lua schema bumped to v2: drops the per-affix-combo nesting under each
  level (the addon didn't use it). Old Data.lua files (schema_version=1) are
  detected and rejected with an explicit error message; reinstall or regenerate
  to fix.

v0.3.4 — Drop in-game self-tests (2026-04-27)
---------------------------------------------

Cleanup:
- Removed the `/jit test` slash command and the `runSelfTests` PaceEngine
  smoke battery from Core.lua. They duplicated coverage that lives more
  comfortably in the Python pipeline (scripts/) and bloated the in-game
  command surface. Removed associated TEST_* locale keys (fr+en) and
  the TAGD debug tag local.
- Added a repo-root Makefile to drive the reference-timer rebuild
  (`make data`, `make data-dry`, `make data-fresh`, `make data-only
  DUNGEON=<slug>`) and the addon zip packaging (`make addon-zip`).
  Run `make help` for the full target list.

v0.3.3 — Hook Blizzard's tracker for the elapsed timer (2026-04-27)
-------------------------------------------------------------------

Improvements:
- The elapsed value is now read from a hooksecurefunc on
  ChallengeModeBlock:UpdateTime — the same callback Blizzard uses to
  drive its in-game M+ tracker. The displayed clock matches the
  official one by construction (no more realignment race), survives
  /reload mid-key without drift, and the ready-countdown + death
  penalty are included automatically. Pattern lifted from
  EllesmereUIMythicTimer's drift-immune approach.
- The fallback chain is GetWorldElapsedTime → GetTime() math, so the
  timer keeps working in worst case if a future patch breaks the hook.
- Final clear time now reads from C_ChallengeMode.GetChallengeCompletionInfo()
  (the modern struct API) before falling back to GetCompletionInfo().
  More resilient around depletion fanfare timing.
- After a /reload mid-key, a delayed PEW retry (10s) re-attaches the
  hook once Blizzard's own tracker has rebuilt.
- ENCOUNTER_END is now only registered while a key is active. Outside
  M+ the addon stays idle on raid / world-boss kills.

Cleanup:
- Removed WORLD_STATE_TIMER_START / STOP plumbing (the hook supersedes
  that path).

v0.3.2 — Hotfix: timer stuck at 0:00 in v0.3.1 (2026-04-27)
-----------------------------------------------------------

Fixes:
- v0.3.1 made the elapsed timer fully dependent on Blizzard's
  GetWorldElapsedTime API. In Midnight (12.0.x) this either no longer
  fires WORLD_STATE_TIMER_START for challenge mode or returns a different
  value layout, leaving the addon clock stuck at 0:00 for the entire run.
- The timer is now back to being driven by GetTime() (always available),
  with the official world timer used only to *realign* the start time to
  the post-countdown t0 when the event does come through. Best of both:
  if the API works, you get the accurate clock from v0.3.1; if it
  doesn't, you fall back to the v0.3.0 behaviour (functional, with a
  small ~10s start-of-key bias) instead of a frozen 0:00.
- Also handles the two known signatures of GetWorldElapsedTime
  (2-return vs 3-return) so future patch shifts won't silently break it.

v0.3.1 — Sync elapsed timer with Blizzard's official clock (2026-04-27)
-----------------------------------------------------------------------

Fixes:
- The "Écoulé" value now reads straight from Blizzard's challenge timer
  (`GetWorldElapsedTime`) instead of being computed from `GetTime()` at
  CHALLENGE_MODE_START. The previous approach was running ~8-10s ahead
  because CHALLENGE_MODE_START fires when the keystone is inserted, before
  the in-game ready countdown ends. The addon timer is now identical to
  the in-game one to the second, including the death penalty (which the
  official API already includes — the manual addition was removed to avoid
  double-counting). After /reload mid-key the addon scans active world
  timers via `GetWorldElapsedTimers` to recover the live timer ID.
- Boss splits recorded prior to v0.3.1 are biased by the same +8-10s
  offset and are not retroactively corrected. Use `/jit reset` if you want
  a clean slate for comparison against future runs.

v0.3.0 — Cross-level fallback + death-adjusted timer (2026-04-27)
------------------------------------------------------------------

Features:
- Cross-level reference fallback: when reference data is missing for the
  exact key level, the addon now picks the nearest available level within
  ±7 (e.g. running a +15 NPX with only +18-20 reference data falls back to
  +18). The overlay clearly labels the fallback as "Réf : 28:34 (clé +18)"
  and the chat prints a one-time info line at the start of the run. Beyond
  the ±7 cap the comparison would be too biased, so it falls through to
  "ref unavailable" rather than misleading you.
- Dynamic overlay height: the frame now resizes to fit the actual number
  of bosses in the dungeon (3-boss dungeons get a tighter frame, 4-boss
  unchanged, no wasted space at the bottom).

Fixes:
- Death penalty is now included in the elapsed timer. The addon's "Écoulé"
  matches Blizzard's in-game timer, and your boss splits are comparable to
  reference data which is sourced from death-adjusted leaderboard times.
  Penalty is read from `C_ChallengeMode.GetDeathCount()` so it adapts to
  affixes that scale the cost (e.g. Xal'atath's Guile = 15s/death on +12+).

v0.2.0 — Initial public release (2026-04-25)
---------------------------------------------

First public release of JustInTime on CurseForge.

Features:
- Live pace tracking: continuous delta against a reference run for the same
  dungeon, key level, and affix combo.
- Per-boss table: boss name, your time (live counter on the next-up boss,
  color-graded green / violet / red based on pace), and the reference split.
- Pace bar with progress fill, projected-finish marker, and per-boss pips
  that turn green on kill.
- Reference modes: public (curated reference set), fastest, recent, and
  median of your personal runs. Optional "Ignore affixes" to widen the
  sample when affix-specific data is sparse.
- Visibility modes: always visible during keys, or popup transient (6s
  fade after each boss kill).
- Show overlay button in settings to position the frame anywhere on your
  UI without being in a key.
- Movable overlay with lock / unlock and reset-to-default.
- Chat triggers (toggleable): boss kill, key-end recap, threshold cross,
  deplete-imminent warning.
- Critical alerts: red pulse, chat warning, sound.
- Slash commands: /jit, /jit show, /jit hide, /jit lock, /jit unlock,
  /jit mode <public|fastest|recent|median>, /jit reset, /jit test,
  /jit help.
- Locales: French (default for frFR) and English (enUS / enGB).
- Pure Lua, no LibStub, no Ace3. Single overlay frame, ~10 Hz updates,
  active only when needed.

Compatibility:
- WoW Retail Midnight (Interface 120001).

Author:
- Made by Claralicious_.
