Commit Graph

3142 Commits

Author SHA1 Message Date
Will McGugan
e83a3a79bd Added walk to docs 2022-11-11 10:05:12 +00:00
Will McGugan
b2d9f4703d keep pylance happy 2022-11-11 09:55:56 +00:00
Will McGugan
41263c32df restore type alias 2022-11-11 09:41:14 +00:00
Will McGugan
44e44da784 docstrings 2022-11-11 09:38:17 +00:00
Will McGugan
d93e300d95 walk.py 2022-11-11 09:33:31 +00:00
Will McGugan
698ecc62c6 factored out walk 2022-11-11 09:29:45 +00:00
Will McGugan
3f761319f0 Merge pull request #1139 from overflowy/minimal-refactoring
Minimal refactoring
2022-11-10 16:33:33 +00:00
Will McGugan
d45780b90d Merge pull request #1154 from Textualize/table-update
Table update
2022-11-10 16:32:10 +00:00
Will McGugan
1b61a95c70 table tests 2022-11-10 16:22:52 +00:00
Will McGugan
300bd86d45 Changelog 2022-11-10 16:03:26 +00:00
Will McGugan
b524fa08ee ffixed table refresh on add row 2022-11-10 16:02:30 +00:00
Will McGugan
beddf27b0d Merge pull request #1149 from Textualize/call-later
call later
2022-11-10 15:30:05 +00:00
Will McGugan
97eab5fd6e Merge branch 'main' into call-later 2022-11-10 15:24:31 +00:00
Will McGugan
ed779f3e99 no need for full refresh 2022-11-10 15:22:25 +00:00
Dave Pearson
bb60d4c827 Merge pull request #1153 from davep/remove-event-tests
Add unit tests for App._on_remove
2022-11-10 14:02:44 +00:00
Dave Pearson
d73d4e898f Add unit tests for App._on_remove
These tests are designed to give 100% coverage to the App._on_remove method,
which is the heart of the widget removal system. This is done in
anticipation to some reworking as part of #1094.

Note that, for the moment, there's a bit of a hack in here. These tests need
the pilot. The pilot would need that we await changes to the DOM. Removing
things from the DOM changes the DOM. Remove can't be awaited (see above
change that's coming). So... until such a time as we can await a remove, we
go with a simple await of asyncio.sleep to get things started.

Once #1094 has been done these tests should all still work fine *and* we
should be able to await the removes rather than use the sleeps.
2022-11-10 13:13:15 +00:00
Will McGugan
fb0f9ab805 Merge pull request #1152 from davep/prop-docs
Property docstring tweaks
2022-11-10 11:45:41 +00:00
Dave Pearson
e5ef8c0495 Merge pull request #1147 from davep/remove-refresh
Improve the speed of `DOMQuery.remove`
2022-11-10 11:13:30 +00:00
Dave Pearson
ed1aeab071 Tidy up and add some app docstrings 2022-11-10 11:10:04 +00:00
Dave Pearson
f9e5541d01 Tidy some docstrings
Moving some property docstrings to a voice that describes what they are, not
what they do.
2022-11-10 11:09:17 +00:00
Dave Pearson
efe721fb51 Reduce the amount of work needed to build the pruned remove list 2022-11-10 11:03:28 +00:00
Dave Pearson
a888e52c30 Reduce the work needed to get the topmost widget prune set
See https://github.com/Textualize/textual/pull/1147#pullrequestreview-1175289913
2022-11-10 09:03:19 +00:00
Dave Pearson
922fd8ad6a Merge pull request #1137 from davep/squish-type-error
Remove a type-checking error for the result of _find_mount_point
2022-11-09 21:22:28 +00:00
Dave Pearson
3cb00f93d5 Simplify the building of the pruned remove list
See https://github.com/Textualize/textual/pull/1147#discussion_r1018230164
2022-11-09 21:17:55 +00:00
Dave Pearson
419ae15435 Remove unnecessary caution 2022-11-09 21:00:49 +00:00
Dave Pearson
414f0a66bd Fix a comment typo 2022-11-09 20:58:42 +00:00
Will McGugan
9538e60a01 remove print debug 2022-11-09 17:40:14 +00:00
Will McGugan
45cb770b19 Merge pull request #1144 from Textualize/scroll-easing
Add easing parameter to Widget.scroll_* methods
2022-11-09 17:24:52 +00:00
Will McGugan
39a764f49f call later 2022-11-09 17:23:28 +00:00
Dave Pearson
1f8aaf56d5 Add a docstring to _on_remove 2022-11-09 16:32:02 +00:00
Dave Pearson
f34d53ebb3 Tidy up some explanations 2022-11-09 16:31:18 +00:00
Dave Pearson
57a2b77e26 Merge branch 'main' into remove-refresh 2022-11-09 16:23:01 +00:00
Dave Pearson
5dee9ef4dc Update the CHANGELOG 2022-11-09 16:20:39 +00:00
Dave Pearson
23eb7b907b Handle a Remove event that requests multiple widget removals
This finishes off the work to make the loop-free query request to remove
objects work as fast as possible. Removing widgets with that query method
should be more or less as fast as removing a container for the same number
of widgets.

