Skip to content

Save button announces success on failed and no-op saves #41

Description

@BootBlock

The Save button announces success unconditionally, including when the save failed or when there was nothing to save.

src/ui/shell/TransportBar.tsx:

onClick={() => {
  void useProjectStore
    .getState()
    .saveNow()
    .then(() => announce('Project saved'));
}}

AutosaveQueue.flushNow() is documented and implemented to never reject: on failure it catches, re-queues the batch, calls onError and returns false; flushNow re-arms and returns. So:

  • A failed write resolves the promise → "Project saved" is announced.
  • With a null queue (see the session-boot issue) saveNow() is await queue?.flushNow() → resolves instantly → "Project saved" is announced when there is no project at all.

There is no .catch on the chain, and the boolean flushNow returns is discarded.

§4.4 requires saveNow() to be surfaced in the UI. It is surfaced — but it reports success it has not verified, which is worse than not reporting at all, because the user stops checking.

Suggested fix

Have saveNow() propagate the outcome (return the flushNow boolean, or reject) and announce accordingly — "Project saved", "Save failed — retrying", or "Nothing to save". The autosave onError toast already knows a failure happened; the explicit Save path should not contradict it.

Metadata

Metadata

Assignees

Labels

accessibilityScreen-reader, keyboard, and assistive-technology correctness (spec 8.2)autosavebugSomething isn't workingdata-lossCan lose or silently corrupt the user's workuiRelated to the user interface

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions