Repository navigation
Make the TUI Tab ring follow the Responsive variant actually drawn - #34
Merged
Merged
Conversation
The renderer picks a Responsive variant from its pane's width, but the focus ring re-decided it from the terminal width, so inside a Sidebar or Split pane Tab could land on a control that was not drawn while the drawn one was unreachable. The renderer now records each Responsive element's pick in tree order, and the focus ring follows those picks, falling back to the terminal width only for elements not yet rendered. The ring is rebuilt after each render. Closes #33
4 tasks done
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.
Summary
Fixes #33. The renderer picks a Responsive variant from the width of its pane, but
collectFocusablesre-decided it from the terminal width. Inside a Sidebar or Split pane they disagree: at 100 columns a 24-cell sidebar draws[ Small ], but Tab focusedbtn:Big, a control that wasn't drawn, and the drawn button was unreachable.tuiRenderer.picks). It restores them like the button keys when a collapsed Row re-renders its children.collectFocusablesfollows those picks, and uses the terminal width only for Responsive elements the last frame did not cover.View()rebuilds the ring after rendering, so it always matches the frame on screen. Key and mouse handling between frames use the last frame's picks.ResponsiveEl.pickIndex/varianthelpers;pickis built on them.Test plan
TestTabRingFollowsTheVariantThePaneDraws: Tab focuses and Enter activates the drawnSmallbutton. With the ring fed no picks, it fails with "Tab focused btn:Big".go test -race ./...,make e2e, both vets