Skip to content

Commit

Permalink
new release (#3316)
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan authored Sep 15, 2023
1 parent ce32abd commit 4dc8358
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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/).

## Unreleased
## [0.37.0] 2023-09-15

### Added

Expand All @@ -19,7 +19,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- `Screen.sub_title`
- Properties `Header.screen_title` and `Header.screen_sub_title` https://github.com/Textualize/textual/pull/3199
- Added `DirectoryTree.DirectorySelected` message https://github.com/Textualize/textual/issues/3200
- Added `widgets.Collapsible` contributed buy Sunyoung Yoo https://github.com/Textualize/textual/pull/2989
- Added `widgets.Collapsible` contributed by Sunyoung Yoo https://github.com/Textualize/textual/pull/2989

### Fixed

Expand Down Expand Up @@ -1276,6 +1276,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

[0.37.0]: https://github.com/Textualize/textual/compare/v0.36.0...v0.37.0
[0.36.0]: https://github.com/Textualize/textual/compare/v0.35.1...v0.36.0
[0.35.1]: https://github.com/Textualize/textual/compare/v0.35.0...v0.35.1
[0.35.0]: https://github.com/Textualize/textual/compare/v0.34.0...v0.35.0
Expand Down
85 changes: 85 additions & 0 deletions docs/blog/posts/release0.37.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
draft: false
date: 2023-09-15
categories:
- Release
title: "Textual 0.37.0 adds a command palette"
authors:
- willmcgugan
---


# Textual 0.37.0 adds a command palette

Textual version 0.37.0 has landed!
The highlight of these release is the new command palette.

<!-- more -->

A command palette gives users quick access to features in your app.
If you hit ctrl+backslash in a Textual app, it will bring up the command palette where you can start typing commands.
The commands are matched with a *fuzzy* search, so you only need to type two or three characters to get to any command.

Here's a video of it in action:

<div class="video-wrapper">
<iframe width="1280" height="auto" src="https://www.youtube.com/embed/sOMIkjmM4MY" title="" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div>

Adding your own commands to the command palette is a piece of cake.
Here's the (command) Provider class used in the example above:

```python
class ColorCommands(Provider):
"""A command provider to select colors."""

async def search(self, query: str) -> Hits:
"""Called for each key."""
matcher = self.matcher(query)
for color in COLOR_NAME_TO_RGB.keys():
score = matcher.match(color)
if score > 0:
yield Hit(
score,
matcher.highlight(color),
partial(self.app.post_message, SwitchColor(color)),
)
```

And here is how you add a provider to you app:

```python
class ColorApp(App):
"""Experiment with the command palette."""

COMMANDS = App.COMMANDS | {ColorCommands}
```

We're excited about this feature because it is a step towards brining a common user interface to Textual apps.

!!! quote

It's a Textual app. I know this.

&mdash; You, maybe.

The goal is to be able to build apps that may look quite different, but take no time to learn, because once you learn how to use one Textual app, you can use them all.

See the Guide for details on how to work with the [command palette](../../guide/command_palette.md).

## What else?

Also in 0.37.0 we have a new [Collapsible](/widget_gallery/#collapsible) widget, which is a great way of adding content while avoiding a cluttered screen.

And of course, bug fixes and other updates. See the [release](https://github.com/Textualize/textual/releases/tag/v0.37.0) page for the full details.

## What's next?

Coming very soon, is a new TextEditor widget.
This is a super powerful widget to enter arbitrary text, with beautiful syntax highlighting for a number of languages.
We're expecting that to land next week.
Watch this space, or join the [Discord server](https://discord.gg/Enf6Z3qhVr) if you want to be the first to try it out.

## Join us

Join our [Discord server](https://discord.gg/Enf6Z3qhVr) if you want to discuss Textual with the Textualize devs, or the community.
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 = "0.36.0"
version = "0.37.0"
homepage = "https://github.com/Textualize/textual"
repository = "https://github.com/Textualize/textual"
documentation = "https://textual.textualize.io/"
Expand Down

0 comments on commit 4dc8358

Please sign in to comment.