Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tree.NodeHighlighted message #1528

Merged
merged 9 commits into from
Jan 10, 2023

Conversation

davep
Copy link
Contributor

@davep davep commented Jan 9, 2023

Adds a Tree.NodeHighlighted message, which differs from Tree.NodeSelected in that the latter is emitted if the user clicks on a node, or hits Enter on a node. The new message allows other widgets to react to the user simply cursoring through a collection of nodes.

In doing this I've also reduced some of the duplication of effort when it comes to declaring Tree node messages. I've also added some minimal unit tests for Tree messages.

davep added 5 commits January 9, 2023 11:47
I'm about to work on Textualize#1400 and it seems like a good idea to put some tests
in place first to ensure nothing gets disturbed.
All three do the same thing, so we may as well give them a common base;
especially given that we're about to go and add yet another message that'll
do the same thing again but only (because we need it to) differ in name.
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 Textualize#1400.
@davep davep linked an issue Jan 9, 2023 that may be closed by this pull request
@davep davep marked this pull request as draft January 9, 2023 13:11
@davep davep marked this pull request as ready for review January 9, 2023 13:43
@davep davep merged commit 4c75d1c into Textualize:main Jan 10, 2023
@davep davep deleted the tree-node-highlighted-message branch January 10, 2023 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Tree] Add NodeHighlighted message
2 participants