[Feature Request] Right-pane file tree should reveal and highlight the file open in the editor

Author: karimodmCreated Sep 22, 2026Updated Sep 22, 2026
Labelsenhancement

Corrected 2026-09-22. The first version of this issue claimed the tree neither highlights nor expands towards the active file. That was wrong, and the text below is the corrected report — see the comment thread.

Problem

Open a file in the right context panel, and the tree beside the editor never scrolls to it. The row is selected and its directories are expanded, but if the row is outside the visible part of the tree nothing brings it into view, so switching tabs tells you nothing about where the file lives. In a repository with a few hundred files that means the file you are reading cannot be found in the tree without walking the folders by hand.

The same applies to a file opened from anywhere other than the tree — a chat file reference, the file search palette, a diff, a tool call.

What already happens today, for the record:

  • ContextPanel.tsx:786 mirrors the active file tab into useFilesViewTabsStore.selectedPath, so the row is highlighted.
  • The mounted file editor's ensurePathVisible (FilesView.tsx) expands the ancestor directories into that same store, so the row exists.
  • Nothing scrolls the tree to it. SidebarFilesTree has no scroll-into-view of any kind.

Measured on a build of main, with two files open from different deep folders and the tree scrolled to the top: switching tabs leaves the tree at scrollTop 0 both times, while the row for the newly active file sits ~1200px and ~3000px down.

Expected

The last step of VS Code's explorer.autoReveal / JetBrains' "Always Select Opened File": when the active file tab changes, scroll the tree to that file's row — and only when it is off screen (scrollIntoView({ block: 'nearest' })), so a row that is already visible does not move.

Notes on scope:

  • Should apply whatever made the tab active (tab click, tab close falling back to a neighbour, a file opened from chat/diff/search), not just tab clicks.
  • Should not run while the search filter is showing its flat result list, or while the tree column is hidden.
  • Should not fight the user: only the active file tab drives it; non-file tabs (diff, plan, terminal, …) leave the tree alone, and the tree stays put after the user scrolls it, until the editor moves to another file.

Environment

OpenChamber main (336e19248 at time of writing), web + desktop, right context panel with the editor tree column visible.