Commit graph

34 commits

Author SHA1 Message Date
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
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
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
Dave Pearson
0df17fc8f0
Tidy up some Button documentation
Adds missing documentation for disabled to each of the button variant
constructors, and also pulls in a couple more public-visible Button-related
types into the docs.
2023-03-01 16:46:47 +00:00
Dave Pearson
80fd76f1f2
Document TreeDataType 2023-03-01 13:45:32 +00:00
Dave Pearson
dbb52637c5
Document NodeID
It's in the public interface for tree, so it should be documented.
2023-03-01 13:23:28 +00:00
Dave Pearson
ac35c1d1d5
Document TreeNode via Tree itself
There's a couple of other types in the public interface of Tree that should
be teased out, and it feels odd to have one type in one file and a bunch of
others in another. So this sets us up for having them all the same place.
This should make it easier for the reader to find related information.
2023-03-01 13:21:45 +00:00
Dave Pearson
a837cd1d85
Ensure PlaceholderVariant gets included in the docs 2023-03-01 13:08:40 +00:00
Dave Pearson
87f216980d
Add the Welcome widget to the documentation
While it's arguably not the most useful widget, it's in the code, exported,
and can be seen by people; I feel it should be in the documentation. I've
ensured that it also links to Placeholder given it sort of is a Placeholder
and so people might arrive at it first and it makes sense to redirect them
to something more comprehensive.
2023-03-01 10:39:30 +00:00
Dave Pearson
ce5b02522e
Document AwaitRemove 2023-02-28 12:50:41 +00:00
Dave Pearson
8d2336a02e
Increase the coverage of API documentation
See #1364 -- rather than pull in specific classes, this pulls in every
publicly-documented item (function, class, type, "constant", etc) that can
be found in each of the modules.

This should help improve the linkage of types within the documentation.
2023-02-28 12:27:22 +00:00
Dave Pearson
f52aac4952
Initial work on adding toggle buttons to the documentation
This just gets the API docs into place, and tidies up some of the docstirngs.
2023-02-23 13:27:27 +00:00
Will McGugan
71d0017ef9 docs and refactor 2023-02-14 15:22:15 +00:00
Dave Pearson
decc1e2f3c
Rename Checkbox to Switch
A new form of Checkbox will be arriving in Textual soon, working in
conjunction with a RadioButton. What was called Checkbox is perhaps a wee
bit heavyweight in terms of visual design, but is a style of widget that
should remain.

With this in mind we're renaming the current Checkbox to Switch. In all
other respects its workings remains the same, only the name has changed.

Things for people to watch out for:

- Imports will need to be updated.
- Queries will need to be updated; special attention will need to be paid to
  any queries that are string-based.
- CSS will need to be changed if any Checkbox styling is happening, or if
  any Checkbox component styles are being used.

See #1725 as the initial motivation and #1746 as the issue for this
particular change.
2023-02-09 11:10:30 +00:00
Will McGugan
a5808db8b8 more docs and diagrams 2023-02-03 19:10:03 +01:00
Will McGugan
2ff278874b docs examples and diagrams 2023-02-03 11:23:14 +01:00
Will McGugan
dc5041f1e1 update to intro page, fix for API docs 2023-01-26 12:21:49 +01:00
Darren Burns
be45db4573
Use autodoc for DataTable Messages reference 2023-01-17 13:00:01 +00:00
Will McGugan
cebeafbb8b
Merge branch 'main' into list-view 2022-12-09 10:09:07 +00:00
Will McGugan
69ed4b2e0b textlog documentation 2022-12-09 09:01:34 +00:00
Rodrigo Girão Serrão
ba5ec6b34b Merge branch 'main' of https://github.com/Textualize/Textual into placeholder 2022-12-05 15:08:01 +00:00
Darren Burns
eb8c078306 Merge branch 'main' of github.com:willmcgugan/textual into list-view 2022-11-23 11:03:40 +00:00
Darren Burns
4e0c77e9f7
Ensure mkdocs.yml is up to date with listview stuff 2022-11-21 17:14:32 +00:00
Will McGugan
f7dade5a26 new tree control 2022-11-20 15:42:35 +00:00
Darren Burns
cc0a5e30a0
Merge branch 'main' of github.com:Textualize/textual into list-view 2022-11-18 16:35:50 +00:00
Rodrigo Girão Serrão
54b85399e7
Merge branch 'main' into placeholder 2022-11-18 15:21:40 +00:00
Rodrigo Girão Serrão
a8c5d1abe4 Add docs for Placeholder. 2022-11-18 15:17:43 +00:00
Dave Pearson
8a6d21da5e
Add the basics of Label docs for the manual 2022-11-17 10:15:35 +00:00
Darren Burns
5bc1606361
Merge branch 'main' of github.com:Textualize/textual into list-view 2022-11-15 15:56:42 +00:00
Will McGugan
e83a3a79bd Added walk to docs 2022-11-11 10:05:12 +00:00
Darren Burns
6042346779
Add list view and docs 2022-11-08 17:15:24 +00:00
Will McGugan
44debac54c fix rich export size 2022-11-06 16:19:58 +00:00
Will McGugan
d76dd66118 fix api index 2022-11-06 16:11:41 +00:00
Will McGugan
a46eda2fa0 Added blog 2022-11-06 15:41:12 +00:00