From 918ff98ea1b03830280b668ab32c930fa2eafb24 Mon Sep 17 00:00:00 2001 From: Red Adaya Date: Sat, 4 May 2024 09:14:43 +0800 Subject: [PATCH] save work --- src/app/sidebar/aichat.tsx | 2 +- src/models/aichat.ts | 25 ++----------------------- src/models/model.ts | 1 + 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/src/app/sidebar/aichat.tsx b/src/app/sidebar/aichat.tsx index f694484a..365ec010 100644 --- a/src/app/sidebar/aichat.tsx +++ b/src/app/sidebar/aichat.tsx @@ -294,7 +294,7 @@ class AIChat extends React.Component<{}, {}> { } render() { - const chatMessageItems = GlobalModel.inputModel.AICmdInfoChatItems.slice(); + const chatMessageItems = GlobalModel.aichatModel.aiCmdInfoChatItems.slice(); return (
diff --git a/src/models/aichat.ts b/src/models/aichat.ts index 288241f7..c4bee7fd 100644 --- a/src/models/aichat.ts +++ b/src/models/aichat.ts @@ -8,34 +8,20 @@ import { GlobalCommandRunner } from "./global"; class AIChatModel { globalModel: Model; - activeAuxView: OV = mobx.observable.box(null); - auxViewFocus: OV = mobx.observable.box(false); - cmdInputHeight: OV = mobx.observable.box(0); aiChatTextAreaRef: React.RefObject; aiChatWindowRef: React.RefObject; codeSelectBlockRefArray: Array>; codeSelectSelectedIndex: OV = mobx.observable.box(-1); codeSelectUuid: string; - AICmdInfoChatItems: mobx.IObservableArray = mobx.observable.array([], { + aiCmdInfoChatItems: mobx.IObservableArray = mobx.observable.array([], { name: "aicmdinfo-chat", }); readonly codeSelectTop: number = -2; readonly codeSelectBottom: number = -1; - infoMsg: OV = mobx.observable.box(null); - infoTimeoutId: any = null; - inputExpanded: OV = mobx.observable.box(false, { - name: "inputExpanded", - }); - // focus - inputFocused: OV = mobx.observable.box(false); - lineFocused: OV = mobx.observable.box(false); physicalInputFocused: OV = mobx.observable.box(false); - forceInputFocus: boolean = false; - - lastCurLine: string = ""; constructor(globalModel: Model) { this.globalModel = globalModel; @@ -84,7 +70,7 @@ class AIChatModel { @mobx.action setOpenAICmdInfoChat(chat: OpenAICmdInfoChatMessageType[]): void { - this.AICmdInfoChatItems.replace(chat); + this.aiCmdInfoChatItems.replace(chat); this.codeSelectBlockRefArray = []; } @@ -222,13 +208,6 @@ class AIChatModel { console.log("submit chat command error: ", error); }); } - - _clearInfoTimeout(): void { - if (this.infoTimeoutId != null) { - clearTimeout(this.infoTimeoutId); - this.infoTimeoutId = null; - } - } } export { AIChatModel }; diff --git a/src/models/model.ts b/src/models/model.ts index ac89ad48..0e95c644 100644 --- a/src/models/model.ts +++ b/src/models/model.ts @@ -1044,6 +1044,7 @@ class Model { } else if (update.cmdline != null) { this.inputModel.updateCmdLine(update.cmdline); } else if (update.openaicmdinfochat != null) { + this.aichatModel.setOpenAICmdInfoChat(update.openaicmdinfochat); this.inputModel.setOpenAICmdInfoChat(update.openaicmdinfochat); } else if (update.screenstatusindicator != null) { this.updateScreenStatusIndicators([update.screenstatusindicator]);