Skip to content

feat(blazor): reflect current folder hierarchy in the URL#171

Merged
phmatray merged 1 commit into
devfrom
feature/url-folder-hierarchy
Jun 2, 2026
Merged

feat(blazor): reflect current folder hierarchy in the URL#171
phmatray merged 1 commit into
devfrom
feature/url-folder-hierarchy

Conversation

@phmatray
Copy link
Copy Markdown
Contributor

@phmatray phmatray commented Jun 2, 2026

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=…).

  • Home reads the path query parameter (OnParametersSet) to set the current folder on load / back-forward.
  • When navigation happens through state (opening a folder, breadcrumb, import), Home pushes the matching URL so the address bar stays in sync (loop-guarded).
  • Recent / Starred / Search navigate to the folder URL instead of /.
  • VFSStateService.ToFolderUrl / FromQueryPath convert between the vfs:// scheme and the query path.

Test plan

  • Build succeeds (dotnet build of the app, 0 errors).
  • Verified live in the running app: opening src changed the URL to /?path=src with breadcrumb My Files › src; reloading /?path=src restored 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

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>
@phmatray phmatray merged commit bd50ae7 into dev Jun 2, 2026
1 check passed
@phmatray phmatray deleted the feature/url-folder-hierarchy branch June 2, 2026 12:57
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