Skip to content

refactor(comment): drop the dead comment-autosave machinery - #169

Merged
luflow merged 2 commits into
mainfrom
claude/comment-autosave-check-n33jut
Aug 15, 2026
Merged

refactor(comment): drop the dead comment-autosave machinery#169
luflow merged 2 commits into
mainfrom
claude/comment-autosave-check-n33jut

Conversation

@luflow

@luflow luflow commented Aug 13, 2026

Copy link
Copy Markdown
Owner

What

An audit for leftover comment autosave-on-keystroke behavior (paired with luflow/attendance-flutter#82, which fixes the real occurrence in the mobile app) confirmed the web UI already saves comments only via the explicit save button (or Enter) everywhere — own response comment (ResponseEditor, used on the detail card, list card and dashboard widget) and the check-in comment (CheckinUserItem). But useAppointmentResponse.js still shipped the old autosave machinery with no callers left. This removes it so nothing invites wiring typing back to the network:

  • the debounced input handlers (createCommentInputHandler, useMultiAppointmentResponse.onCommentInput) and the entire unused useMultiAppointmentResponse composable
  • the saved-indicator timers (commentSaved, the 500 ms delayed spinner) and the silent flag
  • autoSaveComment is renamed to saveComment

A follow-up review commit then cleans up what the removal exposed: the shared transport (URL build, POST, non-2xx check) of submitResponse and saveComment is factored into one postRespond helper (the block had already drifted into four copies in this file's history), and saveComment reports success via its return value instead of the errorComment ref, which no template ever rendered — with the last indicator timer gone, reset() and the unmount hook in ResponseEditor go too.

No behavior change; all translation strings are kept, so no l10n impact.

Verification

./scripts/check.sh passes: eslint, stylelint, php-cs-fixer, psalm, PHPUnit, vite build, both l10n checks, OpenAPI spec check. The e2e specs already exercise the explicit save-button flow and are untouched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BNpTw85wK6Qv64ZSuF9P3Z


Generated by Claude Code

claude added 2 commits August 13, 2026 20:42
The UI has long saved comments only via the explicit save button (or
Enter), but the composable still shipped the debounced input handlers
behind the old autosave (createCommentInputHandler, the unused
useMultiAppointmentResponse, the saved-indicator timers). Remove them
and rename autoSaveComment to saveComment so nothing invites wiring
typing back to the network. No behavior change.
Factor the shared transport (URL build, POST, non-2xx check) out of
submitResponse and saveComment into one postRespond helper — the same
block had already drifted into four copies in this file's history.
saveComment now reports success via its return value instead of the
errorComment ref, which no template ever rendered; with the last
indicator timer gone, reset() and the unmount hook in ResponseEditor
go too. The destructure alias follows the submitResponseApi
convention used elsewhere.
@luflow
luflow merged commit b673d35 into main Aug 15, 2026
3 checks passed
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.

2 participants