# Repository Guidelines

## Project Structure & Module Organization
This repository is a World of Warcraft addon (`Recount`) targeting interface `20400` (see `Recount.toc`). Core logic lives in top-level Lua files such as `Recount.lua`, `Tracker.lua`, and `Recount_Modes.lua`. UI modules are prefixed with `GUI_` (for example, `GUI_Main.lua`, `GUI_Detail.lua`, `GUI_Realtime.lua`).

Localization files are in `locales/` (`Recount-enUS.lua`, `Recount-frFR.lua`, etc.). Embedded third-party libraries are vendored under `libs/` (Ace3, LibGraph, LibSharedMedia, and related dependencies). Static assets are in `textures/` and `Fonts/`.

## Build, Test, and Development Commands
This project does not use a compiled build step or automated test runner.

- `pwsh -Command "rg --files"`: list tracked source/assets quickly.
- `pwsh -Command "Get-Content Recount.toc"`: verify load order and addon metadata.
- `git diff`: review local changes before packaging.

For local validation, copy this folder into your WoW AddOns directory as `Interface/AddOns/Recount`, reload UI, and test in combat (`/reload` in game).

## Coding Style & Naming Conventions
Use existing Lua style in this codebase:

- Indentation: tabs (preserve file style; avoid reformat-only edits).
- Module/file names: PascalCase or `GUI_*` patterns matching current files.
- Locals/functions: descriptive camelCase names; keep global surface minimal.
- Keep event handlers and UI refresh paths lightweight to avoid frame drops.

Do not modify vendored files in `libs/` unless explicitly updating a dependency.

## Testing Guidelines
Testing is manual and in-game. Validate at minimum:

- data capture (damage/healing updates),
- realtime/healing window behavior,
- death/detail views,
- reset/report flows,
- localization fallback (at least `enUS` still loads).

When changing load order or files, confirm `Recount.toc` includes the new/renamed file.

## Default Profile & Migration Notes
Repository defaults are defined in `Recount.lua` (`Default_Profile`). This repo currently uses a forced migration model: if `HardDefaultsMigrationVersion` is below `HARD_DEFAULTS_MIGRATION_VERSION`, profile settings are reset to defaults via `Recount.db:ResetProfile()`.

- Keep `HardDefaultsMigrationVersion` in `Default_Profile` aligned with `HARD_DEFAULTS_MIGRATION_VERSION`.
- Bump the migration version only when you intentionally want to overwrite existing user settings with new defaults.
- Window/bar visibility is controlled by `Filters.Show`; data collection is controlled separately by `Filters.Data`.
- Current default dataset is `CurrentFightData` (not `OverallData`).

## Commit & Pull Request Guidelines
Recent commits use short imperative messages (often with issue refs), e.g. `Fix stale death detail rows (#18)`.

- Commit format: `Verb concise description` and include `(#[issue])` when applicable.
- Keep commits focused (one behavior change per commit).
- PRs should include: summary, risk/impact, manual test steps, and screenshots/GIFs for UI changes.
- Call out any `Recount.toc` or localization updates explicitly in the PR description.
