Textualize / textual

The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.
https://textual.textualize.io/
MIT License
24.07k stars 741 forks source link

`Tree.select_node` doesn't select the node, it highlights it #4660

Open darrenburns opened 2 weeks ago

darrenburns commented 2 weeks ago

The Tree message names make a distinction between highlighting a node and selecting a node.

This method name strongly suggests it'll select a node, but in reality it only highlights it (moves the cursor to a node).

I'd suggest renaming to something like move_cursor(node).

TomJGooding commented 2 days ago

The docs do say that this will only "move the cursor to the given node", but the method name is perhaps a bit confusing.

darrenburns commented 20 hours ago

True - I think the problem is we're confusing the naming since we have a message called NodeSelected which does not get posted here.

I think renaming this to something like move_cursor(node) would be clearer.