Rodrigo Girão Serrão
297549c7d8
V2 of input suggestions API.
2023-05-23 10:47:22 +01:00
Rodrigo Girão Serrão
75606c8dfd
Add explicit sleep.
2023-05-18 16:11:02 +01:00
Rodrigo Girão Serrão
97f30a21fb
Add tests.
2023-05-18 14:50:28 +01:00
Rodrigo Girão Serrão
bfdaf02f66
Add snapshot test.
2023-05-18 14:26:32 +01:00
Rodrigo Girão Serrão
03a43521dd
Fix test.
2023-05-18 14:02:51 +01:00
Rodrigo Girão Serrão
0c520f13ce
Change naming.
2023-05-18 13:58:59 +01:00
Rodrigo Girão Serrão
f464241fd6
Implement auto-completion.
2023-05-18 13:41:37 +01:00
Will McGugan
49e1080279
update howto
2023-05-18 10:03:26 +01:00
Will McGugan
8fd5aec454
fix layout
2023-05-18 09:28:33 +01:00
Will McGugan
ff5665051b
Release0250 ( #2598 )
...
* version bump
* changelog
v0.25.0
2023-05-17 16:30:36 +01:00
Rodrigo Girão Serrão
a9c8b59df5
Use default string on error inside work. ( #2595 )
...
Related issues #2588 .
2023-05-17 16:27:32 +01:00
Dave Pearson
84de8a8949
Typo fix ( #2596 )
2023-05-17 16:26:33 +01:00
darrenburns
e25c6290ba
Add classes to Tab widget ( #2589 )
...
* Add classes to Tab widget
* Update CHANGELOG
2023-05-17 16:21:32 +01:00
Dave Pearson
7ff205bc29
Merge pull request #2545 from davep/directory-tree-work-in-worker
...
Load `DirectoryTree` contents in a worker
2023-05-17 15:42:51 +01:00
Rodrigo Girão Serrão
179a85058e
Merge pull request #2581 from Textualize/auto-focus-improv
...
AUTO_FOCUS targets first focusable widget.
2023-05-17 15:32:08 +01:00
Will McGugan
f820598846
How to ( #2592 )
...
* words
* how to
* Apply suggestions from code review
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com >
* Apply suggestions from code review
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com >
* Apply suggestions from code review
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com >
* Apply suggestions from code review
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com >
---------
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com >
2023-05-17 15:30:31 +01:00
Dave Pearson
abbffbfa6a
Code tidy
...
As per https://github.com/Textualize/textual/pull/2545#discussion_r1196591147
2023-05-17 15:30:13 +01:00
Dave Pearson
e381c26165
Create a single method for adding a node to the load queue
...
In doing so fix an issue where, after the previous change, I wasn't marking
the root of the tree as loaded.
2023-05-17 15:27:01 +01:00
Dave Pearson
522d56c601
Be more optimistic about when the node content is loaded
...
As per https://github.com/Textualize/textual/pull/2545#discussion_r1196589864
2023-05-17 15:21:38 +01:00
Dave Pearson
86bee6c495
Rename _to_load to _load_queue
...
As per https://github.com/Textualize/textual/pull/2545#discussion_r1196580316
2023-05-17 15:17:05 +01:00
Dave Pearson
2a91e13ca3
Mark each load task as done when it's done
2023-05-17 14:45:08 +01:00
Dave Pearson
3f6472823e
Merge branch 'main' into directory-tree-work-in-worker
2023-05-17 14:19:59 +01:00
Dave Pearson
dadd7c0a14
Guard against PermissionError
...
Normally it's not a great idea to eat and hide exceptions within library
code; but I think it makes sense to make an exception here. This is a UI
element that lets the user navigate about a filesystem. If there is
something they don't have permission for, that should not cause an
exception, it should just give up with the best possible outcome.
If actually doing something with the exception is important, the developer
using this could use the filter to do tests and act accordingly.
See #2564 .
2023-05-17 14:13:52 +01:00
Dave Pearson
c04bbd1e2e
Ensure the loader kicks off when starting up with . as the directory
2023-05-17 13:41:58 +01:00
Dave Pearson
26e6dbbfa3
Swap to a dual-working approach
...
Plan C; or is it plan D? Something like that. Anyway... in this approach we
keep a single "forever" async task worker per directory tree, which in turn
looks at the async Queue, and when a new node appears on it it starts a
short-lived thread to load the directory data.
This seems to be working fine on macOS. Next up is testing on Windows.
2023-05-17 13:28:07 +01:00
Dave Pearson
ecde90b1c3
Remove unused import
...
The code that was using this was removed earlier.
2023-05-17 12:29:36 +01:00
Dave Pearson
a42250daa3
async Queue get blocks when empty, so don't handle empty exception
2023-05-17 12:29:03 +01:00
Rodrigo Girão Serrão
38f9500642
Fix test.
2023-05-17 11:35:10 +01:00
Dave Pearson
82924c2d7c
Make the main load worker into a asyncio task
...
Turns out, there's a maximum number of threads you can have going in the
underlying pool, that's tied to the number of CPUs. As such, there was a
limit on how many directory trees you could have up and running before it
would start to block all sorts of operations in the surrounding
application (in Parallels on macOS, with the Windows VM appearing to have
just the one CPU, it would give up after 8 directory trees).
So here we move to a slightly different approach: have the main loader still
run "forever", but be an async task; it then in turn farms the loading out
to threads which close once the loading is done.
So far tested on macOS and behaves as expected. Next to test on Windows.
2023-05-17 11:34:05 +01:00
Dave Pearson
64d9c60267
Revert experimental code
2023-05-17 11:26:33 +01:00
Dave Pearson
6876a041a4
More Windows thread oddness experimenting
2023-05-17 11:02:04 +01:00
Dave Pearson
80d00ce4bf
Logging and experimenting for Windows
2023-05-17 10:49:46 +01:00
Rodrigo Girão Serrão
dea133d357
Merge branch 'main' into auto-focus-improv
2023-05-17 10:28:54 +01:00
Rodrigo Girão Serrão
45686c8aca
Fix tests.
2023-05-17 10:27:57 +01:00
Rodrigo Girão Serrão
8399a31a46
Post ScreenResume to default screen.
...
When the default screen is first created it was not getting the event ScreenResume. All other screens receive a ScreenResume when first created and _all_ screens (the default one and custom screens) receive this event when they become the active screen again, so this was kind of an edge case that needed the event to be posted by hand.
Related comments: https://github.com/Textualize/textual/pull/2581\#issuecomment-1550231559
2023-05-17 10:09:52 +01:00
Rodrigo Girão Serrão
765c7ce037
Simplify auto focus code.
...
Related comments: https://github.com/Textualize/textual/pull/2581\#discussion_r1195595104 .
2023-05-17 10:01:01 +01:00
Will McGugan
c12fa0e4da
fix for dark switch ( #2585 )
2023-05-17 07:44:36 +01:00
Glenn McAllister
8753aa5ed0
Update poetry-core requirement ( #2572 )
...
Related issues: #2562
2023-05-16 21:36:24 +01:00
Will McGugan
53e765f7d6
Avoid docks when scrolling ( #2571 )
...
* handle docked layers
* handle scroll better
* snapshot update
* remove commented out code
* superflous
* dock gutter
* snapshit
* snapshit test
* changelog
* mistake
* docstrings
* changelog
* whitespace
* missing punctuation
* ofx docstring
* Apply suggestions from code review
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com >
---------
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com >
2023-05-16 21:34:59 +01:00
Will McGugan
3a17a76233
Exit debug ( #2554 )
...
* show single error by default
* changelog
* show numbers of errors
* changelog
2023-05-16 21:34:34 +01:00
Will McGugan
abb7705ed0
wait for screen ( #2584 )
...
* wait for screen
* comments and changelog
* wait for screen after keys
* extra wait for animation
* comment
* comment
* docstring
2023-05-16 21:06:09 +01:00
Dave Pearson
e69e57d7c0
Remove unused import
...
Recent changes meant it wasn't needed any more.
2023-05-16 20:53:18 +01:00
Dave Pearson
58f0d11a93
Change to a single loader thread with a queue
2023-05-16 16:41:36 +01:00
Dave Pearson
926c0a2b4f
Reset all DirectoryTree worker changes
...
After deciding
https://github.com/Textualize/textual/pull/2545#issuecomment-1547544057 it
makes more sense to roll back to the state of `main` than to try and get to
where I want to be from where we've decided we didn't want to be.
Can't get there from here, so let's go rogue-like on this PR...
2023-05-16 15:29:36 +01:00
Dave Pearson
804d85a2c9
Merge branch 'main' into directory-tree-work-in-worker
2023-05-16 15:16:31 +01:00
Dave Pearson
83e4be77db
Merge pull request #2567 from davep/issue/2557/select-update
...
Fix clearing an OptionList
2023-05-16 15:11:29 +01:00
Dave Pearson
1ebfe2f418
Update the snapshits
2023-05-16 14:38:11 +01:00
Dave Pearson
3d2e3d9092
Add a snapshot test for a rebuilt Select
...
This helps test the practical impact of the fix added for #2557 .
2023-05-16 14:34:18 +01:00
Will McGugan
faa67a8293
Screen docs ( #2579 )
...
* screen docs
* docstrings
* modal example
* docstring
* docstrings
* Apply suggestions from code review
Co-authored-by: Dave Pearson <davep@davep.org >
---------
Co-authored-by: Dave Pearson <davep@davep.org >
2023-05-16 13:44:06 +01:00
Dave Pearson
32fa259c94
Add a TODO comment to the effect that this is a temp fix
2023-05-16 13:38:08 +01:00