From 8b68498597e7fe6090ba55b58fd5f116a924f94e Mon Sep 17 00:00:00 2001 From: Will Eastcott Date: Thu, 12 Feb 2026 14:58:46 +0000 Subject: [PATCH 1/2] fix: hide tab progress bar when opening pre-loaded ESM dependency When an ESM script (e.g. b.mjs) imports from another script (e.g. a.mjs), the dependency is pre-loaded into documentsIndex. If the user later opens a.mjs directly, documents-load.ts sees it is already loaded and emits documents:focus instead of re-running loadDocument. Since documents:load never fires again, the newly created tab's progress bar was never hidden. Check whether the document was already loaded when creating a new tab and hide the progress bar immediately if so. Co-authored-by: Cursor --- src/code-editor/tab-panel/tab-panel.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/code-editor/tab-panel/tab-panel.ts b/src/code-editor/tab-panel/tab-panel.ts index 929383a30..20cbe7b4e 100644 --- a/src/code-editor/tab-panel/tab-panel.ts +++ b/src/code-editor/tab-panel/tab-panel.ts @@ -425,6 +425,12 @@ editor.once('load', () => { temporaryTab = tabsIndex[id]; temporaryTab.tab.class.add('temporary'); } + + // If the document was already loaded (e.g. as a dependency of another + // ESM script), documents:load won't fire again. Hide progress immediately. + if (isNew && editor.call('documents:get', id) && !editor.call('documents:isLoading', id)) { + toggleProgress(id, false); + } }); // hide progress when document is loaded From 7ad9a7bbc34ae5bb42d71832399e9bc2d99a1e15 Mon Sep 17 00:00:00 2001 From: Will Eastcott Date: Thu, 12 Feb 2026 15:13:26 +0000 Subject: [PATCH 2/2] Update src/code-editor/tab-panel/tab-panel.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/code-editor/tab-panel/tab-panel.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/code-editor/tab-panel/tab-panel.ts b/src/code-editor/tab-panel/tab-panel.ts index 20cbe7b4e..3b14c172d 100644 --- a/src/code-editor/tab-panel/tab-panel.ts +++ b/src/code-editor/tab-panel/tab-panel.ts @@ -428,7 +428,9 @@ editor.once('load', () => { // If the document was already loaded (e.g. as a dependency of another // ESM script), documents:load won't fire again. Hide progress immediately. - if (isNew && editor.call('documents:get', id) && !editor.call('documents:isLoading', id)) { + const doc = editor.call('documents:get', id); + const isLoading = editor.call('documents:isLoading', id); + if (isNew && doc && !isLoading) { toggleProgress(id, false); } });