Fix: Auto-scroll to matching items when expanding tree nodes during search - #3
Fix: Auto-scroll to matching items when expanding tree nodes during search#3BenyaminBen wants to merge 1 commit into
Conversation
…earch - Added search term tracking to ObjectBrowser class - Implemented onDidExpandElement handler to detect node expansion - Added reveal() call for first matching child with 50ms delay for DOM rendering - Added 'Set Object Browser Search Term' command as workaround for VS Code API limitation Fixes the issue where tree search highlights matches but doesn't scroll to them when expanding collapsed nodes (libraries/source files).
|
Warning Review limit reachedNext included review available in 57 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
Mirror of codefori#3407 (author: @itsawaz)
Fix: Auto-scroll to matching items when expanding tree nodes during search
🐛 Problem
When using the Object Browser tree search functionality (Ctrl+F):
This creates a poor user experience when searching through large object hierarchies.
✅ Solution
This PR implements automatic scroll-to-match functionality when tree nodes are expanded during an active search session.
What Changed
File:
src/ui/views/objectBrowser.ts(+84 lines)currentSearchTermfield toObjectBrowserclass to track active searchonDidExpandElementlistener that:reveal()to scroll the match into viewcode-for-ibmi.setObjectBrowserSearchTermas workaround for VS Code API limitationHow It Works
User Workflow:
Code for IBM i: Set Object Browser Search TermTechnical Flow:
```
User expands node
→ onDidExpandElement fires
→ Check if search term exists
→ Get children from expanded node
→ Find first child matching search term
→ setTimeout(() => reveal(firstMatch), 50ms)
→ Tree scrolls to show the match
```
🤔 Why the Workaround Command?
VS Code's TreeView API doesn't expose the search term from the native `list.find` search box. The extension has no way to int... (truncated)