Skip to content

feat(web): add installable offline workspaces#528

Open
murongg wants to merge 24 commits into
mainfrom
feature/pwa-offline-workspaces
Open

feat(web): add installable offline workspaces#528
murongg wants to merge 24 commits into
mainfrom
feature/pwa-offline-workspaces

Conversation

@murongg

@murongg murongg commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add an installable PWA shell with generated service worker, navigation fallback, and static precaching
  • add persistent browser-local workspaces backed by IndexedDB, including writable virtual file handles and session/tab restoration
  • import directory uploads into the local workspace when direct directory picking is unavailable, and export complete workspaces as ZIP archives
  • render relative Markdown and raw HTML images from browser workspace assets, including parent-relative paths, path-change refreshes, and file-tree image previews
  • harden concurrent creates, moves, stale handles, interrupted imports, autosave failures, offline workspace recovery, and stale async image reads
  • make normal and recent folder switching transactional across discard confirmation, file-tree/session changes, draft cleanup, persistence, and stale concurrent requests
  • resolve forward-slash UNC image paths on Windows desktop without changing Web scheme-relative URL behavior
  • document offline storage behavior, export, fallback handling, and privacy boundaries

Why

The Markra web app could not provide a durable, writable offline workspace on browsers such as Android Chrome, and relative static assets in imported Markdown rendered as broken images. This adds an app-managed local workspace so Markdown documents and assets remain editable and readable without server access or whole-folder write permissions.

Validation

  • pnpm test — 214 test files and 2,470 tests passed
  • pnpm typecheck:test — all workspace test TypeScript checks passed
  • pnpm build — all workspace builds passed
  • Web PWA verification passed with 103 unique shell/static precache URLs and one navigation fallback
  • Desktop vendor-chunk verification imported 15 chunks successfully
  • independent concurrency-focused code review found no blocking issues

Risk

  • User documents are stored in browser-managed IndexedDB and can be removed by browser/site-data cleanup; ZIP export provides a portable backup path.
  • Runtime caching is intentionally limited to the app shell and static assets; user/network data is not cached by the service worker.
  • Browser workspace image previews are materialized as data URLs, so image-heavy documents incur corresponding browser read and memory cost.
  • Parent-relative image paths are constrained to the selected browser workspace root.
  • Native mobile install UI and physical-device Android directory import should receive release acceptance coverage.

Closes #520

@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markra-web Ready Ready Preview, Comment Jul 15, 2026 4:50am

Stage folder loads until discard confirmation is stable, and serialize workspace persistence so canceled or stale opens cannot misalign state.
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.

[Feature]: PWA offline

1 participant