Releases: Textualize/textual
The scarily good release
Just in time for Halloween, we have a new release. There are a lot of fixes, and improvement to startup time. A few breaking changes that are unlikely to impact many people.
We also reached the scary milestone of 666 forks!
[0.41.0] - 2023-10-31
Fixed
- Fixed
Input.cursor_blink
reactive not changing blink state afterInput
was mounted #3498 - Fixed
Tabs.active
attribute value not being re-assigned after removing a tab or clearing #3498 - Fixed
DirectoryTree
race-condition crash when changing path #3498 - Fixed issue with
LRUCache.discard
#3537 - Fixed
DataTable
not scrolling to rows that were just added #3552 - Fixed cache bug with
DataTable.update_cell
#3551 - Fixed CSS errors being repeated #3566
- Fix issue with chunky highlights on buttons #3571
- Fixed
OptionList
event leakage fromCommandPalette
toApp
. - Fixed crash in
LoadingIndicator
#3498 - Fixed crash when
Tabs
appeared as a descendant ofTabbedContent
in the DOM #3602 - Fixed the command palette cancelling other workers #3615
Added
- Add Document
get_index_from_location
/get_location_from_index
#3410 - Add setter for
TextArea.text
#3525 - Added
key
argument to theDataTable.sort()
method, allowing the table to be sorted using a custom function (or other callable) #3090 - Added
initial
to all css rules, which restores default (i.e. value from DEFAULT_CSS) #3566 - Added HorizontalPad to pad.py #3571
- Added
AwaitComplete
class, to be used for optionally awaitable return values #3498
Changed
- Breaking change:
Button.ACTIVE_EFFECT_DURATION
classvar converted toButton.active_effect_duration
attribute #3498 - Breaking change:
Input.blink_timer
made private (renamed toInput._blink_timer
) #3498 - Breaking change:
Input.cursor_blink
reactive updated to not run on mount (nowinit=False
) #3498 - Breaking change:
AwaitTabbedContent
class removed #3498 - Breaking change:
Tabs.remove_tab
now returns anAwaitComplete
instead of anAwaitRemove
#3498 - Breaking change:
Tabs.clear
now returns anAwaitComplete
instead of anAwaitRemove
#3498 TabbedContent.add_pane
now returns anAwaitComplete
instead of anAwaitTabbedContent
#3498TabbedContent.remove_pane
now returns anAwaitComplete
instead of anAwaitTabbedContent
#3498TabbedContent.clear_pane
now returns anAwaitComplete
instead of anAwaitTabbedContent
#3498Tabs.add_tab
now returns anAwaitComplete
instead of anAwaitMount
#3498DirectoryTree.reload
now returns anAwaitComplete
, which may be awaited to ensure the node has finished being processed by the internal queue #3498Tabs.remove_tab
now returns anAwaitComplete
, which may be awaited to ensure the tab is unmounted and internal state is updated #3498App.switch_mode
now returns anAwaitMount
, which may be awaited to ensure the screen is mounted #3498- Buttons will now display multiple lines, and have auto height #3539
- DataTable now has a max-height of 100vh rather than 100%, which doesn't work with auto
- Breaking change: empty rules now result in an error #3566
- Improved startup time by caching CSS parsing #3575
- Workers are now created/run in a thread-safe way #3586
The loading release
You can now set widget.loading=True
to replace the widget with a loading indicator.
https://twitter.com/willmcgugan/status/1712104087213297791
[0.40.0] - 2023-10-11
- Added
loading
reactive property to widgets #3509
The invisible scrollbar release
A mixed bag of fixes and API improvements.
Notable breaking change is that the tree-sitter code has been split out. If you need syntax highlighting in the TextArea, you can install it with this:
pip install "textual[syntax]"
[0.39.0] - 2023-10-10
Fixed
Pilot.click
/Pilot.hover
can't useScreen
as a selector #3395- App exception when a
Tree
is initialized/mounted withdisabled=True
#3407 - Fixed
print
locations not being correctly reported intextual console
#3237 - Fix location of IME and emoji popups #3408
- Fixed application freeze when pasting an emoji into an application on Windows #3178
- Fixed duplicate option ID handling in the
OptionList
#3455 - Fix crash when removing and updating DataTable cell at same time #3487
- Fixed fractional styles to allow integer values #3414
- Stop eating stdout/stderr in headless mode - print works again in tests #3486
Added
OutOfBounds
exception to be raised byPilot
#3360TextArea.cursor_screen_offset
property for getting the screen-relative position of the cursor #3408Input.cursor_screen_offset
property for getting the screen-relative position of the cursor #3408- Reactive
cell_padding
(and respective parameter) to define horizontal cell padding in data table columns #3435 - Added
Input.clear
method #3430 - Added
TextArea.SelectionChanged
andTextArea.Changed
messages #3442 - Added
wait_for_dismiss
parameter toApp.push_screen
#3477 - Allow scrollbar-size to be set to 0 to achieve scrollable containers with no visible scrollbars #3488
Changed
- Breaking change: tree-sitter and tree-sitter-languages dependencies moved to
syntax
extra #3398 Pilot.click
/Pilot.hover
now raisesOutOfBounds
when clicking outside visible screen #3360Pilot.click
/Pilot.hover
now return a Boolean indicating whether the click/hover landed on the widget that matches the selector #3360- Added a delay to when the
No Matches
message appears in the command palette, thus removing a flicker #3399
The hotfixed Textarea release
The TextArea has landed release
https://textual.textualize.io/blog/2023/09/21/textual-0380-adds-a-syntax-aware-textarea/
[0.38.0] - 2023-09-21
Added
- Added a TextArea #2931
- Added :dark and :light pseudo classes
Fixed
- Fixed
DataTable
not updating component styles on hot-reloading #3312
Changed
- Breaking change: CSS in DEFAULT_CSS is now automatically scoped to the widget (set SCOPED_CSS=False) to disable
Whoah, time out!
Hotfix for a TimeoutError
[0.37.1] - 2023-09-16
Fixed
- Fixed the command palette crashing with a
TimeoutError
in any Python before 3.11 #3320 - Fixed
Input
event leakage fromCommandPalette
toApp
.
The Commanding release
https://textual.textualize.io/blog/2023/09/15/textual-0370-adds-a-command-palette/
[0.37.0] - 2023-09-15
Added
- Added the command palette #3058
Input
is now validated when focus moves out of it #3193- Attribute
Input.validate_on
(and__init__
parameter of the same name) to customise when validation occurs #3193 - Screen-specific (sub-)title attributes #3199:
Screen.TITLE
Screen.SUB_TITLE
Screen.title
Screen.sub_title
- Properties
Header.screen_title
andHeader.screen_sub_title
#3199 - Added
DirectoryTree.DirectorySelected
message #3200 - Added
widgets.Collapsible
contributed by Sunyoung Yoo #2989
Fixed
- Fixed a crash when removing an option from an
OptionList
while the mouse is hovering over the last option #3270 - Fixed a crash in
MarkdownViewer
when clicking on a link that contains an anchor #3094 - Fixed wrong message pump in pop_screen #3315
Changed
The Rule release
[0.36.0] - 2023-09-05
Added
- TCSS styles
layer
andlayers
can be strings #3169 App.return_code
for the app return code #3202- Added
animate
switch toTree.scroll_to_line
andTree.scroll_to_node
#3210 - Added
Rule
widget #3209 - Added App.current_mode to get the current mode #3233
Changed
- Reactive callbacks are now scheduled on the message pump of the reactable that is watching instead of the owner of reactive attribute #3065
- Callbacks scheduled with
call_next
will now have the same prevented messages as when the callback was scheduled #3065 - Added
cursor_type
to theDataTable
constructor. - Fixed
push_screen
not updating Screen.CSS styles #3217
Fixed
v0.35.1: version bump (#3181)
[0.35.1]
Fixed
- Fixed flash of 80x24 interface in textual-web