Skip to content

dataset download eta - #2351

Open
martastn wants to merge 7 commits into
masterfrom
2350-display-estimated-time-remaining-for-simulation-dataset-download
Open

martastn wants to merge 7 commits into
masterfrom
2350-display-estimated-time-remaining-for-simulation-dataset-download

Conversation

@martastn

@martastn martastn commented Mar 30, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds a real-time "estimated time remaining" indicator to the Geant4 dataset download UI.

Download progress and estimation

  • Shows (est. Xs remaining) / (est. Xm Ys remaining) next to each dataset name while it's downloading, based on a smoothed (exponential moving average) download speed derived from consecutive progress updates.
  • The speed/ETA calculation is computed once, centrally, inside useDatasetManager (Geant4DatasetManager.ts) alongside the existing 500ms progress polling and exposed per dataset via a new estimatedSecondsRemaining field on DatasetStatus, instead of being recomputed independently by each dataset row component. This keeps the estimate consistent across datasets and lets it survive UI remounts .

UI/UX

  • The accordion summary click handler now stops event propagation and uses a functional state update, fixing an issue with toggling the accordion's open state.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an estimated time remaining (ETA) indicator to the Geant4 dataset download UI, improving user feedback during long downloads.

Changes:

  • Compute a smoothed download speed per dataset and derive an ETA string for the DOWNLOADING state.
  • Update dataset status rendering to show the ETA next to the dataset name.
  • Adjust the accordion summary click handler (adds stopPropagation) and extend progress bar mapping to include IDLE.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/WrapperApp/components/Simulation/Geant4DatasetDownload.tsx Outdated
Comment thread src/WrapperApp/components/Simulation/Geant4DatasetDownload.tsx Outdated
Comment thread src/WrapperApp/components/Simulation/Geant4DatasetDownload.tsx Outdated
Comment thread src/WrapperApp/components/Simulation/Geant4DatasetDownload.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/WrapperApp/components/Simulation/Geant4DatasetDownload.tsx Outdated
Comment thread src/WrapperApp/components/Simulation/Geant4DatasetDownload.tsx Outdated
Comment thread src/WrapperApp/components/Simulation/Geant4DatasetDownload.tsx Outdated
Comment thread src/WrapperApp/components/Simulation/Geant4DatasetDownload.tsx Outdated
@grzanka

grzanka commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

The progress bars gets into unknown state when I refresh the page (to stop download) in the middle of the download process.

I would expect that after refresh and page reload the "progress bars" would be sliding left and right but stand still...

Take a look around second 13...

simplescreenrecorder-2026-03-30_16.43.10.mp4

martastn and others added 3 commits September 12, 2026 20:48
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@martastn
martastn force-pushed the 2350-display-estimated-time-remaining-for-simulation-dataset-download branch from 1fd94b0 to 418dfd1 Compare September 12, 2026 18:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The change introduces non-trivial stateful timing/ETA logic in a user-facing component with no automated test coverage, so it warrants a final human review.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced


export type SpeedHistory = Record<string, SpeedHistoryEntry>;

export const SPEED_SMOOTHING = 0.1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add comment why this was added

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The EMA speed calculation advances lastTime on stalled polls without keeping the matching lastDone, causing speed to be measured over too short an interval and producing significantly underestimated ETAs for slow datasets.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Comment thread src/Geant4Worker/DatasetDownloadSpeed.ts Outdated
return { lastDone: done, lastTime: currentTime, currentSpeed: 0 };
}

const timeDelta = (currentTime - prev.lastTime) / 1000;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why 1000 ?

@grzanka grzanka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments inline

This branch has not been deployed

No deployments
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.

Display estimated time remaining for simulation dataset download

3 participants