diff --git a/static/js/managers/DownloadManager.js b/static/js/managers/DownloadManager.js index e628ffcd..04f776f0 100644 --- a/static/js/managers/DownloadManager.js +++ b/static/js/managers/DownloadManager.js @@ -785,7 +785,10 @@ export class DownloadManager { (version.downloadedFiles || []).map(f => String(f.fileId)) ); - document.getElementById('versionStep').style.display = 'none'; + // Hide every other step — this dialog can be entered directly from + // entry points like ModelVersionsTab, where the URL step would + // otherwise remain visible (#1058). + document.querySelectorAll('.download-step').forEach(step => step.style.display = 'none'); document.getElementById('fileSelectionStep').style.display = 'block'; const nameEl = document.getElementById('fileSelectionVersionName'); diff --git a/tests/frontend/managers/downloadManager.multiSelect.test.js b/tests/frontend/managers/downloadManager.multiSelect.test.js index 7a11e1b6..6bc24eb9 100644 --- a/tests/frontend/managers/downloadManager.multiSelect.test.js +++ b/tests/frontend/managers/downloadManager.multiSelect.test.js @@ -314,4 +314,19 @@ describe('DownloadManager multi-select file dialog (#1058)', () => { const nextButton = document.getElementById('nextFromVersion'); expect(nextButton.disabled).toBe(true); }); + + it('hides every other step (including the URL step) when the file dialog shows', () => { + // Regression: entering via openFileSelectionForVersion (ModelVersionsTab) + // left the URL step visible alongside the file selection step (#1058). + const manager = new DownloadManager(); + manager.versions = [makeMultiFileVersion()]; + document.getElementById('urlStep').style.display = 'block'; + document.getElementById('versionStep').style.display = 'block'; + + manager.showFileSelectionStep('201'); + + expect(document.getElementById('urlStep').style.display).toBe('none'); + expect(document.getElementById('versionStep').style.display).toBe('none'); + expect(document.getElementById('fileSelectionStep').style.display).toBe('block'); + }); });