Skip to content

feat: persist git-fsa directory handle - #1273

Merged
streamich merged 1 commit into
streamich:masterfrom
lux-in-tenebris-lucet:feat/git-fsa-persist-handle
Aug 4, 2026
Merged

feat: persist git-fsa directory handle#1273
streamich merged 1 commit into
streamich:masterfrom
lux-in-tenebris-lucet:feat/git-fsa-persist-handle

Conversation

@lux-in-tenebris-lucet

Copy link
Copy Markdown
Contributor

Summary

Update the browser Git + File System Access demo so it can remember and reopen the selected folder.

This pattern is useful for browser-based Git clients, editors, IDEs, local-first apps, and content tools that work directly with user folders. Those products can resume the same folder after a reload instead of asking users to select it again or accidentally initializing the demo repository twice.

What changed

  • Store the selected directory handle in IndexedDB.
  • Restore access automatically when permission remains granted.
  • Provide reconnect and forget actions when permission must be restored.
  • Reopen an existing demo repository without creating another initial commit.
  • Repair the demo's browser build after the monorepo migration and remove its unused worker.
  • Document the run command and manual test flow.

Why

The existing demo was a one-time flow: it forgot the selected folder on reload and always tried to create a new /repo directory. Its browser build also referenced an old worker path and did not handle the node: imports used by the current workspace packages.

Testing

  • yarn test — 87 suites and 1,244 tests passed
  • yarn typecheck
  • yarn prettier:check
  • yarn build
  • yarn workspace memfs webpack --config ./demo/git-fsa/webpack.config.js
  • Manually created the demo repository, reloaded the page, reopened the saved folder, and verified that only one initial commit existed

@lux-in-tenebris-lucet
lux-in-tenebris-lucet marked this pull request as ready for review July 30, 2026 12:46

@streamich streamich left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@streamich
streamich merged commit fa47ecc into streamich:master Aug 4, 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.

2 participants