fix: auto-reveal active file in folder tree on tab click + open - #95
Merged
Merged
Conversation
The 🎯 reveal button only worked when the file's folder was already added to the tree; opening a file directly (the common case) left nothing to reveal, so it silently toasted "add its folder first" — which read as "not working". Rework: - revealActiveFileInTree is now async and, when the file isn't under any open folder root, auto-adds its parent directory as a root so there is always something to reveal (deduped via addFolderByPath). - Fires automatically on tab switch (switchToTab) and on file open, in a quiet "auto" mode: no toasts, and it only scrolls/flashes when the Folders panel is already the active panel (won't hijack whatever panel the user is looking at). The explicit 🎯 button still brings the Folders panel forward and scrolls+flashes. - addFolderByPath gains an opts.revealPanel flag so the auto path can add a root without stealing the panel; returns whether a root exists. - New helpers findHostFolder() + parentDirOf(). tsc 0 · 663 tests green · bundle built. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ozgesolidkey
added a commit
that referenced
this pull request
Aug 19, 2026
fix: auto-reveal active file in folder tree on tab click + open
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.
Why
The 🎯 reveal button (shipped in #94) only worked when the file's folder was already added to the tree. Opening a file directly — the common case — left nothing to reveal, so it silently toasted "add its folder first". To the user that read as "reveal is not working", and tab-clicking did nothing at all.
What
addFolderByPathgainsopts.revealPanelso the auto path adds a root without stealing the panel; new helpersfindHostFolder()+parentDirOf().Verify
tsc 0 · 663 tests green · bundle built. Needs a GUI eyeball: open a file, switch tabs, confirm the tree expands + highlights + scrolls to the active file (with the Folders panel open).
🤖 Generated with Claude Code