Skip to content

Commit 563b119

Browse files
authored
Merge pull request #4957 from Textualize/fix-tutorial-cp
Fix non active screen updates
2 parents 94cde8a + 86ab34e commit 563b119

File tree

7 files changed

+24
-6
lines changed

7 files changed

+24
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [0.79.1] - 2024-08-31
9+
10+
### Fixed
11+
12+
- Fixed broken updates when non active screen changes https://github.com/Textualize/textual/pull/4957
13+
814
## [0.79.0] - 2024-08-30
915

1016
### Added

docs/tutorial.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ Here's what the finished app will look like:
3131
```{.textual path="docs/examples/tutorial/stopwatch.py" title="stopwatch.py" press="tab,enter,tab,enter,tab,enter,tab,enter"}
3232
```
3333

34+
!!! info
35+
36+
Did you notice the `^p palette` at the bottom right hand corner?
37+
This is the [Command Palette](./guide/command_palette.md).
38+
You can think of it as a dedicated command prompt for your app.
39+
3440
### Try it out!
3541

3642
The following is *not* a screenshot, but a fully interactive Textual app running in your browser.

examples/dictionary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class DictionaryApp(App):
1818
CSS_PATH = "dictionary.tcss"
1919

2020
def compose(self) -> ComposeResult:
21-
yield Input(placeholder="Search for a word")
21+
yield Input(placeholder="Search for a word", id="dictionary-search")
2222
with VerticalScroll(id="results-container"):
2323
yield Markdown(id="results")
2424

examples/dictionary.tcss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Screen {
22
background: $panel;
33
}
44

5-
Input {
5+
Input#dictionary-search {
66
dock: top;
77
margin: 1 0;
88
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "textual"
3-
version = "0.79.0"
3+
version = "0.79.1"
44
homepage = "https://github.com/Textualize/textual"
55
repository = "https://github.com/Textualize/textual"
66
documentation = "https://textual.textualize.io/"

src/textual/screen.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,8 +935,9 @@ def _compositor_refresh(self) -> None:
935935
elif (
936936
self in self.app._background_screens and self._compositor._dirty_regions
937937
):
938-
# Background screen
938+
self._set_dirty(*self._compositor._dirty_regions)
939939
app.screen.refresh(*self._compositor._dirty_regions)
940+
self._repaint_required = True
940941
self._compositor._dirty_regions.clear()
941942
self._dirty_widgets.clear()
942943
app._update_mouse_over(self)
@@ -1097,6 +1098,7 @@ async def _on_update(self, message: messages.Update) -> None:
10971098
message.prevent_default()
10981099
widget = message.widget
10991100
assert isinstance(widget, Widget)
1101+
11001102
self._dirty_widgets.add(widget)
11011103
self.check_idle()
11021104

tests/snapshot_tests/test_snapshots.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,10 +1460,14 @@ def test_system_commands(snap_compare):
14601460

14611461
class SimpleApp(App):
14621462
def compose(self) -> ComposeResult:
1463-
yield Input()
1463+
input = Input()
1464+
input.cursor_blink = False
1465+
yield input
14641466

1467+
app = SimpleApp()
1468+
app.animation_level = "none"
14651469
assert snap_compare(
1466-
SimpleApp(),
1470+
app,
14671471
terminal_size=(100, 30),
14681472
press=["ctrl+p"],
14691473
)

0 commit comments

Comments
 (0)