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 = "";
|
currentRef.value = "";
|
||||||
} else {
|
} else {
|
||||||
inputModel.grabCodeSelectSelection();
|
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.
|
// 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 {
|
setAuxViewFocus(focus: boolean): void {
|
||||||
if (this.getAuxViewFocus() == focus) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mobx.action(() => {
|
mobx.action(() => {
|
||||||
this.auxViewFocus.set(focus);
|
this.auxViewFocus.set(focus);
|
||||||
})();
|
})();
|
||||||
@ -479,6 +476,9 @@ class InputModel {
|
|||||||
if (view != null && this.getActiveAuxView() != view) {
|
if (view != null && this.getActiveAuxView() != view) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (view != null && !this.getAuxViewFocus()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (view == null && this.hasFocus() && !this.getAuxViewFocus()) {
|
if (view == null && this.hasFocus() && !this.getAuxViewFocus()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -687,6 +687,7 @@ class InputModel {
|
|||||||
|
|
||||||
openAIAssistantChat(): void {
|
openAIAssistantChat(): void {
|
||||||
this.setActiveAuxView(appconst.InputAuxView_AIChat);
|
this.setActiveAuxView(appconst.InputAuxView_AIChat);
|
||||||
|
this.setAuxViewFocus(true);
|
||||||
this.globalModel.sendActivity("aichat-open");
|
this.globalModel.sendActivity("aichat-open");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user