v3.0.0
Textualize/textualv3.0.0Mar 27, 2025by willmcgugan
AI Summary
A major version bump introducing changes to `App.query` behavior, default arguments for `Content`, and Textual-specific thread naming. It also includes new styling options and fixes for various widgets.
Key Highlights
- `App.query` now queries the default screen instead of the active screen
- `Content` gets a default argument of an empty string
- New text-padding style added
- Buttons now use Textual markup instead of console markup
- Lazy loading of tree-sitter languages improves cold-start time
Breaking Changes
- `App.query` and friends now always query the default (first) screen, not necessarily the active screen
- Buttons will now use Textual markup rather than console markup
- Content now has a default argument of an empty string
New Features
- `Widget.preflight_checks` to perform debug checks after instantiation
- `text-padding` style
- `Content.first_line` property
- `Content.from_text` constructor
- `Content.empty` constructor
- `Content.pad` method
- `Style.has_transparent_foreground` property
- Tabs now accept Content or content markup
Full Release Notes
Mostly small enhancements, and fixes. This is a major version bump, due to a change in how app.query works. Previously this would query the active screen, but this would yield surprising results if you push a screen. Now app.query, gets results from the default screen.
This is unlikely to impact many apps. If it does, use `app.screen.query` where you previously used `app.query`.
## [3.0.0] - 2025-03-27
### Changed
- Breaking change: `App.query` and friends will now always query the default (first) screen, not necessarily the active screen.
- Content now has a default argument of an empty string, so `Content()` is equivalent to `Content("")`
- Assigned names to Textual-specific threads: `textual-input`, `textual-output`. These should become visible in monitoring tools (ps, top, htop) as of Python 3.14. https://github.com/Textualize/textual/pull/5654
- Tabs now accept Content or content markup https://github.com/Textualize/textual/pull/5657
- Breaking change: Buttons will now use Textual markup rather than console markup
- tree-sitter languages are now loaded lazily, improving cold-start time https://github.com/Textualize/textual/pull/563
### Fixed
- Static and Label now accept Content objects, satisfying type checkers https://github.com/Textualize/textual/pull/5618
- Fixed click selection not being disabled when allow_select was set to false https://github.com/Textualize/textual/issues/5627
- Fixed crash on clicking line API border https://github.com/Textualize/textual/pull/5641
- Fixed Select.selection now correctly returns None if Select.BLANK is selected instead of an AssertionError
- Fixed additional spaces after text-wrapping https://github.com/Textualize/textual/pull/5657
- Added missing `scroll_end` parameter to the `Log.write_line` method https://github.com/Textualize/textual/pull/5672
- Restored support for blink https://github.com/Textualize/textual/pull/5675
- Fixed scrolling breaking on DataTable with `overflow: hidden` https://github.com/Textualize/textual/pull/5681
### Added
- Added Widget.preflight_checks to perform some debug checks after a widget is instantiated, to catch common errors. https://github.com/Textualize/textual/pull/5588
- Added text-padding style https://github.com/Textualize/textual/pull/5657
- Added `Content.first_line` property https://github.com/Textualize/textual/pull/5657
- Added `Content.from_text` constructor https://github.com/Textualize/textual/pull/5657
- Added `Content.empty` constructor https://github.com/Textualize/textual/pull/5657
- Added `Content.pad` method https://github.com/Textualize/textual/pull/5657
- Added `Style.has_transparent_foreground` property https://github.com/Textualize/textual/pull/5657