Small aux view fixes that make cmdinput focus work a bit better (#594)

* added some more fixes for aichat and cmdinput

* removed comments and fixed up merge conflicts

* small fix

* fixed bug
This commit is contained in:
Cole Lashley
2024-04-26 11:11:03 -07:00
committed by GitHub
parent a449cec33a
commit 4f32c459a6
2 changed files with 5 additions and 3 deletions
+1
View File
@@ -145,6 +145,7 @@ class AIChat extends React.Component<{}, {}> {
currentRef.value = "";
} else {
inputModel.grabCodeSelectSelection();
inputModel.setAuxViewFocus(false);
}
}
+4 -3
View File
@@ -464,9 +464,6 @@ class InputModel {
// Sets the focus state of the auxiliary view. If true, the view will get focus. Otherwise, the main input will get focus.
setAuxViewFocus(focus: boolean): void {
if (this.getAuxViewFocus() == focus) {
return;
}
mobx.action(() => {
this.auxViewFocus.set(focus);
})();
@@ -479,6 +476,9 @@ class InputModel {
if (view != null && this.getActiveAuxView() != view) {
return false;
}
if (view != null && !this.getAuxViewFocus()) {
return false;
}
if (view == null && this.hasFocus() && !this.getAuxViewFocus()) {
return true;
}
@@ -687,6 +687,7 @@ class InputModel {
openAIAssistantChat(): void {
this.setActiveAuxView(appconst.InputAuxView_AIChat);
this.setAuxViewFocus(true);
this.globalModel.sendActivity("aichat-open");
}