Releases: patrick91/rich-toolkit
0.17.1
Fix inline menu option wrapping by using spaces instead of tabs.
When using inline menus (e.g., app.confirm()), options like "Yes" and "No" were wrapping to separate lines due to tab character separators expanding unpredictably in fixed-width table columns. This release replaces tab separators with two spaces for consistent, predictable spacing.
Before:
● Yes
○ No
After:
● Yes ○ No
This release was contributed by @patrick91 in #44
0.17.0
Add scrolling support for menus with many options.
When a menu has more options than can fit on the terminal screen, it now
automatically scrolls as the user navigates with arrow keys. This prevents
the UI from breaking when the terminal is too small to display all options.
Features:
- Automatic scrolling based on terminal height
- Scroll indicators (
↑ more/↓ more) show when more options exist - Works with both
TaggedStyleandBorderedStyle - Works with filterable menus (scroll resets when filter changes)
- Optional
max_visibleparameter for explicit control
Example usage:
from rich_toolkit import RichToolkit
from rich_toolkit.styles.tagged import TaggedStyle
# Auto-scrolling based on terminal height
with RichToolkit(style=TaggedStyle()) as app:
result = app.ask(
"Select a country:",
options=[{"name": country, "value": country} for country in countries],
allow_filtering=True,
)
# Or with explicit max_visible limit
from rich_toolkit.menu import Menu
menu = Menu(
label="Pick an option:",
options=[{"name": f"Option {i}", "value": i} for i in range(50)],
max_visible=10, # Only show 10 options at a time
)
result = menu.ask()This release was contributed by @patrick91 in #41
0.16.0
Add Pydantic v1/v2 compatibility for Input validators using a Protocol-based approach.
The Input component now accepts any object with a validate_python method through the new Validator protocol, making it compatible with both Pydantic v1 and v2.
Usage with Pydantic v2:
from pydantic import TypeAdapter
validator = TypeAdapter(int)
app.input("Enter a number:", validator=validator)Usage with Pydantic v1:
from pydantic import parse_obj_as
class V1Validator:
def __init__(self, type_):
self.type_ = type_
def validate_python(self, value):
return parse_obj_as(self.type_, value)
validator = V1Validator(int)
app.input("Enter a number:", validator=validator)Changes:
- Added
Validatorprotocol that accepts any object with avalidate_pythonmethod - Improved error message extraction from Pydantic validation errors
- Added cross-version compatibility tests
- Updated CI to test both Pydantic v1 and v2 across Python 3.8-3.14
This release was contributed by @patrick91 in #39
0.15.1
This release add proper support for CJK characters
This release was contributed by @patrick91 in #38
0.15.0
This release increases the paste buffer from 32 to 4096 characters, enabling users to paste longer text into input fields.
It also adds full Windows compatibility with proper special key handling and fixes how password fields to always show asterisks.
This release was contributed by @patrick91 in #36
v0.14.9
What's Changed
- Always restore cursor when component is done by @patrick91 in #34
Full Changelog: v0.14.8...v0.14.9
v0.14.8
What's Changed
- Restore terminal settings in all circumstances when querying terminal colors by @adambenali in #33
New Contributors
- @adambenali made their first contribution in #33
Full Changelog: v0.14.7...v0.14.8
v0.14.7
What's Changed
- Fix placeholder when input is done by @patrick91 in #31
Full Changelog: v0.14.6...v0.14.7