See https://github.com/Textualize/textual/discussions/1110 for some context.
2022-11-09 16:18:05 +00:00
Dave Pearson
e3130f95c6 Don't include self in DOMNode.ancestors any more
As well as dropping `self` from the list that DOMNode.ancestors provides,
this commit also adds DOMNode.ancestors_with_self, which maintains the
previous behaviour of DOMNode.ancestors.
2022-11-09 16:14:59 +00:00
darrenburns
ee74072663 Merge branch 'main' into scroll-easing 2022-11-09 15:10:29 +00:00
Darren Burns
20c037752b Allow scroll easing params to be Noneable for future configurability of defaults 2022-11-09 15:08:45 +00:00
Dave Pearson
5d6daf2a00 Extend the on_unmount unit tests
Because some changes are going to be made to the way that removal of widgets
happens, and because this will affect the linkage between parents and
children, and because we don't want the current way of working to change...
extend to the tests to be sure that when an unmount happens a widget has no
children any more, but still knows about its parent.
2022-11-09 14:59:13 +00:00
Will McGugan
51d5e7db0c Merge pull request #1145 from Textualize/instant-watchers
make watchers instant
2022-11-09 14:51:23 +00:00
Will McGugan
ec8bc40e31 remove flag 2022-11-09 12:19:13 +00:00
Will McGugan
395616f3bc only compute when watcher runs 2022-11-09 12:15:58 +00:00
Will McGugan
f9b2434fb2 changelog 2022-11-09 12:08:56 +00:00
Will McGugan
dd5c0e612a make watchers instant 2022-11-09 12:06:14 +00:00
Darren Burns
bad2c0add8 Update changelog 2022-11-09 11:18:43 +00:00
Darren Burns
aa6364112e Add easing parameter to Widget.scroll_* methods 2022-11-09 11:14:43 +00:00
Dave Pearson
394bdec362 Change the Remove event so that it takes a list of widgets to remove
This commit sets things up so that a list of widgets can be used, but also
then goes on to ignore the fact that there is a list, only removing the
first one in the list. That's a feature, not a but -- here I'm just testing
that we can make this move and nothing breaks. Next up is to allow removing
all of the widgets while holding off on any layout refresh until all
removals have been performed.
2022-11-09 11:10:42 +00:00
Will McGugan
3594cf9277 added blog post to changelog 2022-11-08 21:48:46 +00:00
overflowy
3148b60521 Revert "Lift returned value closer to condition, drop else"
This reverts commit 2415554a65.
2022-11-08 22:37:21 +01:00
Will McGugan
18f807e949 added new version to comparison urls 2022-11-08 20:59:59 +00:00
Will McGugan
c57386d644 not draft 2022-11-08 18:00:42 +00:00