Skip to content

Commit 23ddeb7

Browse files
authored
Merge branch 'main' into fix-header-show-command-palette-tooltip-only-when-enabled
2 parents ddd703b + 61f645c commit 23ddeb7

File tree

428 files changed

+25511
-23124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

428 files changed

+25511
-23124
lines changed

CHANGELOG.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,41 @@ 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-
11-
### Fixed
12-
13-
- Fixed `Pilot.click` not working with `times` parameter https://github.com/Textualize/textual/pull/5398
14-
- Fixed select refocusing itself too late https://github.com/Textualize/textual/pull/5420
15-
- Fixed `Header` icon showing command palette tooltip when disabled https://github.com/Textualize/textual/pull/5427
8+
## Unreleased - 2025
169

1710
### Added
1811

12+
- Added `Select.type_to_search` which allows you to type to move the cursor to a matching option https://github.com/Textualize/textual/pull/5403
1913
- Added `from_app_focus` to `Focus` event to indicate if a widget is being focused because the app itself has regained focus or not https://github.com/Textualize/textual/pull/5379
20-
- - Added `Select.type_to_search` which allows you to type to move the cursor to a matching option https://github.com/Textualize/textual/pull/5403
14+
- Added `Blurred` message to `Input` widget (matching `Submitted` and `Changed`) to make it easier to synchronize with `validate_on` parameter when set to 'blur'.
15+
- Added `Offset.transpose` https://github.com/Textualize/textual/pull/5409
16+
- Added `screen--selection` component class to define style for selection https://github.com/Textualize/textual/pull/5409
17+
- Added `Widget.select_container` property https://github.com/Textualize/textual/pull/5409
18+
- Added `Widget.select_all` https://github.com/Textualize/textual/pull/5409
19+
- Added `Region.bottom_right_inclusive` https://github.com/Textualize/textual/pull/5409
20+
- Added double click to select, triple click to select all in container https://github.com/Textualize/textual/pull/5409
21+
- Added arbitrary text selection https://github.com/Textualize/textual/pull/5409
22+
- Added Widget.ALLOW_SELECT classvar for a per-widget switch to disable text selection https://github.com/Textualize/textual/pull/5409
23+
- Added Widget.allow_select method for programmatic control of text selection https://github.com/Textualize/textual/pull/5409
24+
- Added App.ALLOW_SELECT for a global switch to disable text selection https://github.com/Textualize/textual/pull/5409
25+
- Added `DOMNode.query_ancestor` https://github.com/Textualize/textual/pull/5409
26+
- Added selection to Log widget https://github.com/Textualize/textual/pull/5467
2127

22-
### Changed
28+
### Fixed
2329

30+
- Fixed `Pilot.click` not working with `times` parameter https://github.com/Textualize/textual/pull/5398
31+
- Fixed select refocusing itself too late https://github.com/Textualize/textual/pull/5420
32+
- Fixed layout of the keys in the help panel when a key has a tooltip but no description https://github.com/Textualize/textual/issues/5436
2433
- The content of an `Input` will now only be automatically selected when the widget is focused by the user, not when the app itself has regained focus (similar to web browsers). https://github.com/Textualize/textual/pull/5379
2534
- Updated `TextArea` and `Input` behavior when there is a selection and the user presses left or right https://github.com/Textualize/textual/pull/5400
2635
- Footer can now be scrolled horizontally without holding `shift` https://github.com/Textualize/textual/pull/5404
36+
- Modified _on_blur method in `Input` to post a `Blurred` message
37+
- Fixed `Pilot.click` not working with `times` parameter https://github.com/Textualize/textual/pull/5398
38+
- Fixed select refocusing itself too late https://github.com/Textualize/textual/pull/5420
39+
- Fixed Log widget not refreshing on resize https://github.com/Textualize/textual/pull/5460
40+
- Fixed special case with calculating the height of a container where all children have dynamic heights https://github.com/Textualize/textual/pull/5463
41+
- Fixed scrollbars ignoring background opacity https://github.com/Textualize/textual/issues/5458
42+
- Fixed `Header` icon showing command palette tooltip when disabled https://github.com/Textualize/textual/pull/5427
2743

2844

2945
## [1.0.0] - 2024-12-12
@@ -127,7 +143,7 @@ the selection if there is one, otherwise it will cut the current line https://gi
127143
- Added `Widget.set_scroll` https://github.com/Textualize/textual/pull/5278
128144
- Added `Select.selection` https://github.com/Textualize/textual/pull/5278
129145

130-
### Fixed
146+
### Fixed
131147

132148
- Fixed offset applied to docked widgets https://github.com/Textualize/textual/pull/5264
133149
- Fixed loading widgets responding to input https://github.com/Textualize/textual/pull/5267
@@ -403,7 +419,7 @@ the selection if there is one, otherwise it will cut the current line https://gi
403419

404420
### Changed
405421

