Skip to content

fix(explorer): keep the highlighted nested search match on Enter - #360

Merged
Maxteabag merged 2 commits into
mainfrom
fix/333-nested-explorer-selection
Nov 27, 2026
Merged

Maxteabag merged 2 commits into
mainfrom
fix/333-nested-explorer-selection

Conversation

@Maxteabag

Copy link
Copy Markdown
Owner

Closes #333. Integrates #335 and the follow-up from liamhawkins#1, preserving the original authors.

Enter now keeps the highlighted match after the tree is rebuilt. Cursor movement waits until Textual has assigned line numbers, including for tables nested beneath a connection.

Checked on the current main base with the explorer filter and Textual pilot tests. In the recorded SQLite terminal comparison, searching for warehouse and pressing Down twice followed by Enter selected warehouse_transfers with the combined changes.

liamhawkins and others added 2 commits November 27, 2026 15:15
…r it

While the explorer filter is open, arrow keys move the tree cursor, but
Enter activated the node at _tree_filter_match_index, which only n/j
advance. Enter therefore always opened the first match. Accept now uses
the tree's cursor_node.

After accepting, scroll the selected node to the vertical center of the
explorer instead of leaving it on the bottom row.

Fixes #333.
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 #333.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Maxteabag
Maxteabag merged commit 8bebddd into main Nov 27, 2026
23 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.

UX Improvement: Explorer Search Only Navigates To First Match

3 participants