Skip to content

fix(compose): surface failed figure saves instead of discarding them silently - #36

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/compose-mutation-error-feedback
Aug 30, 2026
Merged

fix(compose): surface failed figure saves instead of discarding them silently#36
github-actions[bot] merged 1 commit into
mainfrom
fix/compose-mutation-error-feedback

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

Summary

  • handleDragEnd/handleScaleChange in CompositionCanvas.tsx and moveLayer in CanvasToolbar.tsx called updateFigure.mutate(...) with no onError handler, unlike every other mutation call site in the app (FigureUploader.tsx, FigureCard.tsx, style/page.tsx, surface/page.tsx), which all toast.error(err.message) on failure.
  • Because Konva's draggable node holds its own local x/y independent of the React figure prop, a failed PATCH (network blip, auth expiry, ownership-check race) left the figure visibly in its new position with zero feedback that the save never landed — the user only found out on a later reload, by which point the "why" was gone. Same for a resize or a layer-order change.
  • Fix: wire the same toast.error(err.message) convention already used elsewhere in this file family onto the three unguarded mutate calls. No behavior change on the success path.

Test plan

  • npm run verify (lint + typecheck + test): 0 lint errors (8 pre-existing warnings, unrelated), tsc clean, 84/84 tests pass
  • Manual browser click-through not performed — no .env.local / Supabase credentials configured in this environment, and forcing a mutation failure (network blip, auth expiry) isn't reachable through the UI without one. The change itself only adds an onError callback matching an already-tested, already-shipped pattern used identically elsewhere in the same component family.

🤖 Generated with Claude Code

…silently

Dragging, resizing, or reordering a figure calls updateFigure.mutate with no
onError handler, while every other mutation in the app (upload, surface save,
figure edit) toasts on failure. A failed PATCH here left Konva's local node
position out of sync with the DB with zero indication anything went wrong —
the user only discovered the loss on a later reload, by which point the
change felt real. Wire the same toast.error(err.message) pattern already used
elsewhere in this file family.
@github-actions
github-actions Bot merged commit 2085b78 into main Aug 30, 2026
1 check passed
@github-actions
github-actions Bot deleted the fix/compose-mutation-error-feedback branch August 30, 2026 04:20
catomean added a commit that referenced this pull request Aug 31, 2026
…lently

Every other mutation call site in the app toasts on error; these two in
FigureCard were missed, so a failed rename or delete looked like it worked.
Same failure shape as the compose-canvas fix in #36.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F5CTjNgbJPinRvWERuUbs6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant