Show a saved layout and record it as active and recent, unless it already is. A change still waiting for the quiet period is autosaved into the layout being left first; when that write fails this rejects and changes nothing, and opening again goes ahead without it. A refused apply resolves with its report and leaves the target and the held layout as they were; when the store refuses the record, the previous layout goes back on the target and this rejects. It rejects too while the target is suspended.
Reload, then write the target over the held layout, whatever another session saved there.
Read the catalog again, and resolve with a copy of it. The target is not
touched. A paused autosave resumes, unless the held layout conflicts.
After a page load, open(catalog.activeWorkspaceId) continues on the
layout that was active.
Write the target into the held layout. Rejects when no layout is held, and while it conflicts.
Save the target as a new layout, which becomes the held, active one.
Called after the state changes. Returns the unsubscribe.
Operations run one at a time, in call order, each checked against the revision the previous one left, so a burst of clicks never interleaves.
A write the store refuses because the catalog moved (another tab, another control on the page) is tried again on the newer catalog when what it acts on is unchanged there: the held layout for a save, the named layout for rename, duplicate, remove and open. Only a change to that is a conflict.