Repository navigation
feat: FileTree, an Explorer over a list of paths - #498
Merged
Merged
Conversation
VS Code's Explorer as a widget, built on TreeView. The host hands it a flat
list of FileEntry (path, folder, size) through the Entries() Observable; the
tree shows folders first, then files, by name, and keeps which folders are
collapsed across updates. Every change is a FileRequest given to OnRequest
(open, create file or folder, rename, delete, move, import); the tree never
edits its own list, so the host's store stays the one source of truth.
Selected() is the selected path, both ways.
- Keys follow the WAI-ARIA APG treeview pattern (TreeView's arrows,
Home/End, Enter), plus type-ahead (one character steps through the
matches, quick characters match as a string) and * to expand the
siblings; F2 renames, Delete (or Cmd+Backspace) asks to delete,
Shift+F10 / the menu key opens the context menu.
- Rename and New File/Folder are typed in place, validated with the
Explorer's rules and wording (empty, leading slash, invalid name, already
exists, a folder into itself; whitespace is a warning).
- Delete asks first, in a footer with Delete/Cancel ("... and its
contents?" for a folder).
- Context(x, y) opens New File, New Folder, Rename, Delete and the host's
MenuExtra items.
- A row dragged onto a folder (or a file: its folder) moves there; a press
on a folder opens it on release, so a dragged folder does not toggle.
- Files from outside (EventDragStart/Move/Drop) go to the folder under the
pointer, outlined meanwhile; DropDirAt answers the host that reads the
bytes. The outline keeps >= 3:1 against the surface in light and dark
(the accent, else PopupBorder); a blocking message uses a red with
>= 4.5:1, else the text colour.
- Icon picks an icon pack's glyph per entry; the default is Iconoir's folder
and page. ShowSizes prints sizes (FileSizeText); long names elide.
Draw costs ~100 us for 5000 entries at 600 px (TreeView is windowed).
100% coverage.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tannevaled
force-pushed
the
feat/filetree
branch
from
October 22, 2026 08:17
ff4cf9d to
5815da2
Compare
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.
A file explorer widget for the go-slides playground's new file panel (themes, kinds, media), generic enough for any app holding a project in memory.
What it is.
FileTreeshows a flat list ofFileEntry(path, folder, size) as VS Code's Explorer does: folders first, then files, by name, with collapse state kept across updates. It never edits its own list. Every change goes out as aFileRequest(open, create, create folder, rename, delete, move, import), the host applies it to its store, then setsEntries().Selected()is an Observable in both directions.Interactions.
*expands siblings. Explorer keys on top: F2, Delete / Cmd+Backspace, Shift+F10 / the menu key.validateFileNameand uses its messages (src/vs/workbench/contrib/files/browser/fileActions.ts).MenuExtra).DropDirAtlets the host find that folder when it reads the bytes.Light/dark.
PopupBorder. This is tested acrosspopupThemes().Performance. One Draw takes about 100 µs with 5000 entries at 600 px, since the TreeView is windowed.
Tests. 100% coverage.
🤖 Generated with Claude Code