Repository navigation
fix(explorer): move the filter cursor to the first match after layout - #1
Open
nihil2501 wants to merge 1 commit into
Conversation
Tree.move_cursor reads node._line, which is only set during the next layout pass, not when add() runs. _jump_to_current_match called it right after each keystroke's snapshot restore, so the cursor stayed on line 0 (the connection). Now that Enter activates cursor_node, filtering to a table under a connection and pressing Enter selected the connection, and arrow presses counted from the connection row. Defer the move via call_after_refresh, as accept already does, and share that deferral in a _call_after_refresh helper. Refs Maxteabag#333. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Builds on Maxteabag#335. Covers the nested case of Maxteabag#333, which the tests in Maxteabag#335 don't reach.
Summary
Typing a filter left the cursor on line 0 instead of the first match. Each keystroke rebuilds the tree from the snapshot, and
_jump_to_current_matchcalledmove_cursorbefore the new nodes had a_line. With top-level connections, line 0 is the first match, so it went unnoticed. With tables under a connection, line 0 is the connection, so with Maxteabag#335:orders, Enter → the connection is selectedorders, Down ×2, Enter → lands two rows shortThe fix uses the deferral
action_tree_filter_acceptalready had, pulled into a helper so both call sites share it:Evidence
300-table SQLite DB, filter
t_29, Down ×3, Enter:t_291t_290, lands ont_293Test plan