refactor: move nested debugmessage and slashcommand hooks outside of useGeminiStream (#341)

This commit is contained in:
Brandon Keiji
2025-05-13 23:55:49 +00:00
committed by GitHub
parent c4c11f1d65
commit d3303fd3a0
5 changed files with 42 additions and 49 deletions

View File

@@ -19,7 +19,7 @@ import { UseHistoryManagerReturn } from './useHistoryManager.js';
export const useShellCommandProcessor = (
addItemToHistory: UseHistoryManagerReturn['addItem'],
setStreamingState: React.Dispatch<React.SetStateAction<StreamingState>>,
setDebugMessage: React.Dispatch<React.SetStateAction<string>>,
onDebugMessage: (message: string) => void,
config: Config,
) => {
/**
@@ -50,7 +50,7 @@ export const useShellCommandProcessor = (
}
const targetDir = config.getTargetDir();
setDebugMessage(
onDebugMessage(
`Executing shell command in ${targetDir}: ${commandToExecute}`,
);
const execOptions = {
@@ -80,7 +80,7 @@ export const useShellCommandProcessor = (
return true; // Command was initiated
},
[config, setDebugMessage, addItemToHistory, setStreamingState],
[config, onDebugMessage, addItemToHistory, setStreamingState],
);
return { handleShellCommand };