Commit Graph

6472 Commits

Author SHA1 Message Date
Dave Pearson
3b6f75ce6e Update the ChangeLog 2023-06-01 11:42:19 +01:00
Dave Pearson
216615e24f Merge branch 'main' into tree-node-label-change-should-refresh-the-tree 2023-06-01 11:39:57 +01:00
Will McGugan
58a9cb1909 blog post new release (#2712)
* blog post new release

* update words

* Update docs/blog/posts/release0-27-0.md

Co-authored-by: Dave Pearson <davep@davep.org>

---------

Co-authored-by: Dave Pearson <davep@davep.org>
v0.27.0
2023-06-01 11:33:54 +01:00
Dave Pearson
e55ee23eae Defer the repainting of the node in the tree
The previous change actually broke some of the tests in test_disabled.py --
well actually it flat out broke one and caused all the others to run *very*
slowly. No clue why though.

But thinking about this some more, it does feel like delaying the refresh of
the node makes more sense.
2023-06-01 10:49:29 +01:00
Dave Pearson
70f173fae8 Ensure a Tree's node is refreshed when the label is changed
Fixes #2698
2023-06-01 10:37:39 +01:00
Rodrigo Girão Serrão
78db024c01 Add sparkline widget. (#2631)
* Sparkline widget proof of concept.

* Address review comment.

Related comments: https://github.com/Textualize/textual/pull/2631\#discussion_r1202894414

* Blend background colours.

* Add widget sparkline.

* Add snapshot tests.

* Add documentation.

* Update roadmap.

* Address review feedback.

Relevant comments: https://github.com/Textualize/textual/pull/2631\#discussion_r1210394532, https://github.com/Textualize/textual/pull/2631\#discussion_r1210442013

* Improve docs.

Relevant comments: https://github.com/Textualize/textual/pull/2631\#issuecomment-1568529074

* Update snapshot app titles.

* Don't init summary function with None

Related comments: https://github.com/Textualize/textual/pull/2631\#discussion_r1211666076

* Apply suggestions from code review

Co-authored-by: Dave Pearson <davep@davep.org>

* Improve wording.

* Improve wording.

* Simplify example.

---------

Co-authored-by: Dave Pearson <davep@davep.org>
2023-06-01 09:34:33 +01:00
darrenburns
7049014faa Option to ensure scroll_to_center doesn't scroll so as to hide the top left corner of the widget (#2682)
* Option to ensure origin of widget is visible when calling scroll to center

* Update CHANGELOG.md

---------

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2023-05-31 16:13:21 +01:00
Dave Pearson
a14e469dd6 Improve OptionList test coverage (#2701)
* Cover the penultimate uncovered line in OptionList

Sort of moot, but worth a test that the control of a message is the option
list.

* Test OptionList hover over disabled option

I *would* have liked to have tested this sort of thing via snapshot tests,
but it seems that pilot.hover isn't quite behaving as desired there. But
this provides a useful test anyway.
2023-05-31 15:23:24 +01:00
Will McGugan
0849e6f410 mount order (#2702)
* mount order

* fix test

* simplify hooks

* changelog

* docstring
2023-05-31 15:16:26 +01:00
Dave Pearson
4ff1d18cb5 Merge pull request #2700 from davep/split-option-list-snapshits
Split up the OptionList snapshot tests
2023-05-31 11:22:51 +01:00
darrenburns
0dc58bd151 Ensure _options attribute is assigned in Select constructor (#2690)
* Ensure _options attribute is assigned in Select constructor

* Update CHANGELOG.md

---------

Co-authored-by: Will McGugan <willmcgugan@gmail.com>
2023-05-31 09:45:06 +01:00
Dave Pearson
dba14b8a12 Split up the OptionList snapshot tests
Don't run 3 snapshot tests in one test function when it's easier to see what
broke and where if each is in their own function.
2023-05-31 09:17:26 +01:00
Will McGugan
149c39c86c Tooltips (#2670)
* inflect

* diagram

* tooltip render

* tooltip property

* add guard

* tooltip docs

* docs

* tidy, fix horizontal

* words, removed comment

* fix screenshot render

* simplify

* simfplify

* changelog

* simplify optimize

* inflect tests

* Apply suggestions from code review

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

* docstring

* disable auto focus

* should be fraction

* optimization

* snapshot update

* Update tests/snapshot_tests/snapshot_apps/scroll_to_center.py

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-30 16:14:31 +01:00
Rodrigo Girão Serrão
83c83de78b Merge pull request #2686 from Textualize/worker-coverage
Increase worker coverage and fix bug.
2023-05-30 16:13:20 +01:00
Aaron Stephens
7c9abea839 fix(_compositor): move hidden_widgets (#2687) 2023-05-30 15:58:14 +01:00
Will McGugan
4930c1615b Merge branch 'main' into worker-coverage 2023-05-30 15:55:46 +01:00
Rodrigo Girão Serrão
43d39aa061 Merge pull request #2693 from Textualize/stylesbase-typing
Fix typing issues.
2023-05-30 15:09:47 +01:00
Rodrigo Girão Serrão
ee6f1b93a3 Merge pull request #2692 from Textualize/switch-screen
Fix issue with switch screen.
2023-05-30 15:09:19 +01:00
Rodrigo Girão Serrão
0f4f82569c Fix typing issues.
Related issues: #2494, #2680
2023-05-30 14:46:54 +01:00
Rodrigo Girão Serrão
ce771c19f4 Fix issue with switch screen. 2023-05-30 13:55:17 +01:00
darrenburns
3dea4337ac Add Validator framework note to CHANGELOG (#2685) 2023-05-30 13:02:46 +01:00
Rodrigo Girão Serrão
5126e98b3b Remove weird import. 2023-05-30 10:21:35 +01:00
Rodrigo Girão Serrão
9569a98c77 Increase worker coverage and fix bug. 2023-05-29 19:49:58 +01:00
darrenburns
a40300a6f5 Ensure reflow reflows non-visible widgets, fix scroll_to_center issue (#2684) 2023-05-29 18:23:49 +01:00
Rodrigo Girão Serrão
6cb052a7f2 Fix changelog. (#2683) 2023-05-29 18:17:31 +01:00
darrenburns
3e7b2c53a8 Add Widget.remove_children method (#2657) 2023-05-29 18:03:42 +01:00
darrenburns
ca17d8194e Add docs for Pretty, fix some reference issues in docs (#2678) 2023-05-29 17:11:39 +01:00
Rodrigo Girão Serrão
73d55725b5 Merge pull request #2604 from Textualize/input-auto-completion
Input completion suggestions
2023-05-29 14:48:40 +01:00
Rodrigo Girão Serrão
baa1f712d8 Change default case sensitivity. 2023-05-29 14:24:49 +01:00
Dave Pearson
ea75fcc5e5 Merge pull request #2679 from davep/fix-dock-type-warning
Fix the dock type warning
2023-05-29 13:55:32 +01:00
Dave Pearson
5a8fe24367 Fix the dock type warning
See #2494.
2023-05-29 13:44:11 +01:00
Dave Pearson
3e462793e4 Merge pull request #2677 from davep/docs-no-insiders-redux
Revisit allowing building the docs without access to "Material for MkDocs Insiders"
2023-05-29 12:57:25 +01:00
Dave Pearson
d4eb0a0c20 Only link Python and Rich types when building full docs
It looks like mkdocstrings will fail out if it can't download the inv files.
Unless there's a setting where you can tell it "try, but if you can't grab
them just don't try and create links" the approach here seems reasonable and
has the same effect.

https://github.com/Textualize/textual/issues/2629#issuecomment-1566672594
for reference.
2023-05-29 08:30:23 +01:00
Dave Pearson
806a6663ad Remove the privacy plugin from the offline version of the docs
Yes, this does pretty much undo the "offline" part, but without this the
docs can't build if the builder doesn't have access to the insiders' edition
of mkdocs. Doing this as a first step to investigating if there's any
possible way to achieve what we want here:

- Anyone can build
- They can build offline
- They can build for maximum privacy

If not, this step at least hits the first requirement.

See #2629.
2023-05-29 07:40:30 +01:00
Will McGugan
1ea892b062 handler name in classvar (#2675)
* handler name in classvar

* fix for worker handler name

* fix custom templates, event docs

* doc tweak

* doc tweak

* restore signature
2023-05-28 14:56:18 +01:00
Will McGugan
ab10c7c326 fix zero division error (#2674)
* fix zero division error

* push tests
2023-05-28 14:56:05 +01:00
Dave Pearson
65b0c34f2e Merge pull request #2660 from davep/dirtree-tweaks 2023-05-26 15:18:58 +01:00
Dave Pearson
ec3334e633 Perform the "is loaded" test in _add_to_load_queue
The test if a node was loaded wasn't being performed when loading the root.
This ensures that will happen. I suspect this is (no pun...) at the root of
the issue with https://github.com/Textualize/frogmouth/issues/50 even though
I can't see the route into how this happens, and can't recreate this at
will.

This feels like a worthwhile change to make anyway as it's a safer approach.
2023-05-25 20:55:22 +01:00
Dave Pearson
32790de26a Ensure a node has no children before populating it
I'm struggling to recreate https://github.com/Textualize/frogmouth/issues/50
in a controlled way, but reviewing the code here makes me think that this is
a good idea anyway. While DirectoryTree should not end up in _populate_node
if a node has already been populated, it's also the case that it's an
all-or-nothing thing; it makes sense to clear out the children of the node
before populating it; at least in a belt-and-braces way.
2023-05-25 20:49:50 +01:00
Rodrigo Girão Serrão
fd57309ad0 Make validators kwd-only. 2023-05-25 17:57:33 +01:00
Rodrigo Girão Serrão
31e2d1c839 Merge branch 'main' into input-auto-completion 2023-05-25 17:42:37 +01:00
Rodrigo Girão Serrão
ae266551a1 Update suggester implementation. 2023-05-25 17:32:40 +01:00
Rodrigo Girão Serrão
fc86682dfa Add tests for suggester. 2023-05-25 17:32:26 +01:00
Rodrigo Girão Serrão
0488b5ed9c Ignore abstractmethods. 2023-05-25 17:22:21 +01:00
Dave Pearson
ea8c6039a9 Merge pull request #2652 from davep/multiselect 2023-05-25 17:10:20 +01:00
Dave Pearson
c16b32b52f Merge pull request #2656 from davep/private-validate-and-compute
Add (currently xfailing) tests for private reactive validation and compute methods
2023-05-25 15:53:24 +01:00
Dave Pearson
fa47d0bd41 Mark the public/private validate and compute tests as xfails 2023-05-25 15:27:27 +01:00
Dave Pearson
bd6717f3d5 Add a test for public and private computes
This fails for now.
2023-05-25 15:23:33 +01:00
Dave Pearson
400043dda1 Update snapshit tests 2023-05-25 14:47:11 +01:00
Dave Pearson
93cae8d961 Merge branch 'multiselect' of github.com:davep/textual into multiselect 2023-05-25 14:20:13 +01:00