Commit Graph

915 Commits

Author SHA1 Message Date
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
Will McGugan
86e8738882 Merge pull request #1517 from Textualize/call-in-thread
Call from thread method
2023-01-09 02:47:50 -08:00
Rodrigo Girão Serrão
b3495c6e92 Merge pull request #1509 from Textualize/fix-1508
Simplify Placeholder implementation
2023-01-08 11:19:29 +00:00
Will McGugan
467953b1c4 Merge pull request #1503 from Textualize/cursor-blink-bug
Converting cell position to index
2023-01-07 07:43:32 -08:00
Will McGugan
702640fd2e Merge pull request #1514 from davep/blackify-isv-test
Run black over recent immutable sequence view tests
2023-01-07 07:43:14 -08:00
Will McGugan
e11f563123 docstrings 2023-01-07 14:24:17 +00:00
Will McGugan
fd9c1de3e2 Call from thread method 2023-01-07 14:04:52 +00:00
Rodrigo Girão Serrão
4c3eb3e021 Update placeholder snapshot test.
Although there was no visual difference in the output, the snapshot tool was complaining because there are now less things to draw on the screen, thus the snapshots looked different. Hence, the placeholder snapshot needed to be updated.
2023-01-07 09:35:41 +00:00
Dave Pearson
53df47b401 Rename ImmutableSequence to ImmutableSequenceView
Also, in doing so, drop support for unrolling iterators and making them into
indexable sequences.

See the following feedback:

  https://github.com/Textualize/textual/pull/1495#pullrequestreview-1238616797
  https://github.com/Textualize/textual/pull/1495#issuecomment-1373553580
2023-01-07 09:35:41 +00:00
Dave Pearson
12c6129150 Tweak the unit tests for ImmutableSequence
Make it 100% clear that the tests that are about wrapping iterators actually
are wrapping iterators.
2023-01-07 09:35:41 +00:00
Dave Pearson
274bb634ca Only convert to an indexable sequence if absolutely necessary 2023-01-07 09:35:41 +00:00
Dave Pearson
0029470b4b Add read-only access to the children of a TreeNode
See #1398.
2023-01-07 09:35:39 +00:00
Dave Pearson
2c827e18d0 Add a generic immutable sequence wrapper class
In anticipation of satisfying #1398, this adds a generic immutable sequence
wrapper class. The idea being that it can be used to wrap up a list or
similar, that you don't want the caller to modify.

This commit aims to get the basics down for this, and also adds a minimal
set of unit tests.
2023-01-07 09:35:00 +00:00
Dave Pearson
af56d88a6d Add a public read-only parent property to TreeNode
See #1397.
2023-01-07 09:34:56 +00:00
Dave Pearson
b8500de1e9 Run black over recent immutable sequence view tests
Now that we're running black on tests...
2023-01-07 09:32:43 +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
Rodrigo Girão Serrão
d08699ff50 Update placeholder snapshot test.
Although there was no visual difference in the output, the snapshot tool was complaining because there are now less things to draw on the screen, thus the snapshots looked different. Hence, the placeholder snapshot needed to be updated.
2023-01-06 18:30:39 +00:00
Darren Burns
3fe855296c Raise exception from index to cell position method 2023-01-06 16:34:57 +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
Darren Burns
c90e12a35b Remove unused import in test file 2023-01-06 13:59:52 +00:00
Darren Burns
433c86d4b9 Remove unused test file 2023-01-06 13:59:36 +00:00
Darren Burns
733b8934fe Merge branch 'main' of github.com:Textualize/textual into cursor-blink-bug 2023-01-06 13:57:08 +00:00
Darren Burns
1bd720ef0d Index to cell position 2023-01-06 13:55:48 +00:00
Dave Pearson
71cc1bca1e Rename ImmutableSequence to ImmutableSequenceView
Also, in doing so, drop support for unrolling iterators and making them into
indexable sequences.

See the following feedback:

  https://github.com/Textualize/textual/pull/1495#pullrequestreview-1238616797
  https://github.com/Textualize/textual/pull/1495#issuecomment-1373553580
2023-01-06 12:23:51 +00:00
Darren Burns
0abeba620e Method for converting Strip index to cell position 2023-01-06 11:14:15 +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
a15fa7fd01 Tweak the unit tests for ImmutableSequence
Make it 100% clear that the tests that are about wrapping iterators actually
are wrapping iterators.
2023-01-06 06:14:49 +00:00
Dave Pearson
83c0ef73e3 Only convert to an indexable sequence if absolutely necessary 2023-01-06 06:01:59 +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
30d5c1e66b Add a generic immutable sequence wrapper class
In anticipation of satisfying #1398, this adds a generic immutable sequence
wrapper class. The idea being that it can be used to wrap up a list or
similar, that you don't want the caller to modify.

This commit aims to get the basics down for this, and also adds a minimal
set of unit tests.
2023-01-05 21:11:14 +00:00
Dave Pearson
2c6bd88c53 Merge branch 'main' into tree-node-parent-prop 2023-01-05 14:31:51 +00:00
Dave Pearson
b8727a8908 Merge branch 'main' into tree-node-label-prop 2023-01-05 14:30:42 +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
Dave Pearson
b8a329638e Add public access to a TreeNode's label
This adds public support to reading a TreeNode's label, and also setting it
too.

See #1396.
2023-01-05 09:37:08 +00:00
Darren Burns
a6e751c7a4 Merge branch 'main' of github.com:Textualize/textual into cursor-blink-bug 2023-01-04 13:01:31 +00:00
Nitzan Shaked
67d2c8df7d black 2023-01-02 21:59:33 +02:00
Nitzan Shaked
e13ea5e0bd MouseScrollUp/MouseScrollDown => plain MousEvent's
... which means they get passesd x, y, etc. In particular,
they are passed the keyboard modifiers. This allows widgets
to use e.g. ctrl-wheel to scroll right/left.
2023-01-02 21:13:56 +02:00
Will McGugan
91e23ff34c more pauses for demo? 2022-12-30 17:31:36 +00:00
Will McGugan
97627107cf add pause 2022-12-30 15:01:57 +00:00
Will McGugan
57654a90bf fix snapshot 2022-12-29 10:23:34 +00:00
Will McGugan
51c7fef2e1 extend trips to line API 2022-12-29 10:13:37 +00:00
Will McGugan
516ca72ba5 Merge branch 'main' into strip-optimization 2022-12-29 00:48:01 -08:00
Josh Karpel
a45a3dca6a add option to clear columns in DataTable.clear 2022-12-28 20:50:24 -06:00
Will McGugan
5382f5eb49 check len 2022-12-28 15:53:58 +00:00
Will McGugan
8113ff8705 moar tests 2022-12-28 15:44:56 +00:00
Will McGugan
331a0ce65d moar tests 2022-12-28 15:40:00 +00:00