Skip to content

Commit 053bcda

Browse files
committed
Merge branch 'main' of github.com:Textualize/textual into command-palette-dont-select-on-focus
2 parents afb1d0b + f888e6a commit 053bcda

29 files changed

+1674
-79
lines changed

CHANGELOG.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,22 @@ 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
8+
## [1.0.0] - 2024-12-12
99

1010
### Added
1111

1212
- Added `App.clipboard` https://github.com/Textualize/textual/pull/5352
13-
- Added standard cut/copy/paste (ctrl+x, ctrl+c, ctrl+v) bindings to Input / TextArea https://github.com/Textualize/textual/pull/5352
13+
- Added standard cut/copy/paste (ctrl+x, ctrl+c, ctrl+v) bindings to Input / TextArea https://github.com/Textualize/textual/pull/5352 & https://github.com/Textualize/textual/pull/5374
1414
- Added `system` boolean to Binding, which hides the binding from the help panel https://github.com/Textualize/textual/pull/5352
15+
- Added support for double/triple/etc clicks via `chain` attribute on `Click` events https://github.com/Textualize/textual/pull/5369
16+
- Added `times` parameter to `Pilot.click` method, for simulating rapid clicks https://github.com/Textualize/textual/pull/5369
1517

1618
### Changed
1719

18-
- Change default quit key to `ctrl+q` https://github.com/Textualize/textual/pull/5352
19-
- Changed delete line binding on TextArea to use `ctrl+shift+x` https://github.com/Textualize/textual/pull/5352
20+
- Breaking change: Change default quit key to `ctrl+q` https://github.com/Textualize/textual/pull/5352
2021
- The command palette will now select the top item automatically https://github.com/Textualize/textual/pull/5361
22+
- `ctrl+shift+k` now deletes the current line in `TextArea`, and `ctrl+x` will cut
23+
the selection if there is one, otherwise it will cut the current line https://github.com/Textualize/textual/pull/5374
2124
- Implemented a better matching algorithm for the command palette https://github.com/Textualize/textual/pull/5365
2225

2326
### Fixed
@@ -384,6 +387,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
384387
- Removed `ctrl_to_caret` and `upper_case_keys` from Footer. These can be implemented in `App.get_key_display`.
385388
- Renamed `SystemCommands` to `SystemCommandsProvider` https://github.com/Textualize/textual/pull/4920
386389
- Breaking change: Removed `ClassicFooter` widget (please use new `Footer` widget) https://github.com/Textualize/textual/pull/4921
390+
- Breaking change: `App.get_key_display` now requires `textual.binding.Binding` instead of `str`.
387391
- Disallowed `Screen` instances in `App.SCREENS` and `App.MODES`
388392

389393
### Fixed
@@ -2664,6 +2668,7 @@ https://textual.textualize.io/blog/2022/11/08/version-040/#version-040
26642668
- New handler system for messages that doesn't require inheritance
26652669
- Improved traceback handling
26662670

2671+
[1.0.0]: https://github.com/Textualize/textual/compare/v0.89.1...v1.0.0
26672672
[0.89.1]: https://github.com/Textualize/textual/compare/v0.89.0...v0.89.1
26682673
[0.89.0]: https://github.com/Textualize/textual/compare/v0.88.1...v0.89.0
26692674
[0.88.1]: https://github.com/Textualize/textual/compare/v0.88.0...v0.88.1

README.md

Lines changed: 83 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,56 @@
1111

1212
# Textual
1313

14-
Build cross-platform user interfaces with a simple Python API.
14+
<img align="right" width="250" alt="clock" src="https://github.com/user-attachments/assets/63e839c3-5b8e-478d-b78e-cf7647eb85e8" />
1515

16-
Run your apps in the terminal *or* a web browser.
16+
Build cross-platform user interfaces with a simple Python API. Run your apps in the terminal *or* a web browser.
1717

