You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/blog/posts/release1.0.0.md
+6-7Lines changed: 6 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ draft: true
3
3
date: 2024-12-05
4
4
categories:
5
5
- Release
6
-
title: "There can be only one (point zero)"
6
+
title: "Three algorithms for a high performance terminal apps"
7
7
authors:
8
8
- willmcgugan
9
9
---
@@ -19,9 +19,8 @@ I've had the fortune of being able to work fulltime on a FOSS project for the la
19
19
20
20
Textual has been a constant source of programming challenges.
21
21
Often frustrating but never boring, the challenges arise because the terminal "specification" says nothing about how to build a modern User Interface.
22
-
The building blocks are there.
23
-
After some effort you can move the cursor, write colored text, read keys and mouse coordinates, but that's about it.
24
-
Everything else we had to build from scratch: from the most basic [button](https://textual.textualize.io/widget_gallery/#button) to a syntax highlighted [TextArea](https://textual.textualize.io/widget_gallery/#textarea), and everything along the way.
22
+
The building blocks are there: after some effort you can move the cursor, write colored text, read keys and mouse movements, but that's about it.
23
+
Everything else we had to build from scratch, from the most basic [button](https://textual.textualize.io/widget_gallery/#button) to a syntax highlighted [TextArea](https://textual.textualize.io/widget_gallery/#textarea), and everything along the way.
25
24
26
25
I wanted to write-up some of the more interesting solutions we came up with for a while.
27
26
The 1.0 milestone we just passed makes this the perfect time.
@@ -62,7 +61,7 @@ If that were the case, we could use [painter's algorithm](https://en.wikipedia.o
62
61
In other words, sort them back to front and render them as though they were bitmaps.
63
62
64
63
Unfortunately the terminal is *not* a true grid.
65
-
Some characters such as CJK (Chinese, Japanese, and Korean) and many emoji are double the width of latin alphabet characters — which complicates things (to put it mildly).
64
+
Some characters such as those in Asian languages and many emoji are double the width of latin alphabet characters — which complicates things (to put it mildly).
66
65
67
66
Textual's way of handling this is inherited from [Rich](https://github.com/Textualize/rich).
68
67
Anything you print in Rich, first generates a list of [Segments](https://github.com/Textualize/rich/blob/master/rich/segment.py) which consist of a string and associated style.
@@ -168,7 +167,7 @@ Not all of which widgets may be visible in the final view (if they are within a
168
167
169
168
While it is possible to have a widget as small as a single character, I've never found a need for one.
170
169
The closest we get in Textual is a [scrollbar corner](https://textual.textualize.io/api/scrollbar/#textual.scrollbar.ScrollBarCorner);
171
-
a widget which exists to fil the space made when a vertical scrollbar and a horizontal scrollbar meet.
170
+
a widget which exists to fill the space made when a vertical scrollbar and a horizontal scrollbar meet.
172
171
It does nothing because it doesn't need to, but it is powered by an async task like all widgets and can receive input.
173
172
I have often wondered if there could be something useful in there.
174
173
A game perhaps?
@@ -219,7 +218,7 @@ At the end of that process we have a dict that maps every grid coordinate on to
219
218
```
220
219
221
220
This data is cacheable.
222
-
If the widgets don't change position or size, such as the user is *scrolling*, then we can reuse the information.
221
+
If the widgets don't change their position or size such as when user is *scrolling*, then we can reuse the information.
0 commit comments