[Website] Flush Blueprint edits and suppress hidden editor focus - #4020
Closed
adamziel wants to merge 1 commit into
Closed
[Website] Flush Blueprint edits and suppress hidden editor focus#4020adamziel wants to merge 1 commit into
adamziel wants to merge 1 commit into
Conversation
adamziel
requested review from
a team,
Copilot and
zaerl
and removed request for
Copilot
July 11, 2026 12:38
Collaborator
Author
|
Closing after re-auditing the actual Dock lifecycle. #4009 keeps visited editor surfaces mounted, and hidden file editors remain under |
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.
What it does
Stops hidden file editors from taking focus after an asynchronous file open, and carries the latest Blueprint edit across editor teardown or Playground recreation.
Blueprint writes now use one queued filesystem wrapper per storage backend. A remounted editor waits for writes started by its predecessor before reading the same backend. This PR does not mount, restyle, or otherwise change the Dock UI from #4009.
Rationale
File-open callbacks restore CodeMirror focus after a short delay. When the editor becomes hidden before that callback finishes, the delayed focus previously moved keyboard focus away from the active surface.
Blueprint saves are debounced. If a parent unmounts immediately after a keystroke, the hook cleanup cancels the timer before the write starts. React cleanup cannot wait for that write, so a remounted editor could then read the same OPFS backend first and show stale Blueprint contents.
The editor now flushes the pending call during teardown and awaits it before recreating a Playground. Backend-scoped write serialization makes the teardown handoff safe: failed writes still reach their caller, while later reads and writes remain unblocked.
Testing instructions