# Changelog

## Unreleased

### Added

- Optional ElDoc displays section timestamps and Pi-provided nested tool-call durations, controlled by `pimacs-eldoc-enabled`.
- `M-RET` (Alt+Enter) resumes a session search result in a separate chat and agent, leaving existing chats unchanged.

### Fixed

- Autohide counts eligible leaves across the whole buffer, keeping recent or excluded sections and their ancestors expanded without counting parents or initially hidden leaves toward the limit, regardless of manual folding. Filters apply at every nesting depth, and manual visibility choices are preserved.

## v0.9.0 - 2026-10-08

### Added

- `C-M-a` and `C-M-e` move to the start and end of the prompt text without changing line or buffer navigation.
- `C-M-h` selects the complete prompt, and `C-c C-u` kills prompt text from its beginning to point.
- `pimacs-resume-new-buffer` resumes a persisted session in a separate chat and agent without replacing existing chats.
- `pimacs-copy-section` (`w`) copies the content of the section at point to the kill ring, including tool calls and results.
- Support Pi's `codemode` tool with JavaScript rendering, script copying, and nested tool calls.
- `pimacs-section-initial-hide-filter` controls initial folding, with tool-specific selectors shared by `pimacs-section-autohide-filter`. Codemode's own output starts collapsed.

### Changed

- Session resume candidates now show parent/child relationships as a tree.
- Chat-switch completion includes project-root paths, so chats can be filtered by their project directory.
- Improve queue styling and show pending message counts in the mode line.

### Fixed

- Reload agents with the same freshly loaded project environment and directory-local settings used by new chats.
- Use the short session ID for unnamed chat buffers and update buffer names when sessions change.
- Keep point near the same text when streamed content is re-rendered.
- Keep the view from scrolling while reading history during streaming.
- Handle JSON `null` values consistently in agent responses and session data.
- Prevent prefix arguments from leaking into nested chat commands.

## v0.8.0 - 2026-09-24

### Added

- `M-x pimacs-resume` can resume persisted sessions without an active chat, either from the current project or across all projects.

### Changed

- Active conversation buffers are now called chats; persisted Pi conversations are called sessions.
- `pimacs-session-directory` is the shared root for persisted session files and replaces `pimacs-search-default-directory`.

### Breaking Changes

- Active-chat commands use the `pimacs-*chat` names, including `pimacs-switch-chat` and `pimacs-quit-chat`.

## v0.7.0 - 2026-09-14

### Added

- `pimacs-search-sessions` searches historical Pi sessions with configurable search type, case sensitivity, project scope, context, and content filters, and can resume sessions from results.
- `pimacs-doctor` checks the `rg` and `jq` dependencies required for session search.

### Changed

- Tool calls now appear as soon as execution starts, before their arguments are available.
- Directory-local variables are respected when starting chats and reloading Pimacs; revert-buffer shortcuts now reload Pimacs.
- Project, session, executable, and file paths are abbreviated where possible.

## v0.6.0 - 2026-08-30

### Added

- `/clear-queue` and `/edit-queue` commands for managing queued steering and follow-up messages.
- `pimacs-quote-region` and the `>` chat key binding for quoting selected text in the prompt.

### Changed

- Aborting an operation now restores queued messages to the prompt.
- File links display project-relative paths when possible and push an xref marker before visiting files.
- File completion is scoped to the Pimacs project root.
- Grep rendering now tolerates errors in individual result lines.
- Diff headers are no longer shown in rendered edit results.
- The minimum supported Pi agent version is now 0.84.4.

## v0.5.0 - 2026-08-22

### Breaking Changes

- Remove the previously suggested renderer customization:

  ```elisp
  (setq pimacs-markdown-renderer #'pimacs--render-markdown
        pimacs-thinking-renderer #'pimacs--render-thinking-markdown)
  ```

  Markdown rendering is now enabled by default, and `pimacs--render-thinking-markdown` has been removed.

### Added

- `pimacs-section-autohide-filter` controls which top-level sections are eligible for automatic hiding.

### Changed

- Tree-sitter Markdown rendering is now the default for assistant and thinking content; the `markdown-mode` dependency is no longer required.
- Markdown rendering falls back to plain text with a warning when the required Tree-sitter grammars are unavailable.
- Bash command output now renders ANSI color sequences consistently with widget and status output.
- `pimacs-describe-section` now presents section details in a Help buffer with navigable links.
- Session history is rendered in smaller chunks for improved responsiveness.
- Pi agent stderr is sent to the `*pimacs-stderr*` buffer, and agent processes no longer prompt on exit.

### Fixed

- Orphaned tool calls no longer prevent subsequent session history from being rendered.
- Block-level Markdown content now starts on a new line when needed.

## v0.4.0 - 2026-08-15

### Added

- Customizable faces for chat sections, including separate faces for thinking
  levels and user messages.
- Syntax highlighting for arguments in custom tool calls.

### Changed

- Session history is rendered incrementally in chunks to keep large sessions
  responsive.
- Grep results are fontified in place for better performance and more accurate
  navigation.
- Tree-sitter Markdown rendering uses `ts-mode` when it is available.

### Fixed

- Incremental search now temporarily reveals collapsed text.
- Markdown code fences without a trailing newline are rendered correctly.
- Partial or incomplete diffs no longer prevent edit results from rendering.
- Grep result fontification now remains within the result region.

## v0.3.0 - 2026-08-06

### Added

- An opt-in Tree-sitter-based Markdown renderer with incremental streaming,
  rich Markdown syntax support, formatted tables, and link widgets.
- `pimacs-doctor` reports the status of Pi, Tree-sitter, and the Markdown
  grammars, with actions to install missing dependencies.
- Commands and keybindings to show section visibility at selected levels,
  apply visibility levels globally, and cycle global visibility.
- Batching and merging of streamed message updates to reduce redundant
  renders.

### Changed

- Thinking-level selection now uses Pi's `get_available_thinking_levels`
  command.
- Message handling no longer depends on the removed `partial` and `message`
  event fields, enabling compatibility with upcoming Pi versions.
- The minimum supported Emacs version is now 29.1.

### Fixed

- Grep result highlighting now handles regular-expression patterns correctly.

## v0.2.0 - 2026-07-25

### Added

- Bash command output is streamed while the command is running.
- Extension status text can be placed in header and mode lines with
  `(:status STATUS-KEY ...)`, including per-placement face customization.
  Status keys can be hidden from the prompt status widget with
  `pimacs-status-widget-hidden-keys`.
- `pimacs-list-sessions` displays active chats in a sortable tabulated list.
  Its columns and initial sort order are configurable with
  `pimacs-list-sessions-table` and `pimacs-list-sessions-sort-key`.
- The `:project_root` state-line component displays the project root directory.
- `pimacs-switch-session` switches between active chats.
- Send commands select an active chat by enclosing project root, prompting when ambiguous.
- Start chats from any directory using the `C-u` prefix for `pimacs-chat`,
  which opens a transient for selecting a session name and root
  directory.

## v0.1.0 - 2026-07-19

### Added

- Configurable header and mode-line status formats via
  `pimacs-header-line-format` and `pimacs-mode-line-format`.