18+
Textual's API combines modern Python with the best of developments from the web world, for a lean app development experience.
19+
De-coupled components and an advanced [testing](https://textual.textualize.io/guide/testing/) framework ensure you can maintain your app for the long-term.
20+
21+
Want some more examples? See the [examples](https://github.com/Textualize/textual/tree/main/examples) directory.
22+
23+
```python
24+
"""
25+
An App to show the current time.
26+
"""
27+
28+
from datetime import datetime
29+
30+
from textual.app import App, ComposeResult
31+
from textual.widgets import Digits
32+
33+
34+
class ClockApp(App):
35+
CSS = """
36+
Screen { align: center middle; }
37+
Digits { width: auto; }
38+
"""
39+
40+
def compose(self) -> ComposeResult:
41+
yield Digits("")
42+
43+
def on_ready(self) -> None:
44+
self.update_clock()
45+
self.set_interval(1, self.update_clock)
46+
47+
def update_clock(self) -> None:
48+
clock = datetime.now().time()
49+
self.query_one(Digits).update(f"{clock:%T}")
50+
51+
52+
if __name__ == "__main__":
53+
app = ClockApp()
54+
app.run()
55+
```
56+
57+
> [!TIP]
58+
> Textual is an asynchronous framework under the hood. Which means you can integrate your apps with async libraries &mdash; if you want to.
59+
> If you don't want or need to use async, Textual won't force it on you.
60+
61+
62+
63+
<img src="https://img.spacergif.org/spacer.gif" width="1" height="64"/>
1864

1965
## Widgets
2066

@@ -78,6 +124,7 @@ Predefined themes ensure your apps will look good out of the box.
78124
</table>
79125

80126

127+
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
81128

82129
## Installing
83130

@@ -90,6 +137,8 @@ pip install textual textual-dev
90137
See [getting started](https://textual.textualize.io/getting_started/) for details.
91138

92139

140+
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
141+
93142
## Demo
94143

95144

@@ -105,32 +154,57 @@ Or try the [textual demo](https://github.com/textualize/textual-demo) *without*
105154
uvx --python 3.12 textual-demo
106155
```
107156

157+
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
108158

109-
## Textual ❤️ Web
159+
## Dev Console
110160

111-
<img align="right" width="40%" alt="textual-serve" src="https://github.com/user-attachments/assets/a25820fb-87ae-433a-858b-ac3940169242">
161+
<img align="right" width="40%" alt="devtools" src="https://github.com/user-attachments/assets/12c60d65-e342-4b2f-9372-bae0459a7552" />
162+
163+
164+
How do you debug an app in the terminal that is also running in the terminal?
165+
166+
The `textual-dev` package supplies a dev console that connects to your application from another terminal.
167+
In addition to system messages and events, your logged messages and print statements will appear in the dev console.
168+
169+
See [the guide](https://textual.textualize.io/guide/devtools/) for other helpful tools provided by the `textual-dev` package.
170+
171+
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
172+
173+
## Command Palette
112174

113175

114-
Textual apps are equally at home in the browser as they are the terminal.
176+
Textual apps have a *fuzzy search* command palette.
177+
Hit `ctrl+p` to open the command palette.
115178

116-
Any Textual app may be served with `textual serve` &mdash; so you can share your creations on the web.
179+
It is easy to extend the command palette with [custom commands](https://textual.textualize.io/guide/command_palette/) for your application.
117180

181+
182+
![Command Palette](https://github.com/user-attachments/assets/94d8ec5d-b668-4033-a5cb-bf820e1b8d60)
183+
184+
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
185+
186+
# Textual ❤️ Web
187+
188+
<img align="right" width="40%" alt="textual-serve" src="https://github.com/user-attachments/assets/a25820fb-87ae-433a-858b-ac3940169242">
189+
190+
191+
Textual apps are equally at home in the browser as they are the terminal. Any Textual app may be served with `textual serve` &mdash; so you can share your creations on the web.
118192
Here's how to serve the demo app:
119193

120194
```
121195
textual serve "python -m textual"
122196
```
123197

124-
In addition to serving your apps locally, you can serve apps with [Textual-Web](https://github.com/Textualize/textual-web).
198+
In addition to serving your apps locally, you can serve apps with [Textual Web](https://github.com/Textualize/textual-web).
125199

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

128202
Since Textual apps have low system requirements, you can install them anywhere Python also runs. Turning any device in to a connected device.
129203
No desktop required!
130204

131-
## Documentation
132205

133-
Head over to the [Textual documentation](http://textual.textualize.io/) to start building.
206+
<img src="https://img.spacergif.org/spacer.gif" width="1" height="32"/>
207+
134208

135209
## Join us on Discord
136210

Lines changed: 21 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)