406-
- Removed caps_lock and num_lock modifiers https://github.com/Textualize/textual/pull/4861
422+
- Removed caps_lock and num_lock modifiers https://github.com/Textualize/textual/pull/4861
407423
- Keys such as escape and space are now displayed in lower case in footer https://github.com/Textualize/textual/pull/4876
408424
- Changed default command palette binding to `ctrl+p` https://github.com/Textualize/textual/pull/4867
409425
- Removed `ctrl_to_caret` and `upper_case_keys` from Footer. These can be implemented in `App.get_key_display`.
@@ -610,7 +626,7 @@ when an expandable node is selected https://github.com/Textualize/textual/pull/4
610626

611627
### Added
612628

613-
- Added `Screen.is_active`
629+
- Added `Screen.is_active`
614630
- Added `icon` reactive to Header widget https://github.com/Textualize/textual/pull/4627
615631
- Added `time_format` reactive to Header widget https://github.com/Textualize/textual/pull/4627
616632
- Added `tooltip` parameter to input widgets https://github.com/Textualize/textual/pull/4625

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ In addition to serving your apps locally, you can serve apps with [Textual Web](
199199

200200
Textual Web's firewall-busting technology can serve an unlimited number of applications.
201201

202-
Since Textual apps have low system requirements, you can install them anywhere Python also runs. Turning any device in to a connected device.
202+
Since Textual apps have low system requirements, you can install them anywhere Python also runs. Turning any device into a connected device.
203203
No desktop required!
204204

205205

docs/examples/guide/actions/actions05.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
TEXT = """
55
[b]Set your background[/b]
6-
[@click=app.set_background('cyan')]Cyan[/]
7-
[@click=app.set_background('magenta')]Magenta[/]
8-
[@click=app.set_background('yellow')]Yellow[/]
6+
[@click=set_background('cyan')]Cyan[/]
7+
[@click=set_background('magenta')]Magenta[/]
8+
[@click=set_background('yellow')]Yellow[/]
99
"""
1010

1111

docs/examples/guide/widgets/checker04.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def get_square_region(square_offset: Offset) -> Region:
5252
"""Get region relative to widget from square coordinate."""
5353
x, y = square_offset
5454
region = Region(x * 8, y * 4, 8, 4)
55-
# Move the region in to the widgets frame of reference
55+
# Move the region into the widgets frame of reference
5656
region = region.translate(-self.scroll_offset)
5757
return region
5858

docs/guide/app.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# App Basics
22

3-
In this chapter we will cover how to use Textual's App class to create an application. Just enough to get you up to speed. We will go in to more detail in the following chapters.
3+
In this chapter we will cover how to use Textual's App class to create an application. Just enough to get you up to speed. We will go into more detail in the following chapters.
44

55
## The App class
66

@@ -30,7 +30,7 @@ If we run this app with `python simple02.py` you will see a blank terminal, some
3030
```{.textual path="docs/examples/app/simple02.py"}
3131
```
3232

33-
When you call [App.run()][textual.app.App.run] Textual puts the terminal in to a special state called *application mode*. When in application mode the terminal will no longer echo what you type. Textual will take over responding to user input (keyboard and mouse) and will update the visible portion of the terminal (i.e. the *screen*).
33+
When you call [App.run()][textual.app.App.run] Textual puts the terminal into a special state called *application mode*. When in application mode the terminal will no longer echo what you type. Textual will take over responding to user input (keyboard and mouse) and will update the visible portion of the terminal (i.e. the *screen*).
3434

3535
If you hit ++ctrl+q++ Textual will exit application mode and return you to the command prompt. Any content you had in the terminal prior to application mode will be restored.
3636

@@ -42,7 +42,7 @@ If you hit ++ctrl+q++ Textual will exit application mode and return you to the c
4242

4343
!!! tip "Added in version 0.55.0"
4444

45-
You can also run apps in _inline_ mode, which will cause the app to appear beneath the prompt (and won't go in to application mode).
45+
You can also run apps in _inline_ mode, which will cause the app to appear beneath the prompt (and won't go into application mode).
4646
Inline apps are useful for tools that integrate closely with the typical workflow of a terminal.
4747

4848
To run an app in inline mode set the `inline` parameter to `True` when you call [App.run()][textual.app.App.run]. See [Style Inline Apps](../how-to/style-inline-apps.md) for how to apply additional styles to inline apps.

docs/guide/devtools.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ textual run -c textual colors
6262
## Serve
6363

6464
The devtools can also serve your application in a browser.
65-
Effectively turning your terminal app in to a web application!
65+
Effectively turning your terminal app into a web application!
6666

6767
The `serve` sub-command is similar to `run`. Here's how you can serve an app launched from a Python file:
6868

@@ -144,7 +144,7 @@ textual console -v
144144

145145
### Decreasing verbosity
146146

147-
Log messages are classififed in to groups, and the `-x` flag can be used to **exclude** all message from a group. The groups are: `EVENT`, `DEBUG`, `INFO`, `WARNING`, `ERROR`, `PRINT`, `SYSTEM`, `LOGGING` and `WORKER`. The group a message belongs to is printed after its timestamp.
147+
Log messages are classififed into groups, and the `-x` flag can be used to **exclude** all message from a group. The groups are: `EVENT`, `DEBUG`, `INFO`, `WARNING`, `ERROR`, `PRINT`, `SYSTEM`, `LOGGING` and `WORKER`. The group a message belongs to is printed after its timestamp.
148148

149149
Multiple groups may be excluded, for example to exclude everything except warning, errors, and `print` statements:
150150

docs/guide/events.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This processing of messages is done within an asyncio Task which is started when
2020

2121
The FastAPI docs have an [excellent introduction](https://fastapi.tiangolo.com/async/) to Python async programming.
2222

23-
By way of an example, let's consider what happens if you were to type "Text" in to a `Input` widget. When you hit the ++t++ key, Textual creates a [key][textual.events.Key] event and sends it to the widget's message queue. Ditto for ++e++, ++x++, and ++t++.
23+
By way of an example, let's consider what happens if you were to type "Text" into a `Input` widget. When you hit the ++t++ key, Textual creates a [key][textual.events.Key] event and sends it to the widget's message queue. Ditto for ++e++, ++x++, and ++t++.
2424

2525
The widget's task will pick the first message from the queue (a key event for the ++t++ key) and call the `on_key` method with the event as the first argument. In other words it will call `Input.on_key(event)`, which updates the display to show the new letter.
2626

@@ -334,4 +334,4 @@ Let's look at an example which looks up word definitions from an [api](https://d
334334
```{.textual path="docs/examples/events/dictionary.py"}
335335
```
336336

337-
Note the highlighted line in the above code which calls `asyncio.create_task` to run a coroutine in the background. Without this you would find typing in to the text box to be unresponsive.
337+
Note the highlighted line in the above code which calls `asyncio.create_task` to run a coroutine in the background. Without this you would find typing into the text box to be unresponsive.

docs/guide/input.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ The following example shows how focus works in practice.
105105
```{.textual path="docs/examples/guide/input/key03.py", press="H,e,l,l,o,tab,W,o,r,l,d,!"}
106106
```
107107

108-
The app splits the screen in to quarters, with a `RichLog` widget in each quarter. If you click any of the text logs, you should see that it is highlighted to show that the widget has focus. Key events will be sent to the focused widget only.
108+
The app splits the screen into quarters, with a `RichLog` widget in each quarter. If you click any of the text logs, you should see that it is highlighted to show that the widget has focus. Key events will be sent to the focused widget only.
109109

110110
!!! tip
111111

@@ -255,4 +255,4 @@ Most mice have a scroll wheel which you can use to scroll the window underneath
255255

256256
!!! information
257257

258-
Terminal emulators will typically convert trackpad gestures in to scroll events.
258+
Terminal emulators will typically convert trackpad gestures into scroll events.

docs/guide/reactivity.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ The following example modifies "refresh01.py" so that the greeting has an automa
134134
```{.textual path="docs/examples/guide/reactivity/refresh02.py" press="n,a,m,e"}
135135
```
136136

137-
If you type in to the input now, the greeting will expand to fit the content. If you were to set `layout=False` on the reactive attribute, you should see that the box remains the same size when you type.
137+
If you type into the input now, the greeting will expand to fit the content. If you were to set `layout=False` on the reactive attribute, you should see that the box remains the same size when you type.
138138

139139
## Validation
140140

@@ -171,7 +171,7 @@ Watch method names begin with `watch_` followed by the name of the attribute, an
171171
If the method accepts a single argument, it will be called with the new assigned value.
172172
If the method accepts *two* positional arguments, it will be called with both the *old* value and the *new* value.
173173

174-
The following app will display any color you type in to the input. Try it with a valid color in Textual CSS. For example `"darkorchid"` or `"#52de44"`.
174+
The following app will display any color you type into the input. Try it with a valid color in Textual CSS. For example `"darkorchid"` or `"#52de44"`.
175175

176176
=== "watch01.py"
177177

@@ -311,15 +311,15 @@ Compute methods are the final superpower offered by the `reactive` descriptor. T
311311

312312
You could be forgiven in thinking this sounds a lot like Python's property decorator. The difference is that Textual will cache the value of compute methods, and update them when any other reactive attribute changes.
313313

314-
The following example uses a computed attribute. It displays three inputs for each color component (red, green, and blue). If you enter numbers in to these inputs, the background color of another widget changes.
314+
The following example uses a computed attribute. It displays three inputs for each color component (red, green, and blue). If you enter numbers into these inputs, the background color of another widget changes.
315315

316316
=== "computed01.py"
317317

318318
```python hl_lines="25-26 28-29"
319319
--8<-- "docs/examples/guide/reactivity/computed01.py"
320320
```
321321

322-
1. Combines color components in to a Color object.
322+
1. Combines color components into a Color object.
323323
2. The watch method is called when the _result_ of `compute_color` changes.
324324

325325
=== "computed01.tcss"

docs/guide/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Knowing which test has failed will help you quickly track down where your code w
9191
## Simulating key presses
9292

9393
We've seen how the [`press`][textual.pilot.Pilot] method simulates keys.
94-
You can also supply multiple keys to simulate the user typing in to the app.
94+
You can also supply multiple keys to simulate the user typing into the app.
9595
Here's an example of simulating the user typing the word "hello".
9696

9797
```python

0 commit comments

Comments
 (0)