Skip to content

Commit cce6e7c

Browse files
committed
snapshot
1 parent 8f9aa3a commit cce6e7c

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
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+
## Unreleased
9+
10+
### Added
11+
12+
- Added a 'stream' layout, which is a lot like vertical but with fewer supported rules (which is why it is faster)
13+
814
## [5.1.1] - 2025-07-21
915

1016
### Fixed

src/textual/layouts/stream.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def arrange(
3333
placements: list[WidgetPlacement] = []
3434
width = size.width
3535
first_child_styles = children[0].styles
36-
y = first_child_styles.margin.top
37-
previous_margin = 0
36+
y = 0
37+
previous_margin = first_child_styles.margin.top
3838
null_offset = NULL_OFFSET
3939

4040
for widget in children:

tests/snapshot_tests/test_snapshots.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4505,11 +4505,19 @@ def compose(self) -> ComposeResult:
45054505

45064506

45074507
def test_stream_layout(snap_compare):
4508-
"""Test stream layout."""
4508+
"""Test stream layout.
4509+
4510+
You should see 3 blue labels.
4511+
The topmost should be a single line.
4512+
The middle should be two lines.
4513+
The last should be three lines.
4514+
There will be a one character margin between them.
4515+
4516+
"""
45094517

45104518
class StreamApp(App):
45114519
CSS = """
4512-
VerticalScroll {
4520+
VerticalScroll {
45134521
layout: stream;
45144522
Label {
45154523
background: blue;

0 commit comments

Comments
 (0)