Skip to content

fix: auto-reveal active file in folder tree on tab click + open - #95

Merged
ozgesolidkey merged 1 commit into
mainfrom
fix/reveal-active-file-on-tab
Aug 13, 2026
Merged

ozgesolidkey merged 1 commit into
mainfrom
fix/reveal-active-file-on-tab

Conversation

@ozgesolidkey

Copy link
Copy Markdown
Contributor

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

  • Automatic now: reveal fires on tab switch and on file open, not just the button.
  • When the active file isn't under any open folder root, its parent directory is auto-added as a root (deduped) so there's always something to reveal.
  • Quiet "auto" mode: no toasts; only scrolls + flashes when the Folders panel is already the active panel (won't hijack whatever panel you're viewing). The explicit 🎯 button still brings the Folders panel forward + scrolls + flashes.
  • addFolderByPath gains opts.revealPanel so the auto path adds a root without stealing the panel; new helpers findHostFolder() + 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

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
ozgesolidkey merged commit c719a5f into main Aug 13, 2026
3 checks passed
@ozgesolidkey
ozgesolidkey deleted the fix/reveal-active-file-on-tab branch August 13, 2026 10:17
ozgesolidkey added a commit that referenced this pull request Aug 19, 2026
fix: auto-reveal active file in folder tree on tab click + open
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.

1 participant