Skip to content

diagram: a failed flow-attach patch silently discards the drawn flow #820

Description

@bpowers

Problem

In src/diagram/Editor.tsx, handleFlowAttach early-returns when applyPatchOrReportError fails, without updating the view. By that point Canvas has already cleared its in-creation staging state on pointer-up, so the flow the user just drew simply vanishes -- the only feedback is a transient error toast.

Why it matters

This is silent loss of user work. Observed live during the June 2026 flow-editing audit against a corrupted project where the attach patch failed repeatedly: every drag-create gesture produced nothing visible beyond a toast, making the editor appear broken with no path forward for the user. Even in less pathological cases, a single failed patch throws away a completed gesture.

Component

  • src/diagram/Editor.tsx (handleFlowAttach)
  • src/diagram/drawing/Canvas.tsx (in-creation staging cleared on pointer-up before the patch outcome is known)

Possible approaches

  • Re-stage the gesture on patch failure so the drawn flow remains in its in-creation state and the user can retry or adjust.
  • Keep the drawn geometry on the canvas with an error badge/annotation instead of dropping it.
  • A more persistent error surface than the transient toast (e.g. a dismissable banner explaining why the attach failed).

Context

Identified during the June 2026 flow-editing audit; listed in the "Deferred" section of docs/dev/flow-editing-audit-2026-06.md but had no tracking issue until now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions