v4.0.0

Textualize/textualv4.0.0Jul 12, 2025by willmcgugan

AI Summary

Highlights Markdown streaming capabilities and a significant change to the `Widget.anchor` method semantics.

Key Highlights

  • New `Markdown.append` method for efficiently streaming markdown content.
  • `Widget.anchor` now anchors to the bottom of the scroll position.

Breaking Changes

  • `Widget.anchor` now has different semantics, anchoring to the bottom of the scroll position.

New Features

  • `Markdown.append`
  • `Widget.release_anchor`
  • `compact` parameter to `MaskedInput`

Full Release Notes

The highlight of this release is the new [Markdown.append](https://textual.textualize.io/widgets/markdown/#textual.widgets.Markdown.append) method which can be used to efficiently stream markdown content (like you might get from an LLM).

https://github.com/user-attachments/assets/57fbb0de-bbda-4903-ae09-1b2bd18afe96

The [Widget.anchor](https://textual.textualize.io/api/widget/#textual.widget.Widget.anchor) method has changed semantics (and also works much better), which is the reason for the major version bump. This will only impact you if you are actually using that method.

And there are a few fixes and additions. Thanks to the community for these contributions.

## [4.0.0] - 2025-07-12

### Fixed

- Fixed `query_one` and `query_exactly_one` not raising documented `WrongType` exception. https://github.com/Textualize/textual/pull/5945
- Fixed logging to a file on Windows https://github.com/Textualize/textual/issues/5941
- Fixed eight bit colors crashing when applying dim style https://github.com/Textualize/textual/pull/5957

### Changed

- Breaking change: `Widget.anchor` now has different semantics. It should be applied to a container and anchors to the bottom of the scroll position. https://github.com/Textualize/textual/pull/5950

### Added

- Added `Markdown.append` https://github.com/Textualize/textual/pull/5950
- Added `Widget.release_anchor` https://github.com/Textualize/textual/pull/5950
- Added `compact` parameter to `MaskedInput` https://github.com/Textualize/textual/pull/5952