Skip to content

0.5.1: a hovered row, and a tree that says which rows it drew - #87

Merged
ralyodio merged 1 commit into
mainfrom
feat/hover-and-tree-rows
Sep 12, 2026
Merged

ralyodio merged 1 commit into
mainfrom
feat/hover-and-tree-rows

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

tree takes onRow(node, index, y) like the table, so a click on a scrolled tree can be mapped back to a node. Table, list and tree take hovered, drawn a shade lighter and always losing to the selection, and every scrollable widget takes onHoverRow to feed it. The tree also gained scrollbar, and the test screen hover(x, y).

Nothing renders differently unless hovered is set, so the port fixtures do not move. Version bump to 0.5.1.

Needed by DiskPush's TUI, whose panes are becoming a folding tree driven by single clicks with a hover highlight.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DWtLsmAescX4Nb8QiBJd37

A folding tree that is driven by the mouse needs two things the widgets did
not offer. A click on a scrolled tree has to be turned back into a node, and
only the tree knows where its window starts, so `tree` now takes the same
`onRow(node, index, y)` the table has had. And a pointer needs a visible
target before anything is pressed, so table, list and tree take `hovered`,
drawn a shade lighter than the background and always losing to the selection,
with `onHoverRow` on every scrollable widget to feed it. The widget only hears
the pointer while it is inside, so the book shows the two-line `mouse`
listener that clears the hover when a move goes unclaimed.

The tree also gained the `scrollbar` the list and table already had, and the
test screen gained `hover(x, y)`.

Nothing renders differently unless `hovered` is set, so the port fixtures do
not move.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DWtLsmAescX4Nb8QiBJd37
@ralyodio
ralyodio merged commit 50c11db into main Sep 12, 2026
14 checks passed
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.

1 participant