# Changelog

## [0.4.1] - 2026-07-16

- Keep the established fixed token colour bands when auto-compact lowers the displayed context window.
- Add a muted down arrow to capped context limits, for example `10k/200k↓`.

## [0.4.0] - 2026-07-15

- Use the active `pi-auto-compact` threshold as the HUD context limit when it is lower than the provider context window.
- Recalculate the displayed percentage and context colour against that effective limit.
- Keep the provider context window when auto-compact is absent or its threshold is not the binding limit.
- Add strict type checking and focused tests for context-limit integration.

## [0.3.2] - 2026-06-24

- Move the usage metric into the input box bottom border.
- Move provider/reset detail to the footer right side without parentheses, in muted grey.
- Show only the provider name in the footer when using API-key billing.
- Make the footer responsive: preserve context + repo/branch/diff before session text, collapse reset detail to countdown-only, then hide it on very narrow terminals.

## [0.3.1] - 2026-06-24

- Change subscription quota display from weekly percent used to weekly percent left.
- Replace `ahead +x%` with a weekly reset countdown, for example `44% left (weekly reset in 3d04h)`.

## [0.3.0] - 2026-06-24

- Add a right-aligned footer usage slot below the input box.
- Show Pi's calculated session cost for non-subscription auth.
- Show OpenAI/Codex weekly subscription utilisation when Codex rate-limit headers or the Codex usage endpoint provide it.
- Show Anthropic weekly subscription utilisation when Anthropic rate-limit headers or the Claude OAuth usage endpoint provide it.
- Add `ahead +x%` when provider usage is ahead of elapsed weekly-window time.

## [0.2.1] - 2026-06-24

- Render unnamed first-message session fallbacks in muted grey instead of italics.
- Render named sessions in the normal white text colour.

## [0.2.0] - 2026-06-23

- Replace the below-editor widget plus default Pi footer with a single compact context/location footer line.
- Remove the duplicated cwd footer row and extension status row from the area below the input box.
- Keep context bar/text colours for quick context-usage scanning.
- Restore git diff stats after the project/branch label (`+x -y`, with `~` for dirty-without-line-count changes).
- Move model/thinking into the top editor border and keep provider in the bottom editor border.
- Add a one-column editor gutter and wrap the input inside a full border.
- Add a one-space matching footer gutter so the context/location line aligns with editor content.
- Render the footer `│` divider in the same muted grey as the provider label.
- Italicize the first-message session fallback after the project path. (Revised in 0.2.1.)
- Include the session name, or the first few words of the first user message when unnamed, after the project path.

## [0.1.8] - 2026-06-10

- Preserve the HUD background fill on truncated lines in narrow terminals by padding after truncation with the status background reapplied, including after hard ANSI resets emitted by `truncateToWidth()`.
- Let the status label widen with the terminal instead of always truncating to 10 columns, so stale tool labels such as `subagent 38s` reappear after expanding the terminal.
- Make context-bar colours on larger-than-GPT-5.5 context windows warn at roughly GPT-5.5-equivalent token counts, so 1M-token models stop staying green/yellow for too long.
- Apply the same context warning scale to the used-token count while keeping the percentage and `/context-window` suffix muted grey.
- Add configurable context colour bands via `pi-session-hud.json`, including absolute-token or percentage modes plus provider/model overrides.
- Reset HUD status from the current `session_start` event instead of the obsolete `session_switch` hook.

## [0.1.7] - 2026-05-07

### Changed
- Declare the `@earendil-works` Pi peer and development dependencies used by runtime imports.
- Update Pi extension imports to the new `@earendil-works` namespace.

## 0.1.6 - 2026-04-23

- Fix crash during `/resume`: the HUD's render callback (and its git/worktree pollers) now survive the brief window where pi core has invalidated the old extension runtime but hasn't yet replaced the widget, instead of throwing `Error: This extension instance is stale after session replacement or reload.` out of the TUI render timer
- `renderBar` short-circuits to an empty render when the widget is disposed or the ExtensionAPI is stale
- `refreshGit` / `refreshWorktree` / initial git branch probe now swallow the same stale-extension error

## 0.1.5 - 2026-03-12

- Clamp the context bar fill to the widget width so usage above 100% renders as a full bar instead of crashing
- Show `?` for unknown context usage/token counts (for example, right after compaction before Pi has fresh usage data)

## 0.1.4 - 2026-02-11

- Restore demo GIF/MP4 to the original capture with the HUD visible below the editor
- Add a static HUD placement screenshot below the demo video in README
- Continue hosting media on GitHub (not included in npm package files)

## 0.1.3 - 2026-02-11

- Refresh demo assets from latest screen recording and trim to seconds 1–7
- Update README demo media links to `main` so npm/README renders current assets from GitHub
- Keep npm package lightweight by continuing to exclude `assets/` from published files

## 0.1.2 - 2026-02-11

- Add worktree awareness on the main HUD line when a repo has multiple worktrees.
  - Shows `⎇ <name> <current>/<total>` (example: `⎇ tui-typing 13/14`)
  - Hidden automatically for single-worktree repos
- Improve worktree detection for main vs linked worktrees
- Reset worktree state on install/session switch to avoid stale labels
- Docs: update README “What it shows” and demo links for the `v0.1.2` tag

## 0.1.1 - 2026-02-07

- README demo embed (GIF + MP4 hosted on GitHub)
- Keep npm package small (demo media not included in published tarball)

## 0.1.0 - 2026-02-07

Initial release.

- Persistent session HUD widget placed **below the editor**
- Shows activity state, session/cwd, git branch + diff stats, context usage, model + thinking level
- `/hud` command (with `/status` and `/header` aliases)
