Skip to content

Fix bugs #37, #39, #40: form submission, discipline select, duplicate uploads - #20

Open
garymeyerca wants to merge 2 commits into
feat/jump-photo-uploadsfrom
fix/bug-40-jump-logging
Open

Fix bugs #37, #39, #40: form submission, discipline select, duplicate uploads#20
garymeyerca wants to merge 2 commits into
feat/jump-photo-uploadsfrom
fix/bug-40-jump-logging

Conversation

@garymeyerca

Copy link
Copy Markdown
Owner

Three user-reported bugs fixed. See commit messages for details.

Sonja and others added 2 commits February 15, 2026 22:42
Remove dangling `<div` tags (missing closing `>`) in new.html.erb,
index.html.erb, and show.html.erb. The unclosed tag caused browser HTML
error recovery to swallow the form element, preventing form submission
entirely — the core "Log a Jump" action silently did nothing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three root causes fixed:

1. JS: filesSelected() doubled files — it passed this.inputTarget.files
   to addFiles(), which also read from this.inputTarget.files, adding
   every file twice. Fix: snapshot files and clear input before calling
   addFiles().

2. JS: Turbo cache caused stale file inputs — when Turbo caches a page
   and restores it, the Stimulus controller reconnected with leftover
   state. Fix: reset file input and previews in connect()/disconnect().

3. Server: has_many_attached appends on update — passing photos through
   jump_params on update caused Active Storage to append duplicates.
   Fix: separate photo attachment from the update call, only attaching
   explicitly new files.

Also added data-turbo-submits-with to the submit button to prevent
double form submission during Turbo navigation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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