mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
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:
parent
a449cec33a
commit
4f32c459a6
@ -145,6 +145,7 @@ class AIChat extends React.Component<{}, {}> {
|
||||
currentRef.value = "";
|
||||
} else {
|
||||
inputModel.grabCodeSelectSelection();
|
||||
inputModel.setAuxViewFocus(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user