Skip to content
Merged

blank #6318

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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).

## [7.1.0] - 2026-01-10

### Fixed

- Fixed issue with missing refresh

### Added

- Added Widget.BLANK which can optimize rendering of large widgets (typically containers that scroll)

## [7.0.3] - 2026-01-09

### Fixed
Expand Down Expand Up @@ -3290,6 +3300,7 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
- New handler system for messages that doesn't require inheritance
- Improved traceback handling

[7.1.0]: https://github.com/Textualize/textual/compare/v7.0.3...v7.1.0
[7.0.3]: https://github.com/Textualize/textual/compare/v7.0.2...v7.0.3
[7.0.2]: https://github.com/Textualize/textual/compare/v7.0.1...v7.0.2
[7.0.1]: https://github.com/Textualize/textual/compare/v7.0.0...v7.0.1
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "textual"
version = "7.0.3"
version = "7.1.0"
homepage = "https://github.com/Textualize/textual"
repository = "https://github.com/Textualize/textual"
documentation = "https://textual.textualize.io/"
Expand Down
1 change: 1 addition & 0 deletions src/textual/strip.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def link_ids(self) -> set[str]:
return self._link_ids

@classmethod
@lru_cache(maxsize=1024)
def blank(cls, cell_length: int, style: StyleType | None = None) -> Strip:
"""Create a blank strip.

Expand Down
8 changes: 8 additions & 0 deletions src/textual/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ class Widget(DOMNode):
}
"""
COMPONENT_CLASSES: ClassVar[set[str]] = set()
"""A set of component classes."""

BORDER_TITLE: ClassVar[str] = ""
"""Initial value for border_title attribute."""
Expand All @@ -329,6 +330,9 @@ class Widget(DOMNode):
FOCUS_ON_CLICK: ClassVar[bool] = True
"""Should focusable widgets be automatically focused on click? Default return value of [Widget.focus_on_click][textual.widget.Widget.focus_on_click]."""

BLANK: ClassVar[bool] = False
"""Is this widget blank (no border, no content)? Enable for very large scrolling containers."""

can_focus: bool = False
"""Widget may receive focus."""
can_focus_children: bool = True
Expand Down Expand Up @@ -2646,6 +2650,7 @@ def _set_dirty(self, *regions: Region) -> None:
self._dirty_regions.clear()
self._repaint_regions.clear()
self._styles_cache.clear()
self._styles_cache.set_dirty(self.size.region)
outer_size = self.outer_size
self._dirty_regions.add(outer_size.region)
if outer_size:
Expand Down Expand Up @@ -4187,6 +4192,9 @@ def render_line(self, y: int) -> Strip:
Returns:
A rendered line.
"""
if self.BLANK:
return Strip.blank(self.size.width, self.visual_style.rich_style)

if self._dirty_regions:
self._render_content()
try:
Expand Down
Loading