fix(coding-agent): use static reload box without spinner
This commit is contained in:
@@ -4118,22 +4118,24 @@ export class InteractiveMode {
|
|||||||
|
|
||||||
this.resetExtensionUI();
|
this.resetExtensionUI();
|
||||||
|
|
||||||
const loader = new BorderedLoader(
|
const reloadBox = new Container();
|
||||||
this.ui,
|
const borderColor = (s: string) => theme.fg("border", s);
|
||||||
theme,
|
reloadBox.addChild(new DynamicBorder(borderColor));
|
||||||
"Reloading keybindings, extensions, skills, prompts, themes...",
|
reloadBox.addChild(new Spacer(1));
|
||||||
{
|
reloadBox.addChild(
|
||||||
cancellable: false,
|
new Text(theme.fg("muted", "Reloading keybindings, extensions, skills, prompts, themes..."), 1, 0),
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
reloadBox.addChild(new Spacer(1));
|
||||||
|
reloadBox.addChild(new DynamicBorder(borderColor));
|
||||||
|
|
||||||
const previousEditor = this.editor;
|
const previousEditor = this.editor;
|
||||||
this.editorContainer.clear();
|
this.editorContainer.clear();
|
||||||
this.editorContainer.addChild(loader);
|
this.editorContainer.addChild(reloadBox);
|
||||||
this.ui.setFocus(loader);
|
this.ui.setFocus(reloadBox);
|
||||||
this.ui.requestRender();
|
this.ui.requestRender(true);
|
||||||
|
await new Promise((resolve) => process.nextTick(resolve));
|
||||||
|
|
||||||
const dismissLoader = (editor: Component) => {
|
const dismissReloadBox = (editor: Component) => {
|
||||||
loader.dispose();
|
|
||||||
this.editorContainer.clear();
|
this.editorContainer.clear();
|
||||||
this.editorContainer.addChild(editor);
|
this.editorContainer.addChild(editor);
|
||||||
this.ui.setFocus(editor);
|
this.ui.setFocus(editor);
|
||||||
@@ -4166,7 +4168,7 @@ export class InteractiveMode {
|
|||||||
this.setupExtensionShortcuts(runner);
|
this.setupExtensionShortcuts(runner);
|
||||||
}
|
}
|
||||||
this.rebuildChatFromMessages();
|
this.rebuildChatFromMessages();
|
||||||
dismissLoader(this.editor as Component);
|
dismissReloadBox(this.editor as Component);
|
||||||
this.showLoadedResources({
|
this.showLoadedResources({
|
||||||
force: false,
|
force: false,
|
||||||
showDiagnosticsWhenQuiet: true,
|
showDiagnosticsWhenQuiet: true,
|
||||||
@@ -4177,7 +4179,7 @@ export class InteractiveMode {
|
|||||||
}
|
}
|
||||||
this.showStatus("Reloaded keybindings, extensions, skills, prompts, themes");
|
this.showStatus("Reloaded keybindings, extensions, skills, prompts, themes");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
dismissLoader(previousEditor as Component);
|
dismissReloadBox(previousEditor as Component);
|
||||||
this.showError(`Reload failed: ${error instanceof Error ? error.message : String(error)}`);
|
this.showError(`Reload failed: ${error instanceof Error ? error.message : String(error)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user