From af80839a2037ed103197260c102bebc3d508af6b Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sat, 31 Aug 2024 17:14:34 +0100 Subject: [PATCH 1/3] changelog --- CHANGELOG.md | 6 ++++++ docs/tutorial.md | 6 ++++++ examples/dictionary.py | 2 +- examples/dictionary.tcss | 2 +- src/textual/screen.py | 4 +++- tests/snapshot_tests/test_snapshots.py | 8 ++++++-- 6 files changed, 23 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2163dbf8b..d76dd8a7d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ 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.79.1] - 2024-08-31 + +### Fixed + +- Fixed broken updates when non active screen changes + ## [0.79.0] - 2024-08-30 ### Added diff --git a/docs/tutorial.md b/docs/tutorial.md index ce7ed15d5a..57c369d448 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -31,6 +31,12 @@ Here's what the finished app will look like: ```{.textual path="docs/examples/tutorial/stopwatch.py" title="stopwatch.py" press="tab,enter,tab,enter,tab,enter,tab,enter"} ``` +!!! info + + Did you notice the `^p palette` at the bottom right hand corner? + This is the [Command Palette](./guide/command_palette.md). + You can think of it as a dedicated command prompt for your app. + ### Try it out! The following is *not* a screenshot, but a fully interactive Textual app running in your browser. diff --git a/examples/dictionary.py b/examples/dictionary.py index 4965507482..64c98d3790 100644 --- a/examples/dictionary.py +++ b/examples/dictionary.py @@ -18,7 +18,7 @@ class DictionaryApp(App): CSS_PATH = "dictionary.tcss" def compose(self) -> ComposeResult: - yield Input(placeholder="Search for a word") + yield Input(placeholder="Search for a word", id="dictionary-search") with VerticalScroll(id="results-container"): yield Markdown(id="results") diff --git a/examples/dictionary.tcss b/examples/dictionary.tcss index 301336a73e..a5ad5c777b 100644 --- a/examples/dictionary.tcss +++ b/examples/dictionary.tcss @@ -2,7 +2,7 @@ Screen { background: $panel; } -Input { +Input#dictionary-search { dock: top; margin: 1 0; } diff --git a/src/textual/screen.py b/src/textual/screen.py index 6f6ac8aeaa..7697e38f20 100644 --- a/src/textual/screen.py +++ b/src/textual/screen.py @@ -935,8 +935,9 @@ def _compositor_refresh(self) -> None: elif ( self in self.app._background_screens and self._compositor._dirty_regions ): - # Background screen + self._set_dirty(*self._compositor._dirty_regions) app.screen.refresh(*self._compositor._dirty_regions) + self._repaint_required = True self._compositor._dirty_regions.clear() self._dirty_widgets.clear() app._update_mouse_over(self) @@ -1097,6 +1098,7 @@ async def _on_update(self, message: messages.Update) -> None: message.prevent_default() widget = message.widget assert isinstance(widget, Widget) + self._dirty_widgets.add(widget) self.check_idle() diff --git a/tests/snapshot_tests/test_snapshots.py b/tests/snapshot_tests/test_snapshots.py index 54ba6ecdfb..864f80e3fe 100644 --- a/tests/snapshot_tests/test_snapshots.py +++ b/tests/snapshot_tests/test_snapshots.py @@ -1460,10 +1460,14 @@ def test_system_commands(snap_compare): class SimpleApp(App): def compose(self) -> ComposeResult: - yield Input() + input = Input() + input.cursor_blink = False + yield input + app = SimpleApp() + app.animation_level = "none" assert snap_compare( - SimpleApp(), + app, terminal_size=(100, 30), press=["ctrl+p"], ) From a3880f8b91e0b117fc49d842671112fa208a7065 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sat, 31 Aug 2024 17:16:01 +0100 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d76dd8a7d2..faefa5a9b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Fixed -- Fixed broken updates when non active screen changes +- Fixed broken updates when non active screen changes https://github.com/Textualize/textual/pull/4957 ## [0.79.0] - 2024-08-30 From 86ab34e2e615b1b5f395f23d2817a4a79f140e74 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sat, 31 Aug 2024 17:17:03 +0100 Subject: [PATCH 3/3] bump --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cf203121f1..c704952ac4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "textual" -version = "0.79.0" +version = "0.79.1" homepage = "https://github.com/Textualize/textual" repository = "https://github.com/Textualize/textual" documentation = "https://textual.textualize.io/"