diff --git a/core/config/handler.ts b/core/config/handler.ts index 0c82d94fa..2930d547d 100644 --- a/core/config/handler.ts +++ b/core/config/handler.ts @@ -18,14 +18,17 @@ export class ConfigHandler { private readonly ide: IDE; private readonly remoteConfigServerUrl: URL | undefined; private readonly writeLog: (text: string) => void; + private readonly onConfigUpdate: () => void; constructor( ide: IDE, remoteConfigServerUrl: URL | undefined, - writeLog: (text: string) => void + writeLog: (text: string) => void, + onConfigUpdate: () => void ) { this.ide = ide; this.remoteConfigServerUrl = remoteConfigServerUrl; this.writeLog = writeLog; + this.onConfigUpdate = onConfigUpdate; try { this.loadConfig(); } catch (e) { @@ -37,6 +40,7 @@ export class ConfigHandler { this.savedConfig = undefined; this.savedBrowserConfig = undefined; this.loadConfig(); + this.onConfigUpdate() } async getSerializedConfig(): Promise { diff --git a/core/indexing/chunk/chunk.ts b/core/indexing/chunk/chunk.ts index 0132bc08d..84c802e15 100644 --- a/core/indexing/chunk/chunk.ts +++ b/core/indexing/chunk/chunk.ts @@ -23,7 +23,7 @@ async function* chunkDocumentWithoutId( } return; } catch (e) { - console.error(`Failed to parse ${filepath}: `, e); + // console.error(`Failed to parse ${filepath}: `, e); // falls back to basicChunker } } diff --git a/extensions/vscode/src/extension/vscodeExtension.ts b/extensions/vscode/src/extension/vscodeExtension.ts index fef0538c9..0ba7a327c 100644 --- a/extensions/vscode/src/extension/vscodeExtension.ts +++ b/extensions/vscode/src/extension/vscodeExtension.ts @@ -52,7 +52,8 @@ export class VsCodeExtension { "==========================================================================" ); outputChannel.append(log); - } + }, + () => this.webviewProtocol?.request("configUpdate", undefined) ); this.configHandler.reloadConfig(); diff --git a/gui/src/components/mainInput/TipTapEditor.tsx b/gui/src/components/mainInput/TipTapEditor.tsx index 2e00462f1..ec6fa3d90 100644 --- a/gui/src/components/mainInput/TipTapEditor.tsx +++ b/gui/src/components/mainInput/TipTapEditor.tsx @@ -354,8 +354,11 @@ function TipTapEditor(props: TipTapEditorProps) { } props.onEnter(json); - editor.commands.clearContent(true); - }, [props.onEnter, editor]); + + if (props.isMainInput) { + editor.commands.clearContent(true); + } + }, [props.onEnter, editor, props.isMainInput]); // This is a mechanism for overriding the IDE keyboard shortcut when inside of the webview const [ignoreHighlightedCode, setIgnoreHighlightedCode] = useState(false); @@ -382,6 +385,14 @@ function TipTapEditor(props: TipTapEditorProps) { }; }, []); + // Re-focus main input after done generating + const active = useSelector((state: RootState) => state.state.active); + useEffect(() => { + if (editor && !active && props.isMainInput) { + editor.commands.focus(); + } + }, [props.isMainInput, active,editor]) + // IDE event listeners useWebviewListener( "userInput",