Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Fixed issue where Segments with a style of `None` aren't rendered https://github.com/Textualize/textual/pull/6109
- Fixed visual glitches and crash when changing `DataTable.header_height` https://github.com/Textualize/textual/pull/6128
- Fixed TextArea.placeholder not handling multi-lines https://github.com/Textualize/textual/pull/6138
- Fixed issue with RichLog when App.theme is set early https://github.com/Textualize/textual/pull/6141

## [6.1.0] - 2025-08-01

Expand Down
5 changes: 3 additions & 2 deletions src/textual/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3657,8 +3657,9 @@ def refresh_css(self, animate: bool = True) -> None:
stylesheet.reparse()
stylesheet.update(self.app, animate=animate)
try:
self.screen._refresh_layout(self.size)
self.screen._css_update_count = self._css_update_count
if self.screen.is_mounted:
self.screen._refresh_layout(self.size)
self.screen._css_update_count = self._css_update_count
except ScreenError:
pass
# The other screens in the stack will need to know about some style
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions tests/snapshot_tests/test_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -4654,3 +4654,25 @@ def compose(self) -> ComposeResult:
yield TextArea(placeholder=TEXT)

assert snap_compare(PlaceholderApp())


def test_rich_log_early_write(snap_compare) -> None:
"""Regression test for https://github.com/Textualize/textual/issues/6123

You should see a RichLog with "Hello World" text

"""

class TestApp(App):
def compose(self) -> ComposeResult:
with Horizontal():
yield RichLog()

def on_mount(self) -> None:
self.theme = "nord"

def on_ready(self) -> None:
log_widget = self.query_one(RichLog)
log_widget.write("Hello, World!")

assert snap_compare(TestApp())
Loading