refactor(coding-agent): restructured loading animation lifecycle into ensureLoadingAnimation

- Extracted loading animation lifecycle management into centralized ensureLoadingAnimation() method.
- Consolidated duplicate loading animation setup across event-controller and interactive-mode into single reusable method.
- Updated showError() to properly clean up loading animation state when errors occur.
- Added comprehensive test coverage for InputController escape key behavior with optimistic submission.
This commit is contained in:
can1357
2026-03-10 05:51:09 +01:00
parent 8fe602173b
commit e019a3e352
6 changed files with 192 additions and 16 deletions
@@ -339,6 +339,7 @@ export class InputController {
};
this.ctx.addMessageToChat(optimisticMessage);
this.ctx.editor.setText("");
this.ctx.ensureLoadingAnimation();
this.ctx.ui.requestRender();
this.ctx.onInputCallback({ text, images });