From 4296856cc1cfa564289c279c86f99cc5f138ea72 Mon Sep 17 00:00:00 2001 From: Cole Lashley Date: Mon, 29 Apr 2024 12:40:36 -0700 Subject: [PATCH 1/3] Fixed separator code in config path (#616) * un quoted separator in config * addressed review comments --- wavesrv/cmd/main-server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wavesrv/cmd/main-server.go b/wavesrv/cmd/main-server.go index b4e3228d..ce1d9861 100644 --- a/wavesrv/cmd/main-server.go +++ b/wavesrv/cmd/main-server.go @@ -1180,7 +1180,7 @@ func main() { gr.HandleFunc("/api/log-active-state", AuthKeyWrap(HandleLogActiveState)) gr.HandleFunc("/api/read-file", AuthKeyWrapAllowHmac(HandleReadFile)) gr.HandleFunc("/api/write-file", AuthKeyWrap(HandleWriteFile)).Methods("POST") - configPath := filepath.Join(scbase.GetWaveHomeDir(), "config") + strconv.QuoteRune(filepath.Separator) + configPath := filepath.Join(scbase.GetWaveHomeDir(), "config") + string(filepath.Separator) log.Printf("[wave] config path: %q\n", configPath) isFileHandler := http.StripPrefix("/config/", http.FileServer(http.Dir(configPath))) isDirHandler := http.HandlerFunc(configDirHandler) From 50662c21520ef104718ca84e466af47c947bb758 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Mon, 29 Apr 2024 15:08:11 -0700 Subject: [PATCH 2/3] Fixes a regression that would unfocus from the history input (#615) * Fixes a regression that would unfocus from the history input * remove debug statements * Update historyinfo.tsx * fix scrolling the right way --- src/app/workspace/cmdinput/aichat.tsx | 8 ++------ src/app/workspace/cmdinput/auxview.tsx | 5 ++++- src/app/workspace/cmdinput/cmdinput.tsx | 8 +------- src/app/workspace/cmdinput/historyinfo.less | 4 ++-- src/app/workspace/cmdinput/historyinfo.tsx | 9 +++++++-- src/models/input.ts | 3 +-- 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/app/workspace/cmdinput/aichat.tsx b/src/app/workspace/cmdinput/aichat.tsx index 544210b0..8b5e7692 100644 --- a/src/app/workspace/cmdinput/aichat.tsx +++ b/src/app/workspace/cmdinput/aichat.tsx @@ -104,15 +104,11 @@ class AIChat extends React.Component<{}, {}> { } onTextAreaFocused(e: any) { - mobx.action(() => { - GlobalModel.inputModel.setAuxViewFocus(true); - })(); + GlobalModel.inputModel.setAuxViewFocus(true); } onTextAreaBlur(e: any) { - mobx.action(() => { - GlobalModel.inputModel.setAuxViewFocus(false); - })(); + GlobalModel.inputModel.setAuxViewFocus(false); } // Adjust the height of the textarea to fit the text diff --git a/src/app/workspace/cmdinput/auxview.tsx b/src/app/workspace/cmdinput/auxview.tsx index eb3e272a..829d1c65 100644 --- a/src/app/workspace/cmdinput/auxview.tsx +++ b/src/app/workspace/cmdinput/auxview.tsx @@ -16,11 +16,12 @@ interface AuxiliaryCmdViewProps { titleBarContents?: React.ReactElement[]; children?: React.ReactNode; onClose?: React.MouseEventHandler; + onScrollbarInitialized?: () => void; scrollable?: boolean; } export const AuxiliaryCmdView: React.FC = observer((props) => { - const { title, className, iconClass, titleBarContents, children, onClose } = props; + const { title, className, iconClass, titleBarContents, children, onClose, onScrollbarInitialized } = props; return (
@@ -50,6 +51,8 @@ export const AuxiliaryCmdView: React.FC = observer((props {children} diff --git a/src/app/workspace/cmdinput/cmdinput.tsx b/src/app/workspace/cmdinput/cmdinput.tsx index f25bcf7a..cfa2326d 100644 --- a/src/app/workspace/cmdinput/cmdinput.tsx +++ b/src/app/workspace/cmdinput/cmdinput.tsx @@ -73,7 +73,6 @@ class CmdInput extends React.Component<{}, {}> { return; } GlobalModel.inputModel.setAuxViewFocus(false); - GlobalModel.inputModel.giveFocus(); } @boundMethod @@ -232,12 +231,7 @@ class CmdInput extends React.Component<{}, {}> {
-
+
0}>
{ lastClickTs: number = 0; containingText: mobx.IObservableValue = mobx.observable.box(""); - componentDidMount() { + /** + * Handles the OverlayScrollbars initialization event to set the scroll position without it being overridden. + */ + @boundMethod + handleScrollbarInitialized() { const inputModel = GlobalModel.inputModel; let hitem = inputModel.getHistorySelectedItem(); if (hitem == null) { @@ -225,7 +229,7 @@ class HistoryInfo extends React.Component<{}, {}> { render() { const inputModel = GlobalModel.inputModel; const selItem = inputModel.getHistorySelectedItem(); - const hitems = inputModel.getFilteredHistoryItems().slice().reverse(); + const hitems = inputModel.getFilteredHistoryItems(); const opts = inputModel.historyQueryOpts.get(); let hitem: HistoryItem = null; let snames: Record = {}; @@ -244,6 +248,7 @@ class HistoryInfo extends React.Component<{}, {}> { titleBarContents={this.getTitleBarContents()} iconClass="fa-sharp fa-solid fa-clock-rotate-left" scrollable={true} + onScrollbarInitialized={this.handleScrollbarInitialized} >
{ - console.log("clearing info msg"); if (this.activeAuxView.get() != appconst.InputAuxView_Info) { return; } From ac91fa8596a2aa75489836117ed3ea2db6df113c Mon Sep 17 00:00:00 2001 From: Cole Lashley Date: Mon, 29 Apr 2024 15:56:20 -0700 Subject: [PATCH 3/3] fixed ai timeout bug (#617) --- wavesrv/pkg/cmdrunner/cmdrunner.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wavesrv/pkg/cmdrunner/cmdrunner.go b/wavesrv/pkg/cmdrunner/cmdrunner.go index 3e31f638..e2deea74 100644 --- a/wavesrv/pkg/cmdrunner/cmdrunner.go +++ b/wavesrv/pkg/cmdrunner/cmdrunner.go @@ -2735,7 +2735,7 @@ func doOpenAICmdInfoCompletion(cmd *sstore.CmdType, clientId string, opts *sstor } writePacketToUpdateBus(ctx, cmd, asstMessagePk) packetTimeout := OpenAIPacketTimeout - if opts.Timeout >= 0 { + if opts.Timeout > 0 { packetTimeout = time.Duration(opts.Timeout) * time.Millisecond } doneWaitingForPackets := false @@ -2830,7 +2830,7 @@ func doOpenAIStreamCompletion(cmd *sstore.CmdType, clientId string, opts *sstore return } packetTimeout := OpenAIPacketTimeout - if opts.Timeout >= 0 { + if opts.Timeout > 0 { packetTimeout = time.Duration(opts.Timeout) * time.Millisecond } doneWaitingForPackets := false