Commit Graph

5657 Commits

Author SHA1 Message Date
Rodrigo Girão Serrão
f9a1e27c6f Merge branch 'main' into add-containers
[skip ci]
2023-03-13 16:21:46 +00:00
Will McGugan
a3887dfcbb new release (#2040)
* new release

* reword [skip ci]
v0.15.0
2023-03-13 15:48:41 +00:00
Will McGugan
b0f5c35782 tabs widget (#2020)
* tabs widget

* click underline

* color tweak

* docs

* docs update

* expose Tab

* added remove_tab and clear

* fix cycling

* add animation

* docs

* changelog

* remove recompose

* docstrings

* Update docs/guide/actions.md

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

* Rodrigoed the tabs

* Update docs/widgets/tabs.md

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

* Update docs/widgets/tabs.md

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

* copy

* docstrings

* docstring

* docstring

* Apply suggestions from code review

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

* stop click

* docstring

* auto assign consistent IDs

* Apply suggestions from code review

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

* Document bindings

* document bindings

* 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-03-13 14:39:15 +00:00
Rodrigo Girão Serrão
5983d88aa6 Merge pull request #2037 from Textualize/pilot-click-underscore
Pilot can now press _
2023-03-13 14:38:59 +00:00
Rodrigo Girão Serrão
eafa12c9bf Let pilot press _. 2023-03-13 14:13:02 +00:00
Rodrigo Girão Serrão
103c27b942 Add test for pilot pressing underscore.
The pilot pressing the underscore '_' used to be an alias for a short pause (see #2011). This test makes sure that the pilot can press the underscore '_' as any other character key.
2023-03-13 14:11:33 +00:00
Rodrigo Girão Serrão
009270cd69 Remove remaining underscore pauses.
These slipped from #2011.
2023-03-13 14:10:22 +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
Rodrigo Girão Serrão
3518d38d85 Update snapshot tests. 2023-03-13 12:02:36 +00:00
Rodrigo Girão Serrão
cc8f65259e Merge branch 'main' into add-containers 2023-03-13 12:00:08 +00:00
Rodrigo Girão Serrão
429c8a3649 Tweak default Center/Middle dimensions.
We set dimensions to 1fr instead of 100% (original request) or blank (previous change) for consistency with the other containers.
2023-03-13 11:48:49 +00:00
Rodrigo Girão Serrão
0e51520a2c Make docs comply with new containers. 2023-03-13 11:44:47 +00:00
Rodrigo Girão Serrão
48ce1a149d Add snapshot test for Center/Middle. 2023-03-13 11:18:33 +00:00
Rodrigo Girão Serrão
bdeea9fb86 Tweak Center/Middle default dimensions. 2023-03-13 11:10:50 +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
Rodrigo Girão Serrão
c13308a360 Add tests for Horizontal/Vertical(Scroll) containers. 2023-03-09 17:39:05 +00:00
Rodrigo Girão Serrão
5674b4b628 Add 'Vertical'.
Related issues: #1957.
2023-03-09 15:38:31 +00:00
Rodrigo Girão Serrão
38c7cc1849 Fix default CSS for 'VerticalScroll'. 2023-03-09 15:36:38 +00:00
Rodrigo Girão Serrão
639d8f0250 Change default 'overflow' style for 'Horizontal'.
Related issues: #1957.
2023-03-09 15:30:44 +00:00
Rodrigo Girão Serrão
58ad5dfdd9 Tweak docstrings. 2023-03-09 15:26:51 +00:00
Rodrigo Girão Serrão
e111449856 Add container 'Middle'.
Related issues: #1957.
2023-03-09 15:24:13 +00:00
Rodrigo Girão Serrão
f91750ed3d Add container 'Center'.
This container will centre children horizontally.

Related issues: #1957.
2023-03-09 15:21:20 +00:00
Rodrigo Girão Serrão
be41797a8d Merge branch 'main' into add-containers 2023-03-09 15:19:43 +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
Rodrigo Girão Serrão
90dce06eae Add 'HorizontalScroll'.
Related issues: #1957.
2023-03-09 14:35:49 +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
Rodrigo Girão Serrão
4ca62eee60 Update docstring. 2023-03-09 12:21:53 +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
Rodrigo Girão Serrão
8565d3cef6 Renamed 'Vertical' to 'VerticalScroll'.
Related issues: #1957.
2023-03-08 18:31:24 +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