Darren Burns
61bf8c8a5a
Merge branch 'main' of github.com:willmcgugan/textual into datatable-cell-keys
2023-01-30 15:51:51 +00:00
Will McGugan
475cd4fb1b
Merge pull request #1644 from davep/tree-deeply
...
Add support for a method of expanding/collapsing all tree nodes from a given node down
2023-01-30 16:27:06 +01:00
Dave Pearson
cbe62fadc3
Add unit tests for all the expand/collapse/toggle Tree methods
2023-01-27 13:28:25 +00:00
Will McGugan
3eac79568c
remove some pauses
2023-01-26 16:10:13 +01:00
Darren Burns
297119d9b6
Merge branch 'main' of github.com:Textualize/textual into datatable-cell-keys
2023-01-26 14:02:09 +00:00
Darren Burns
2725074194
Sorting imports in tests for DataTable
2023-01-24 11:43:13 +00:00
Darren Burns
6ea3380e8f
Increase a pause in a Tree test
2023-01-24 11:36:24 +00:00
Dave Pearson
4adfe69ec9
Remove TreeNode as a pseudo-widget
...
This encourages importing it from `textual.widgets.tree` instead, keeping it
in line with the other changes made for #1637 .
Note this is a breaking change.
2023-01-23 17:37:58 +00:00
Dave Pearson
d0ea967aa4
Merge branch 'get-treenode-by-id' of github.com:davep/textual into get-treenode-by-id
2023-01-10 15:30:12 +00:00
Dave Pearson
494c63a72b
Tweak the unknown node ID exception
...
See https://github.com/Textualize/textual/pull/1535#discussion_r1065904713
and https://github.com/Textualize/textual/pull/1535#discussion_r1065909144
2023-01-10 15:28:17 +00:00
Dave Pearson
c027a06ee2
Merge branch 'main' into get-treenode-by-id
2023-01-10 14:59:36 +00:00
Dave Pearson
728acc27c0
Introduce an exception specific to handling an unknown node ID
...
See https://github.com/Textualize/textual/pull/1535#discussion_r1065873649
2023-01-10 14:57:35 +00:00
Dave Pearson
6ea68cc112
Add Tree.get_node_by_id
...
The thinking here is that a user of a Tree may want to relate notes to other
parts of their UI, or other data in their application. While this could be
done by keeping a reference to the node itself, it could also be beneficial
to just track the ID. Given that ID is a public property of a TreeNode, but
given it doesn't currently have any other (public) purpose, this seems to
add some useful symmetry.
2023-01-10 10:42:07 +00:00
Dave Pearson
489ba10c8a
Sprinkle some pauses into the node message tests
2023-01-09 13:36:29 +00:00
Dave Pearson
346659f47f
Move typing of the tree into its own class
2023-01-09 13:28:25 +00:00
Dave Pearson
c00a6da90d
Check if I need to import from the future for Python 3.8
2023-01-09 13:13:54 +00:00
Dave Pearson
151673cd53
Remove empty docstring
2023-01-09 13:12:57 +00:00
Dave Pearson
0cf299540f
Add a message for when a node is highlighted
...
This is sort of different from selected. Selected is when someone mashes the
enter button or clicks on a node. Highlighted is when the cursor moves into
a new node.
See #1400 .
2023-01-09 12:54:57 +00:00
Dave Pearson
6f10c63bb0
Perform tests on all recorded tree events
2023-01-09 12:54:26 +00:00
Dave Pearson
34ff6bf260
Add some unit tests for Tree messages/event handling
...
I'm about to work on #1400 and it seems like a good idea to put some tests
in place first to ensure nothing gets disturbed.
2023-01-09 11:47:40 +00:00
Dave Pearson
ea8252cfcc
Run black over recent Tree tests
...
Now that we're running black on tests...
2023-01-07 09:30:01 +00:00
Dave Pearson
82dcf62122
Merge pull request #1495 from davep/tree-node-children-prop
...
Add read-only access to the children of a `TreeNode`
2023-01-06 15:17:39 +00:00
Will McGugan
428ae0e14e
Merge branch 'main' into tree-node-parent-prop
2023-01-06 02:11:35 -08:00
Dave Pearson
e5869b9f7b
Merge branch 'main' into tree-node-children-prop
2023-01-06 06:18:15 +00:00
Dave Pearson
7779211dcf
Add read-only access to the children of a TreeNode
...
See #1398 .
2023-01-05 21:24:47 +00:00
Dave Pearson
27a7cfc489
Add a public read-only parent property to TreeNode
...
See #1397 .
2023-01-05 10:35:25 +00:00
Dave Pearson
d39c59c414
Move the TreeNode label tests into a better-named file
...
There's going to be a whole bunch of tests relating to the Tree and TreeNode
coming, let's make sure this ends up being fairly granular.
(side thought: it might be a good time soon to revisit all the tests for
Textual and try and wrangle them into some tidy structure)
2023-01-05 10:01:52 +00:00