fix: preserve accumulated files in the Update Selected Questions modal#136
Draft
fix: preserve accumulated files in the Update Selected Questions modal#136
Conversation
…across picker opens Agent-Logs-Url: https://github.com/johannehouweling/ToxTempAssistant/sessions/2e5c6a18-6c34-49ac-9c7c-ac81c27a4eb4 Co-authored-by: johannehouweling <95692173+johannehouweling@users.noreply.github.com>
…List Agent-Logs-Url: https://github.com/johannehouweling/ToxTempAssistant/sessions/2e5c6a18-6c34-49ac-9c7c-ac81c27a4eb4 Co-authored-by: johannehouweling <95692173+johannehouweling@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix file upload widget forgetting previously selected files
fix: preserve accumulated files in the Update Selected Questions modal
Apr 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The file upload widget in the "Update Selected Questions" modal was replacing the
FileListon each picker open, making it impossible to build up a multi-file selection incrementally. The sameDataTransfer-based accumulator pattern already used innew.htmlwas absent fromupdate_modal.html.Changes
update_modal.htmlfileAccumulator(DataTransfer) scoped to the modal's JS closure.fileUploadchangehandler now appends newly-picked files into the accumulator and writes the accumulatedFileListback to the input — instead of replacing.renderAccumulatedFileList()renders per-file badge+remove buttons below the input usingtextContent(XSS-safe).removeAccumulatedFile(name)rebuilds the accumulator without the named file.clearFileAccumulator()resets accumulator, input, and rendered list; called on modalhidden.bs.modaland Cancel click (replacing the previous barefileUpload.value = '').isFileSelected()now checksfileAccumulator.files.lengthinstead offileUpload.files.length.