feat(blazor): reflect current folder hierarchy in the URL#171
Merged
Conversation
The file browser's current directory is now encoded in the URL as ?path=docs/src, making navigation deep-linkable: refreshing, sharing, or using browser back/forward restores the folder you're in. The Home page reads the `path` query parameter to drive the current folder on load, and pushes the matching URL whenever navigation happens through state (folder open, breadcrumb, import). Recent/Starred/Search now navigate to the folder URL instead of "/". Adds VFSStateService.ToFolderUrl / FromQueryPath helpers (scheme<->query path). Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Summary
Encodes the file browser's current directory in the URL as
?path=docs/src, so navigation is deep-linkable — refresh, share, and browser back/forward restore the folder you're in. Consistent with the app's existing query-string routes (/file?path=…,/search?q=…).Homereads thepathquery parameter (OnParametersSet) to set the current folder on load / back-forward.Homepushes the matching URL so the address bar stays in sync (loop-guarded)./.VFSStateService.ToFolderUrl/FromQueryPathconvert between thevfs://scheme and the query path.Test plan
dotnet buildof the app, 0 errors)./?path=srcwith breadcrumbMy Files › src; reloading/?path=srcrestored the folder location. (Folder contents reset on full reload because the demo VFS is in-memory per circuit — the location restore is the feature.)🤖 Generated with Claude Code