v0.79.0

Textualize/textualv0.79.0Aug 30, 2024by willmcgugan

AI Summary

This release optimizes the query API by changing the semantics of `query_one` to no longer raise `TooManyMatches`. It introduces `query_exactly_one` for the old behavior and adds enhancements for key consumption and screen minimization.

Key Highlights

  • `query_one` no longer raises `TooManyMatches`; use `query_exactly_one` for strict matching.
  • Added `DOMNode.check_consume_key` for custom key handling.
  • Added `App.ESCAPE_TO_MINIMIZE` and `Screen.ESCAPE_TO_MINIMIZE` constants.
  • KeyPanel now displays multiple keys if bound to the same action.

Breaking Changes

  • `DOMNode.query_one` will no longer raise `TooManyMatches`.

New Features

  • `DOMNode.check_consume_key`
  • `App.ESCAPE_TO_MINIMIZE`
  • `Screen.ESCAPE_TO_MINIMIZE`
  • `DOMNode.query_exactly_one`
  • `SelectorSet.is_simple`

Full Release Notes

This release optimizes `query_one` and changes the semantics a little. `query_one` will no longer raise a TooManyMatches if there is more than a single widget matching the selector. For the old behavior, you can use the new `query_exactly_one` method.

See also https://textual.textualize.io/guide/devtools/#serve

Check below for the full details!

## [0.79.0] - 2024-08-30

### Added

- Added `DOMNode.check_consume_key` https://github.com/Textualize/textual/pull/4940
- Added `App.ESCAPE_TO_MINIMIZE`, `App.screen_to_minimize`, and `Screen.ESCAPE_TO_MINIMIZE` https://github.com/Textualize/textual/pull/4951
- Added `DOMNode.query_exactly_one` https://github.com/Textualize/textual/pull/4950
- Added `SelectorSet.is_simple` https://github.com/Textualize/textual/pull/4950

### Changed

- KeyPanel will show multiple keys if bound to the same action https://github.com/Textualize/textual/pull/4940
- Breaking change: `DOMNode.query_one` will not `raise TooManyMatches` https://github.com/Textualize/textual/pull/4950