Skip to content

Second-tab guard: one Web Lock, read-only banner (#403 Phase A) #450

Description

@maboa

Part of the #403/#404 Phase A push. Two tabs sharing the origin-global OPFS working copy can currently clear each other's project, interleave snapshot writes, and restore each other's work.

Phase A ships the guard, not the architecture: acquire an exclusive Web Lock for the editing lifetime (navigator.locks.request(..., {ifAvailable: true})); a second tab that fails to acquire shows a read-only "This project is open in another tab" banner and disables editing/autosave. Web Locks release automatically on tab death, which is the browser's process-liveness equivalent — a crashed owner's work directory becomes a recovery candidate on next boot.

Deferred to Phase B (tracked in the follow-up umbrella): per-project work directories, BroadcastChannel focus/fork UX, recovery chooser. Web Locks require a secure context and are available from Safari 15.4.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions