Skip to content

feat(admin): folder tree picker for Add Library - #1003

Merged
ajslater merged 4 commits into
developfrom
folder-picker-treeview
Oct 29, 2026
Merged

ajslater merged 4 commits into
developfrom
folder-picker-treeview

Conversation

@ajslater

Copy link
Copy Markdown
Owner

Summary

The Add Library dialog's combobox folder picker becomes a VTreeview rooted at the server's default folder.

  • Backend (AdminFolderListView): a folder the server can see but not list answered "Server Error" with a logged traceback; it is now a 400 "Permission denied" keyed to path. Folders sort ignoring case, and the listing gains parentFolder (null at a filesystem root) in place of the .. entry.
  • Tree (server-folder-tree.vue): one click chooses and opens a folder and lazy-loads its children; Parent folder climbs while keeping what was already loaded; Enter on a typed path re-roots there; a bad path shows the server's reason under the field. Folders an existing library covers are disabled with a bookshelf icon and say why. Nothing is chosen on open, because the default folder is the newest library's parent and always failed validation.
  • Show Hidden Folders refreshes in place: the root and open folders refetch and stay open, closed folders list with the new setting when opened, and hiding never hides the open way to the chosen folder.
  • Cap: past 200 children the rest collapse into a disabled "N more folders, type the path above" leaf. VTreeview is not virtualized; in a production build 200 children open in about 0.6s, while 500 took up to 1.5s, and indent lines cost another third, so they are off.
  • Removed: the old server-folder-picker.vue, the store's folderPicker / loadFolders / clearFolders, and the server's .. entry.

Test plan

  • New specs: server-folder-tree (13 cases: default root, lazy load, leaves, cap, library nodes, choosing, Enter, bad path, Parent, Show Hidden in place and keeping the chosen branch, node-load errors); backend test_admin_folder_list (casefold order, hidden folders, parentFolder, null at /, permission error shape).
  • make lint, make ty, make test-frontend, make build-frontend, make test pass.
  • Checked in a dev stack and a production build at desktop and phone width: a 5,000-subfolder directory, keyboard (arrows, Enter activates and expands without submitting, Escape closes only the dialog), and creating a library end to end from the tree.

🤖 Generated with Claude Code

ajslater and others added 4 commits October 29, 2026 15:08
A folder the server can see but not list answered "Server Error" with a
logged traceback; it is now a 400 "Permission denied" keyed to the path.
Folders sort ignoring case, so dc sorts next to DC, and the listing names
its parent folder (null at a filesystem root). ".." stays for the current
picker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Experiment. A VTreeview rooted at the server's default folder replaces
the combobox picker: one click chooses and opens a folder, a Parent
folder button climbs while keeping what was loaded, Enter on a typed
path re-roots there, and Show Hidden Folders refetches. Folders an
existing library covers are disabled and say so. Nothing is chosen on
open, since the default folder is the newest library's parent. Past 200
children the rest collapse into a "type the path" leaf, which keeps a
5,000-folder directory opening in about 0.6s. The old picker stays until
the go/no-go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Toggling it re-rooted the tree at the chosen folder, collapsing
everything above and beside it. It now refetches the root and each open
folder with the new setting and keeps them open; a closed folder lists
with the new setting when it is opened. Hiding never hides the way to
the chosen folder, so unchecking it deep inside .claude keeps the open
branch down to the choice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The folder tree replaces it. With it go the store's folderPicker state,
loadFolders and clearFolders, and the server's ".." entry: the tree
climbs with parentFolder instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ajslater
ajslater merged commit d5a8573 into develop Oct 29, 2026
9 checks passed
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