Skip to content

Fix downloads losing UI state when modal is closed#10

Open
dannyd40 wants to merge 3 commits into
romandev-codex:mainfrom
dannyd40:fix/keep-downloads-on-modal-close
Open

Fix downloads losing UI state when modal is closed#10
dannyd40 wants to merge 3 commits into
romandev-codex:mainfrom
dannyd40:fix/keep-downloads-on-modal-close

Conversation

@dannyd40
Copy link
Copy Markdown

Summary

  • Modal is now hidden instead of destroyed when closed
  • Download progress buttons keep updating via WebSocket events even when modal is not visible
  • Re-opening the modal shows the current download states (progress %, completed, errors)
  • Added null check in updateDownloadButton to prevent JS errors

Problem

Closing the modal removed it from the DOM (this.modal = null), causing updateDownloadButton to crash when WebSocket progress events arrived. While the server-side download continued, the UI lost all state and couldn't display progress when re-opened.

Test plan

  • Start a download, close the modal, re-open it → progress should still be visible
  • Close modal during download → download completes successfully on the server
  • Re-open modal after download completes → button shows "✓ Downloaded"

🤖 Generated with Claude Code

dannyd40 and others added 3 commits March 15, 2026 12:13
When a file exists locally, compare its size against the remote size
to detect incomplete downloads. Shows "Incomplete" with orange button
and size details (e.g. 3.21 GB / 6.46 GB) when the local file is
smaller than expected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Instead of re-downloading entirely, incomplete files can now be
resumed from where they left off using HTTP Range requests. The
download button shows "Resume" (orange) for incomplete files, and
clicking it downloads only the remaining bytes using multi-connection
or single-connection mode depending on the remaining size.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Hide the modal instead of destroying it so download progress buttons
stay updated via WebSocket events. Re-opening the modal shows current
download states. Also adds a null check in updateDownloadButton to
prevent errors when the modal reference is unavailable.

Co-Authored-By: Claude Opus 4.6 (1M context) <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