Commit Graph

5654 Commits

Author SHA1 Message Date
Will McGugan
85cce4a09e changelog 2023-03-14 10:02:15 +00:00
Rodrigo Girão Serrão
145872c100 Merge pull request #2041 from Textualize/simplify-message-namespace
Simplify namespace for inherited messages from ToggleButton
2023-03-14 09:59:34 +00:00
Will McGugan
507ee48967 version bump (#2049) v0.15.1 2023-03-14 09:57:31 +00:00
Dave Pearson
551d93c7c8 Ensure that Tab is available from textual.widgets (#2045)
Fixes #2044
2023-03-14 09:48:20 +00:00
Dave Pearson
b9c6520db4 Make the Python code for dock.md more... Pythonic (#2046)
Fixes #2043.
2023-03-14 09:47:51 +00:00
Dave Pearson
98f56aa1f6 Fix a typo in example code in the 0.14.0 release blog post (#2047)
Credit to #2021 for the spot.
2023-03-14 09:47:28 +00:00
Dave Pearson
cfb8219e44 Merge pull request #2039 from davep/new-disabled-snapshot-test
Simplify the disabled widgets snapshot test
2023-03-14 08:48:40 +00:00
Rodrigo Girão Serrão
ae83e12483 Simplify namespace for inherited messages.
Related issues: #1814.
Related PRs: 2038.
2023-03-13 16:28:51 +00:00
Rodrigo Girão Serrão
53a56da317 Merge pull request #2038 from Textualize/message-namespaces
Change how to determine whether a message needs an updated namespace
2023-03-13 16:24:11 +00:00
Rodrigo Girão Serrão
eea61c1b0b Fix changelog. [skip ci] 2023-03-13 16:16:00 +00:00
Rodrigo Girão Serrão
f81dd4071c Merge branch 'main' into message-namespaces 2023-03-13 16:08:50 +00:00
Will McGugan
a3887dfcbb new release (#2040)
* new release

* reword [skip ci]
v0.15.0
2023-03-13 15:48:41 +00:00
Dave Pearson
cf62a4a76a Update the snapshots 2023-03-13 15:37:45 +00:00
Dave Pearson
dd49a723ee Simplify the disabled snapshot test
Initially this was "throw most if not all widgets at the display and disable
everything" test; but in #2028 it was requested that this be simplified,
just using the same widget, in enabled and disabled states.

Button seems like a good choice here.

To ensure that things work as intended, I'm going with the approach of
disabling via a container as that's one big change that the disabled
facility brought in.
2023-03-13 15:31:29 +00:00
Rodrigo Girão Serrão
b00b4fb060 Fix #1814. 2023-03-13 15:17:16 +00:00
Rodrigo Girão Serrão
7e83acb966 Add regression test for #1814. 2023-03-13 15:14:12 +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
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