v0.86.0
Textualize/textualv0.86.0Nov 16, 2024by willmcgugan
AI Summary
A major release introducing a completely new theming system, an updated demo, and improvements to the event handling driver API.
Key Highlights
- Added entirely new theming system
- Added 'Change theme' command to command palette
- Added support for in-band terminal resize protocol
- Removed App.dark reactive attribute
Breaking Changes
- Removed App.dark reactive attribute
- Changes to default widget CSS and CSS variables (likely to look different)
- Driver.process_event renamed to Driver.process_message
- Driver.send_event renamed to Driver.send_message
New Features
- New theming system
- Command palette search
- Terminal resize protocol
- Widget.is_scrolling
- Tree.add_json
- App.theme reactive attribute
- App.get_theme / App.register_theme / App.unregister_theme
- App.available_themes / App.current_theme
- Screen.action_blur
- Click events on decorator
Full Release Notes
This is a large release! v0.86.0 Adds an entirely new theming system and an updated demo (Run `python -m textual`). The new theming system standardizes the look-and-feel of widgets. This should mean they will look pretty when used in combination, and you will need less tweaking of your UI. If your app already has a customized look and feel, you may need to make a few style changes. Let us know if you need any help with that (jump on the Discord server). Here's what the demo looks like now: <img width="1416" alt="Screenshot 2024-11-16 at 18 52 01" src="https://github.com/user-attachments/assets/b97356f9-e865-4a46-b7c7-c3c730a88a31"> https://github.com/user-attachments/assets/2ed5d4a6-b70a-4c7c-a7a2-31dee24800c1 Use the command palette to switch themes... ## [0.86.0] - 2024-11-16 ### Fixed - Fixed duplicated key displays in the help panel https://github.com/Textualize/textual/issues/5037 - Fixed `TextArea` mouse selection with tab characters https://github.com/Textualize/textual/issues/5212 - Fixed `Tabs` not updating the highlighting after removing a tab https://github.com/Textualize/textual/issues/5218 ### Added - Added `App.theme` reactive attribute https://github.com/Textualize/textual/pull/5087 - Added various starter themes https://github.com/Textualize/textual/pull/5087 - Added "Change theme" command to command palette https://github.com/Textualize/textual/pull/5087 - Added `variant` parameter to `Label` widget for quick access to common styles https://github.com/Textualize/textual/pull/5087 - Added `App.get_theme` which returns a theme by name https://github.com/Textualize/textual/pull/5087 - Added `App.register_theme` and `App.unregister_theme` https://github.com/Textualize/textual/pull/5087 - Added `App.theme_changed_signal` https://github.com/Textualize/textual/pull/5087 - Added `App.available_themes` property which returns a mapping of theme names to `Theme` instances https://github.com/Textualize/textual/pull/5087 - Added `App.current_theme` property which returns the currently active theme object https://github.com/Textualize/textual/pull/5087 - Added `App.get_theme_variable_defaults` which returns a mapping of theme variables to their default values https://github.com/Textualize/textual/pull/5087 - Added `App.search` which allows bringing up a fuzzy search list of commands on-demand https://github.com/Textualize/textual/pull/5087 - Added `App.search_themes` which allows bringing up a fuzzy search list of themes on-demand https://github.com/Textualize/textual/pull/5087 - Added `textual.theme.ThemeProvider`, a command palette provider which returns all registered themes https://github.com/Textualize/textual/pull/5087 - Added several new built-in CSS variables https://github.com/Textualize/textual/pull/5087 - Added support for in-band terminal resize protocol https://github.com/Textualize/textual/pull/5217 - Added TEXTUAL_THEME environment var, which should be a comma separated list of desired themes https://github.com/Textualize/textual/pull/5238 - Added `Widget.is_scrolling` https://github.com/Textualize/textual/pull/5238 - Added `Tree.add_json` https://github.com/Textualize/textual/pull/5238 ### Changed - `Driver.process_event` is now `Driver.process_message` https://github.com/Textualize/textual/pull/5217 - `Driver.send_event` is now `Driver.send_message` https://github.com/Textualize/textual/pull/5217 - Added `can_focus` and `can_focus_children` parameters to scrollable container types. https://github.com/Textualize/textual/pull/5226 - Added `textual.lazy.Reveal` https://github.com/Textualize/textual/pull/5226 - Added `Screen.action_blur` https://github.com/Textualize/textual/pull/5226 - `Click` events can now be used with the on decorator to match the originally clicked widget https://github.com/Textualize/textual/pull/5238 - Breaking change: Removed `App.dark` reactive attribute https://github.com/Textualize/textual/pull/5087 - Breaking change: To improve consistency, several changes have been made to default widget CSS and the CSS variables which ship with Textual. On upgrading, your app will likely look different. All of these changes can be overidden with your own CSS. https://github.com/Textualize/textual/pull/5087 ### Removed - Removed `App.HOVER_EFFECTS_SCROLL_PAUSE` https://github.com/Textualize/textual/pull/5238