Commit Graph

5634 Commits

Author SHA1 Message Date
Rodrigo Girão Serrão
7e83acb966 Add regression test for #1814. 2023-03-13 15:14:12 +00:00
Dave Pearson
40d9997766 Updates to Pilot.click (#2034)
* Correct the x and y values for pilot-induced clicks

Fixes #2022.

* Update the ChangeLog

* Add modifier key support to `Pilot.click`

---------

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2023-03-13 13:45:19 +00:00
Will McGugan
5259c9a37e print after stopping writer thread (#2033)
* print after stopping writer thread

* Add to changelog
2023-03-13 13:38:24 +00:00
Will McGugan
9c5e0336f8 Fix scrollbar (#2024)
* Fix scrollbar

* changelog PR

* fix snapshots
2023-03-13 10:39:14 +00:00
Ofek Lev
fcda3c3350 Properly indicate dependency is only required for development (#2025) 2023-03-12 18:30:15 +00:00
Will McGugan
198190117d Loading indicator (#2018)
* loading indicator and tests

* docs

* snapshot

* remove snapshot

* remove debug main [skip ci]

* changelog [skip ci]

* make start time private
2023-03-11 08:36:13 +00:00
Will McGugan
d3bdaf8ae5 fix refresh on remove (#2008)
* fix refresh on remove

* changelog

* optimization

* added snapshot
2023-03-10 10:06:10 +00:00
Dave Pearson
e2c36c4a15 Merge pull request #2011 from davep/nolodash
Remove underscore pauses from (hopefully) all snapshots
2023-03-09 21:00:07 +00:00
Rodrigo Girão Serrão
48dbe1244e Add magic comment. (#2010)
Related comment: https://github.com/Textualize/textual/pull/2003\#discussion_r1131081129

Related PR: #2003.
2023-03-09 20:55:49 +00:00
Dave Pearson
e6f620db44 Remove underscore pauses from (hopefully) all snapshots
This seeks to remove the "_" from the key presses of snapshots and inline
runs in the documentation. The "_" no longer does anything, but got legacy
reasons at the moment we can't actually allow "_" to be an input to a
"faked" keypress in the docs and snapshots.

Removing these clears the way to letting "_" have the same status as any
other character.

See #1994.
2023-03-09 20:32:27 +00:00
Will McGugan
503c03730e fix blog v0.14.0 2023-03-09 15:01:21 +00:00
Will McGugan
5de2b6f934 rename 2023-03-09 14:58:55 +00:00
Will McGugan
e2d88572c2 changelog 2023-03-09 14:53:39 +00:00
Will McGugan
1f1222b1ce Version 0.14.0 release and blog (#2004)
* new release, and blog

* Edit copy
2023-03-09 14:53:10 +00:00
Will McGugan
f61a50b790 prevent stuck scrollbar (#2003)
* prevent stuck scrollbar

* update changelog

* remove debug

* remove debug
2023-03-09 14:13:12 +00:00
Dave Pearson
aad6d98aa5 More documentation tweaks (#2001)
* Change the title of some widget references to their class names

The widget reference index had a slight mixture of widget title styles, some
being their class name, others being "written English" type titles. This
settles on the titles always being the class name.

* Add a link to the ContentSwitcher to the widget gallery

No screenshot for this, on purpose. By definition this widget isn't visible,
except via other widgets that it's enclosing and handling.

* Have mkdocs watch the main nav file

* Mark the content switcher off the roadmap
2023-03-09 14:01:48 +00:00
darrenburns
f929e133b2 Generate MouseUp events (#1968)
* Remove redundant import

* Generate a MouseUp event when dragging stops

* Update CHANGELOG.md

* Ensure button is propagated through to artificial MouseUp event
2023-03-09 11:56:38 +00:00
Will McGugan
72e32f2206 prevent double errors (#1998)
* prevent double errors

* track invalid css
2023-03-09 11:55:02 +00:00
Dave Pearson
97a5478bd0 Add ContentSwitcher (#1983)
* Add the basic ContentSwitcher widget

* Docstring tidy

* Add a visible_content property to the ContentSwitcher

* Clarify that children of ContentSwitcher with no IDs get ignored

* Simplify setting the display value

* Add the start of an example ContentSwitcher for the docs

* Tweak the example layout to better fit in small spaces

* Add the content switcher to the API docs

* Add a guide entry for the ContentSwitcher

This one is a wee bit more involved than most other widget entries in the
guide in that it doesn't obviously do anything itself, but needs
developer-input to make it do something useful. As such the outline here
isn't as clean as it could be, but I think it conveys everything necessary
without getting too complicated.

* Add the reactive attribute table to the ContentSwitcher guide

* Update the README

* Add a refresh after everything has been flipped in the switcher

As noted in the code, this should not be necessary and I don't believe it
has anything to do with this code. I would suspect some lower-level issue
with flipping between different widgets within a container. I need to find a
way to make an isolated reproduction that isn't about this particular
widget. Meanwhile though this works with the refresh().

* Swap current from var to reactive

This solves the explicit refresh issue, but only because the refresh is
implied due to the use of a reactive over a var. As such this sort of
addresses #1979 by ignoring the issue rather than diving into it.

I still suspect that I shouldn't need to do this, and that perhaps there's a
refresh issue when you flip display. So I'll keep #1979 kicking around and
at some point see if I can recreate in isolation.

* Add unit tests for the content switcher

* Add snapshot tests for the ContentSwitcher

* Clarify that an exception can be thrown on a bad ID

* Try and help other Pythons

* Add a pause at the end of the second switcher snapshot test

I'm getting a lot of fails in CI; none of them are actual problems.
Hopefully this will cure it.

* Paaaaaaaaause

More of a test than anything else really. My particular snapshot test is
failing but kinda randomly in each environment each time -- sometimes
Windows, sometimes GNU/Linux, different Python versions.

So... yeah, let's try this and see if it makes it through; otherwise I may
need to rethink this.

* New pause

So it turns out that _ doesn't do anything any more; and instead there's a
"wait:<n>" syntax! So let's give that a try.

* Learning my alphabet...

* Fix a typo in the docs.

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Add missing full stop.

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Add a missing word

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>

* Try a longer wait on the switcher

I'm starting to suspect that this doesn't come down to a timing issue;
especially given that the snapshot report seems to be showing some oddity in
the length of the vertical scrollbar. But... I want to be as sure as
possible so let's double the length of the wait.

Bit a bit of me is starting to wonder if I've somehow managed to create the
perfect storm for scrollbars and you don't always get the same result every
time.

Seems unlikely, but if it's not timing it's that or lots of cosmic rays.

* Test a longer pause on the content switcher test

The idea here being that it takes 200ms for the button to pop again.

* Refresh the snapshots

This time. THIS TIME!

* Experiment: is the issue the same name for two tests?

* Experiment: drop the different source files, try terminal size

Having got over the issue of the button not ending up in the same state,
we're stuck with the scrollbar having different sizes. Having tried other
options let's go with tweaking the terminal size.

* Do a little less work when changing current

Rather than set everything invisible then the new one visible, every time
current is changed, instead just make sure everything is invisible up front
and then just swap the affected children each time.

This does mean that if someone messes with the children under the hood they
may see oddness happening, but less work while being less defensive seems
fair here.

---------

Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
2023-03-09 11:39:30 +00:00
Will McGugan
2bbd5c2f3d blog on creating tasks (#1987)
* blog on creating tasks

* a
2023-03-09 11:39:14 +00:00
Dave Pearson
a5695edcb5 Swap out the primary Markdown bullet for one that works everywhere (#1997)
* Swap out the primary Markdown bullet for one that works everywhere

The primary bullet wasn't displaying well on Windows in the Windows
terminal.

* Refresh the snapshot tests

Imagine that, changing how something looks needs that the snapshot tests get
updated. *facepalm*
2023-03-09 11:38:58 +00:00
Will McGugan
44c7a3d8fc bump typing extensions (#1996) 2023-03-09 10:12:47 +00:00
Will McGugan
3a627e0881 more reliable pause (#1993) 2023-03-09 09:45:34 +00:00
Mike Driscoll
8cb28b6668 Update button.md example sentence (#1988)
The example was missing a word
2023-03-09 06:46:53 +00:00
TomJGooding
e95a65fa56 docs(compound example): fix typo (#1984) 2023-03-08 17:42:25 +00:00
Dave Pearson
928ab661f7 Don't watch the generated mkdocs configs (#1985)
I got a bit carried away with what to watch, and it looks like the mkdocs
watch plugin doesn't much care for watching for files that don't exist but
may.
2023-03-08 17:41:40 +00:00
Dave Pearson
b6c5337379 Merge pull request #1978 from davep/extend-docs-watcher
Extend docs watcher
2023-03-08 10:53:01 +00:00
Dave Pearson
e6e9d2b698 Add all the mkdocs config files to the reload-watcher
When I made the changes to documentation generation I split up the then
single mkdocs configuration file. It looks like the reloader for mkdocs
always watches its configuration file, bit *only* the one that was loaded in
the first place, not any that are inherited from.

So this change adds all of the mkdocs yml files to the watch list to ensure
that any change causes the documentation server to reload.

Most useful if you're adding new files to the navigation.
2023-03-08 08:36:22 +00:00
darrenburns
2ed72e1710 DataTable - fix crash when selection made in empty table (#1973) 2023-03-07 20:58:28 +00:00
darrenburns
4921a5cb43 Snapshot tests for the CLI preview apps (#1969) 2023-03-07 16:42:21 +00:00
Dave Pearson
fc37a5c196 Merge branch 'main' of github.com:davep/textual 2023-03-07 16:37:34 +00:00
Dave Pearson
4e2be18761 Remove unnecessary cast (#1967)
Became moot after the recent message changes but seems to have got left
behind.
2023-03-07 15:19:44 +00:00
darrenburns
b366d1d49c Pilot - add hover and click methods (#1966)
* Delete redundant test file

* Sketch out pilot API improvements - signatures/docstrings

* Pilot click and hover

* Updating test to use new pilot hover method for DataTable

* hover and click methods for Pilot

* Update changelog

* Add docstring
2023-03-07 15:19:23 +00:00
Dave Pearson
6d23fdf4f1 Ensure the toggle button keeps any bold state (#1965)
* Ensure the toggle button keeps any bold state

Fixes #1963.

* Update snapshots
2023-03-07 15:18:36 +00:00
Dave Pearson
c0d6d173c1 Remove unnecessary cast
Became moot after the recent message changes but seems to have got left
behind.
2023-03-07 15:00:37 +00:00
Dave Pearson
b7de48cca3 Border colour percentage (#1954)
* Allow setting an additional alpha on a border

See #1863.

* Update the ChangeLog

* Add snapshot tests for the border alpha value

* Extend the border snapshot tests

While this doesn't test *every* permutation, it covers enough bases that if
something were to change it should catch it.

* Tweak a typo in the border style examples

* Add border transparency percentage to the border docs

* Add a CSS example for using border transparency

* Add Color.multiply_alpha

* Update the CHANGELOG

* Multiply the alpha on a colour rather than replace it

As requested in
https://github.com/Textualize/textual/pull/1954#pullrequestreview-1328170386

(actually required while talking in person with Will, but noted in the
above)

* Multiply the alpha on a border colour rather than replace it

As requested in
https://github.com/Textualize/textual/pull/1954#pullrequestreview-1328170386

(actually requested while talking in person with Will, but noted in the
above)
2023-03-07 14:14:17 +00:00
Will McGugan
b9977812f7 added static 2023-03-07 14:05:40 +00:00
Dave Pearson
a47cb6a198 Merge pull request #1964 from davep/devtools-terminal-warning
Add a post-run warning hook to `textual run`
2023-03-07 13:28:20 +00:00
Dave Pearson
858d228da9 Fix a concerning typo 2023-03-07 13:02:01 +00:00
darrenburns
1b06e50f10 Fix for DataTable race-condition crash (#1962)
* Fix for DataTable race-condition crash

* Update CHANGELOG.md
2023-03-07 13:01:06 +00:00
Dave Pearson
2047fda57d Rebuild the FAQ 2023-03-07 12:56:27 +00:00
Dave Pearson
c049888f55 Flesh out the list of problems with Terminal.app 2023-03-07 12:52:43 +00:00
Dave Pearson
3039a3fc62 Add a comment to explain the content of the warning list 2023-03-07 12:50:35 +00:00
Dave Pearson
ff532227d6 Reword the warning and link it to the FAQ entry 2023-03-07 11:51:08 +00:00
Dave Pearson
56ba7d9cc7 Add a FAQ about the default macOS terminal.app 2023-03-07 11:26:03 +00:00
Will McGugan
85f26e22d0 tweak 2023-03-07 11:19:28 +00:00
Will McGugan
1c91c3dba2 tweaked heights [skip ci] 2023-03-07 11:17:15 +00:00
Dave Pearson
e925eb7c81 Add a post-run warning hook, and test for macOS Terminal.app
This will change, this is more of a placeholder to test things. I'm next
going to write a FAQ and then we'll point to that.
2023-03-07 11:15:45 +00:00
Will McGugan
0f4eb2f1d5 Add widget gallery (#1960)
* Add widget gallery

* updated copy
2023-03-07 11:12:54 +00:00
Dave Pearson
951b6d66ec Merge pull request #1959 from davep/extend-center-faq-entry
Extend the centering Q in the FAQ
2023-03-07 11:02:08 +00:00