Skip to content

Commit 4f6aaf9

Browse files
committed
Release v0.3.2
Bug-fix release covering Ctrl+C and handler lifecycle hardening, settings dialog public-contract gaps, and NO_COLOR handling in the ANSI converter. See CHANGELOG.md for details.
1 parent 1e2c18e commit 4f6aaf9

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.3.2] - 2026-05-01
9+
10+
### Fixed
11+
12+
- Ctrl+C now cancels a running input handler instead of letting it run to completion. The handler is tracked as an `asyncio.Task` and cancelled on Ctrl+C, with active thinking boxes finished and pending input cancelled.
13+
- Input submitted while a handler is running is no longer silently dropped. `accept_handler` now refuses to deliver input while busy, leaves the buffer intact, and surfaces a `Busy — press Ctrl+C to cancel` status hint.
14+
- Handler exceptions no longer leave thinking boxes stuck in the active state — cleanup runs in the exception path so callers using `start_thinking()` are not left in a permanent "thinking" state.
15+
- Ctrl+C with only an orphan thinking box (no running handler) now clears the box without also exiting the app. Previously the same keypress finished the boxes and then fell through to `app.exit()`.
16+
- `_user_cancelled_handler` flag is now reset in `finally` so it can't stay sticky when a handler suppresses `CancelledError` or cancellation races with natural completion. Prevents a leftover `True` state from swallowing a later outer cancellation and stalling shutdown.
17+
- `TextItem(password=True)` now masks input during editing, matching the masking already applied in view mode (previously the secret was visible while typing).
18+
- `DialogConfig.width` is now actually applied to the rendered dialog (was a public field that `_ConfigBasedDialog` never copied to `BaseDialog.width`).
19+
- `ButtonConfig.style` and `ButtonConfig.focused` are now honored — the configured style wraps each button's window style, and the configured focused button receives initial focus when the dialog opens.
20+
- `_renderable_to_ansi` (and the public `rich_to_ansi`, `StreamingContent.append_rich`, `StreamingContent.set_line_rich`) now ignore `NO_COLOR=1`. These APIs explicitly produce ANSI for the thinking box; honoring `NO_COLOR` at the converter layer silently stripped styling and made tests environment-sensitive.
21+
22+
### Changed
23+
24+
- Demo password fields in `demo_showcase.py` and `settings_dialog_demo.py` now mask API-key values in display output so demos don't print secrets the user just typed.
25+
826
## [0.3.1] - 2026-04-20
927

1028
### Added

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "thinking-prompt"
7-
version = "0.3.1"
7+
version = "0.3.2"
88
description = "A prompt_toolkit extension that adds a thinking box above the prompt"
99
readme = "README.md"
1010
license = "MIT"

thinking_prompt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async def handle(text: str):
6262
ThinkingContext,
6363
)
6464

65-
__version__ = "0.3.1"
65+
__version__ = "0.3.2"
6666

6767
__all__ = [
6868
# Main class

0 commit comments

Comments
 (0)