Quick-add form resets on failed submissions #50

Closed
opened 2026-05-29 12:37:16 +00:00 by ldraney · 1 comment
Owner

Type

Bug

Lineage

Related to ldraney/landscaping-assistant #44 — nit from PR #48 review.

Repo

ldraney/landscaping-assistant

What Broke

The reset-form Stimulus controller wired to the quick-add form on the Today tab listens for turbo:submit-end, which fires on both success and failure. If the create action fails (e.g. duplicate, validation error), the form still resets and the user loses their input.

Repro Steps

  1. Go to Today tab
  2. Trigger a form submission that fails (e.g. add a property already in the queue for that day)
  3. Observe: input clears even though the add failed

Expected Behavior

Form should only reset on successful submission. Check event.detail.success before calling this.element.reset().

Environment

  • Cluster/namespace: dev (docker-compose, port 7143)
  • Service version/commit: fix/clear-name-after-add branch

Acceptance Criteria

  • Form only resets when event.detail.success is true
  • On failure, input retains its value so user can retry
  • No regression in the success-path reset behavior
  • landscaping-assistant — project this affects
  • ldraney/landscaping-assistant #44 — parent fix that introduced this behavior
### Type Bug ### Lineage Related to `ldraney/landscaping-assistant #44` — nit from PR #48 review. ### Repo `ldraney/landscaping-assistant` ### What Broke The `reset-form` Stimulus controller wired to the quick-add form on the Today tab listens for `turbo:submit-end`, which fires on both success and failure. If the create action fails (e.g. duplicate, validation error), the form still resets and the user loses their input. ### Repro Steps 1. Go to Today tab 2. Trigger a form submission that fails (e.g. add a property already in the queue for that day) 3. Observe: input clears even though the add failed ### Expected Behavior Form should only reset on successful submission. Check `event.detail.success` before calling `this.element.reset()`. ### Environment - Cluster/namespace: dev (docker-compose, port 7143) - Service version/commit: `fix/clear-name-after-add` branch ### Acceptance Criteria - [ ] Form only resets when `event.detail.success` is true - [ ] On failure, input retains its value so user can retry - [ ] No regression in the success-path reset behavior ### Related - `landscaping-assistant` — project this affects - `ldraney/landscaping-assistant #44` — parent fix that introduced this behavior
Author
Owner

Reading issue to start work.

Reading issue to start work.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/landscaping-assistant#50
No description provided.