From fe7a8998f8710ead9f228f09fd0bdddc70d141d6 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Tue, 26 Mar 2024 11:17:21 +0000 Subject: [PATCH 1/4] Add see-also relating to (un)mounting --- docs/events/load.md | 4 ++++ docs/events/mount.md | 5 +++++ docs/events/unmount.md | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/docs/events/load.md b/docs/events/load.md index 16f5e3d153..f1142f3546 100644 --- a/docs/events/load.md +++ b/docs/events/load.md @@ -1,3 +1,7 @@ ::: textual.events.Load options: heading_level: 1 + +## See also + +- [Mount](mount.md) diff --git a/docs/events/mount.md b/docs/events/mount.md index 885b8f4e9e..955391f056 100644 --- a/docs/events/mount.md +++ b/docs/events/mount.md @@ -1,3 +1,8 @@ ::: textual.events.Mount options: heading_level: 1 + +## See also + +- [Load](load.md) +- [Unmount](unmount.md) diff --git a/docs/events/unmount.md b/docs/events/unmount.md index 8e17c76924..2df6dccdd5 100644 --- a/docs/events/unmount.md +++ b/docs/events/unmount.md @@ -1,3 +1,7 @@ ::: textual.events.Unmount options: heading_level: 1 + +## See also + +- [Mount](mount.md) From fc56863f0f324e47cc9186eafa41ef2b0ea37645 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Tue, 26 Mar 2024 11:34:50 +0000 Subject: [PATCH 2/4] event docstrings --- docs/events/mouse_capture.md | 2 ++ docs/events/mouse_release.md | 2 ++ src/textual/events.py | 19 +++++++++++++------ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/docs/events/mouse_capture.md b/docs/events/mouse_capture.md index 945da83085..953a086bf5 100644 --- a/docs/events/mouse_capture.md +++ b/docs/events/mouse_capture.md @@ -8,4 +8,6 @@ title: MouseCapture ## See also +- [capture_mouse][textual.widget.Widget.capture_mouse] +- [release_mouse][textual.widget.Widget.release_mouse] - [MouseRelease](mouse_release.md) diff --git a/docs/events/mouse_release.md b/docs/events/mouse_release.md index 438e03569b..a6e0a91cbe 100644 --- a/docs/events/mouse_release.md +++ b/docs/events/mouse_release.md @@ -8,4 +8,6 @@ title: MouseRelease ## See also +- [capture_mouse][textual.widget.Widget.capture_mouse] +- [release_mouse][textual.widget.Widget.release_mouse] - [MouseCapture](mouse_capture.md) diff --git a/src/textual/events.py b/src/textual/events.py index 7e5c158bc5..68c3ae8f3d 100644 --- a/src/textual/events.py +++ b/src/textual/events.py @@ -59,7 +59,7 @@ class Load(Event, bubble=False): """ Sent when the App is running but *before* the terminal is in application mode. - Use this event to run any set up that doesn't require any visuals such as loading + Use this event to run any setup that doesn't require any visuals such as loading configuration and binding keys. - [ ] Bubbles @@ -129,6 +129,9 @@ def __rich_repr__(self) -> rich.repr.Result: class Compose(Event, bubble=False, verbose=True): """Sent to a widget to request it to compose and mount children. + This event is used internally by Textual. + You won't typically need to explicitly handle it, + - [ ] Bubbles - [X] Verbose """ @@ -151,7 +154,7 @@ class Unmount(Event, bubble=False, verbose=False): class Show(Event, bubble=False): - """Sent when a widget has become visible. + """Sent when a widget is first displayed. - [ ] Bubbles - [ ] Verbose @@ -164,13 +167,17 @@ class Hide(Event, bubble=False): - [ ] Bubbles - [ ] Verbose - A widget may be hidden by setting its `visible` flag to `False`, if it is no longer in a layout, - or if it has been offset beyond the edges of the terminal. + Sent when any of the following conditions apply: + + - The widget is removed from the DOM. + - The widget is no longer displayed because it has been scrolled or clipped from the terminal or its container. + - The widget has its `display` attribute set to `False`. + - The widget's `display` style is set to `"none"`. """ class Ready(Event, bubble=False): - """Sent to the app when the DOM is ready. + """Sent to the `App` when the DOM is ready and the first frame has been displayed. - [ ] Bubbles - [ ] Verbose @@ -232,7 +239,7 @@ class Key(InputEvent): Args: key: The key that was pressed. - character: A printable character or ``None`` if it is not printable. + character: A printable character or `None` if it is not printable. """ __slots__ = ["key", "character", "aliases"] From b8f91bd016c00ee2c553ab74ea55c9bae0171dc8 Mon Sep 17 00:00:00 2001 From: TomJGooding <101601846+TomJGooding@users.noreply.github.com> Date: Tue, 26 Mar 2024 11:45:35 +0000 Subject: [PATCH 3/4] docs: fix changelog --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c1e3d9dc8..c695c34430 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## [0.54.0] - 2023-03-26 +## [0.54.0] - 2024-03-26 ### Fixed @@ -24,13 +24,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Added `Document.start` and `end` location properties for convenience https://github.com/Textualize/textual/pull/4267 -## [0.53.1] - 2023-03-18 +## [0.53.1] - 2024-03-18 ### Fixed - Fixed issue with data binding https://github.com/Textualize/textual/pull/4308 -## [0.53.0] - 2023-03-18 +## [0.53.0] - 2024-03-18 ### Added From 88a6296dcdaf0afcfa61dca9d4d62956aad9d1e9 Mon Sep 17 00:00:00 2001 From: TomJGooding <101601846+TomJGooding@users.noreply.github.com> Date: Tue, 26 Mar 2024 11:55:37 +0000 Subject: [PATCH 4/4] move updates to unreleased --- CHANGELOG.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c695c34430..2a7ee5979d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## Unreleased + +### Fixed + +- Exceptions inside `Widget.compose` or workers weren't bubbling up in tests https://github.com/Textualize/textual/issues/4282 + +### Added + +- Added `Document.start` and `end` location properties for convenience https://github.com/Textualize/textual/pull/4267 + ## [0.54.0] - 2024-03-26 ### Fixed @@ -13,17 +23,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fixed issue with flickering scrollbars https://github.com/Textualize/textual/pull/4315 - Fixed issue where narrow TextArea would repeatedly wrap due to scrollbar appearing/disappearing https://github.com/Textualize/textual/pull/4334 - Fix progress bar ETA not updating when setting `total` reactive https://github.com/Textualize/textual/pull/4316 -- Exceptions inside `Widget.compose` or workers weren't bubbling up in tests https://github.com/Textualize/textual/issues/4282 ### Changed - ProgressBar won't show ETA until there is at least one second of samples https://github.com/Textualize/textual/pull/4316 - `Input` waits until an edit has been made, after entry to the widget, before offering a suggestion https://github.com/Textualize/textual/pull/4335 -### Added - -- Added `Document.start` and `end` location properties for convenience https://github.com/Textualize/textual/pull/4267 - ## [0.53.1] - 2024-03-18 ### Fixed