feat(library): open on the org home folder, system folders inside it - #5381
Open
vibegui wants to merge 1 commit into
Open
feat(library): open on the org home folder, system folders inside it#5381vibegui wants to merge 1 commit into
vibegui wants to merge 1 commit into
Conversation
The Library leaked its implementation. It opened on a synthetic "root" view
listing *volumes* — a card named after the org slug ("Your organization's home
folder") next to uploads/outputs/public, with "Recently added" pushed above
them. Clicking the org card navigated to browse path `home`, so the breadcrumb
and the `<h1>` both read "home" — a word no member has any reason to connect to
their org. The folder name was rendered twice, and the search box promised
"Search all files" from three folders deep.
- Lands on the org's home folder, named after the org. The `path=""` root view
is gone; home is the top of the tree and the breadcrumb starts there.
- uploads / outputs / public render as system folders *inside* home, in a
graphite folder tone so "the product fills this" reads at a glance. `public`
presents as "skills". Mounts and browse paths are unchanged.
- Drops the duplicate `<h1>`; the breadcrumb is the only name, and the search
box moves into that row.
- Search now really scopes: `volume` + `prefix` params on GET /fs/search thread
down to a `pathPrefix` filter in `searchFiles`, so "Search files in decks"
searches decks. Global at the home root, as the placeholder says.
- "Recently added" moves to the bottom of home, and only appears there — it's
cross-volume, so it would be a lie inside a single folder.
Two bugs the restructure exposed, fixed here:
- mkdir and drag-move were bound to the *upload* volume. Now that home is a
real browsable folder, "New folder" at the landing view would have created in
`uploads`; they bind to the browsed volume instead. Uploads still target
`uploads` from the landing view, per the previous behavior.
- The empty-area right-click-to-create-folder gate fired at the root, which now
has entry cards under it — it would have opened rename *and* new-folder
together. It keys off `defaultPrevented` (which the cards already set).
Also fixes "See in library", dead since it set a `main: "library:<path>"` tab
id no parser handles, and translates its hardcoded label.
Verified end-to-end against a real dev server + Postgres (signup, seeded files
across volumes, walked home → folder → system folder → skills, confirmed the
scoped search returns 1 result where the global one returns 5, and that a new
folder at the landing view lands in `home`).
Co-Authored-By: Claude <noreply@anthropic.com>
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 Library leaked its implementation at every turn:
uploads/outputs/public— with Recently added pushed above them. Folders, the thing you actually came for, were below the fold.home, so the breadcrumb and the<h1>both read "home". Nobody knows that{org_name}==home.What changed
path=""root view is deleted — home is the top of the tree, and the breadcrumb starts athomeDisplayName(org.slug). Nothing in the UI says "home".uploads/outputs/publicare system folders inside home, in a graphite folder tone (vs Finder-blue for folders people make) so "the product fills this" reads at a glance.publicpresents as skills. Mounts and browse paths are untouched —orgFsMountPathand the agent-facingorg/home/…paths are unchanged.<h1>gone. The breadcrumb is the only name; the search box moves into the reclaimed header row.volume+prefixquery params onGET /fs/searchthread down to a newpathPrefixfilter insearchFiles. Global at the home root ("Search all files…"), scoped to the current subtree everywhere else ("Search files in decks…") — the label now matches the behavior instead of lying about it.Two bugs the restructure exposed
Both are consequences of home becoming a real browsable folder, fixed in this PR rather than left for a hardening pass:
mkdir/movewere bound to the upload volume. "New folder" at the landing view would have created the folder inuploads, and drag-move at home would have moved within the wrong volume. They now bind to the browsed volume. Uploads still targetuploadsfrom the landing view (unchanged behavior).defaultPrevented, which the cards already set.Also fixes "See in library" — dead since it set
main: "library:<path>", a tab id no parser handles — and routes its hardcoded English label throught().Screenshots
{org} > decks, placeholder scopes to the folder."sales"insidedecks→ 1 result.Testing
location.test.tsgainsisHomeRoot+segmentLabelcases.searchWithEffectivePubliccase covers prefix scoping: recursive under the dir, a same-prefix sibling dir (reports-archive) excluded,_treated literally, and composition with volume narrowing. Verified it fails when the prefix filter is removed.home/uploads/outputs→ walk home → folder → system folder → skills. Asserted the landing view names the org and has no<h1>, section order isFolders, Files, Recently added, the scoped search returns 1 where the global returns 5,skillsis read-only with no write actions, and a new folder created at the landing view lands inhome(checked over the API, not just the UI).bun run fmt,bun run check,bun run lint(same 16 pre-existing warnings, 0 errors),bunx knipclean.bun test apps/web/src: 2173 pass / 23 fail vs. baseline 2171 / 23 — same pre-existing failures, +2 from the new tests.Docs
studio/library.mdx(en + pt-br) rewritten to describe the home-first tree, the system folders, and the scoped search. The sandbox mount table now shows<your-org>/uploads → org/uploadetc., making explicit that the presentation moved and the mounts did not.Deliberately skipped
publicsets listing (stays global there —volume === null).path/skill/brandin the routevalidateSearchschemas. Verified in@tanstack/router-corethat unknown params survive both navigation and reload ({...parentSearch, ...strictSearch},search.strictunset) — which is why?skill=works today. Unchanged by this PR either way.🤖 Generated with Claude Code
Summary by cubic
Open the Library directly in your org’s home folder and show
uploads/outputs/publicas system folders inside it. Search now scopes to the current folder (or stays global at home) for results that match the placeholder.New Features
publicpresents as “skills” and is read-only. Mounts and browse paths are unchanged.GET /fs/searchacceptsvolumeandprefixto filter by volume and directory subtree; cross-volume at home, scoped elsewhere.Bug Fixes
uploads); uploads from the landing view still go touploads.path, and its label is localized.Written for commit a7d892f. Summary will update on new commits.