Skip to content

Wire up the "Add a second version" button - #9

Closed
dancockrell wants to merge 1 commit into
mainfrom
claude/fix-unhooked-code
Closed

Wire up the "Add a second version" button#9
dancockrell wants to merge 1 commit into
mainfrom
claude/fix-unhooked-code

Conversation

@dancockrell

Copy link
Copy Markdown
Owner

#btnAddForm ("+ Add a second version") existed in the markup, and its label was updated dynamically by renderForms() (e.g. "+ Add version C"). All the supporting logic was already built: nextFormLetter(), unusedCode() (a next-unused-3-digit-code generator that was itself completely uncalled), and the "remove version" button for existing forms. But nothing ever attached a click handler to #btnAddForm — clicking it did nothing.

Wired it the same way the neighboring #btnAddWritten button is wired: push a new form ({id: nextFormLetter(), code: unusedCode(), key: [], rules: {}}) into editing.forms and call renderForms().

Ran python build.py afterward to regenerate QuickGrade.html and sw.js (cache-bust hash) so the single-file build stays in sync with js/app.js, per the repo's own workflow in the README.

Verified node -c js/app.js passes and the build completes cleanly. I did not have tools/'s Playwright deps installed in this environment to run the e2e suite (tools/test-forms.js exercises the forms feature only through the QG.DB/QG.Scoring API directly, not the button, so it wouldn't have caught this).


Generated by Claude Code

#btnAddForm existed in the markup, its label updated dynamically by
renderForms() ("+ Add version C", etc.), and its supporting helpers
(nextFormLetter, unusedCode, the remove-version button) were all in
place — but nothing ever attached a click handler to it. Clicking
"+ Add a second version" did nothing.

Wires it the same way btnAddWritten is wired: push a new form (next
letter, next unused code, empty key) into editing.forms and re-render.
Rebuilt QuickGrade.html and sw.js via `python build.py` to keep the
single-file build in sync.
@dancockrell

Copy link
Copy Markdown
Owner Author

Superseded by merged PR #11. The useful Add a second version behavior was reimplemented there as focused source code with browser coverage. PR #11 passed the fast scanner regression gate, the complete 29-suite browser QA job, and the separate deterministic generated-file verification before merge at 6853573. Closing this conflicting draft so the queue points to the tested implementation now on main.

@dancockrell dancockrell closed this Sep 2, 2026
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