0.5.1: a hovered row, and a tree that says which rows it drew - #87
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
treetakesonRow(node, index, y)like the table, so a click on a scrolled tree can be mapped back to a node. Table, list and tree takehovered, drawn a shade lighter and always losing to the selection, and every scrollable widget takesonHoverRowto feed it. The tree also gainedscrollbar, and the test screenhover(x, y).Nothing renders differently unless
hoveredis 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