mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Moved theme to slashCommand
This commit is contained in:
@@ -30,17 +30,9 @@ export const useSlashCommandProcessor = (
|
||||
setHistory: React.Dispatch<React.SetStateAction<HistoryItem[]>>,
|
||||
setDebugMessage: React.Dispatch<React.SetStateAction<string>>,
|
||||
getNextMessageId: (baseTimestamp: number) => number,
|
||||
openThemeDialog: () => void,
|
||||
) => {
|
||||
const slashCommands: SlashCommand[] = [
|
||||
{
|
||||
name: 'clear',
|
||||
description: 'clear the screen',
|
||||
action: (_value: PartListUnion) => {
|
||||
// This just clears the *UI* history, not the model history.
|
||||
setDebugMessage('Clearing terminal.');
|
||||
setHistory((_) => []);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'help',
|
||||
description: 'for help on gemini-code',
|
||||
@@ -56,6 +48,22 @@ export const useSlashCommandProcessor = (
|
||||
addHistoryItem(setHistory, { type: 'info', text: helpText }, timestamp);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'clear',
|
||||
description: 'clear the screen',
|
||||
action: (_value: PartListUnion) => {
|
||||
// This just clears the *UI* history, not the model history.
|
||||
setDebugMessage('Clearing terminal.');
|
||||
setHistory((_) => []);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'theme',
|
||||
description: 'change the theme',
|
||||
action: (_value: PartListUnion) => {
|
||||
openThemeDialog();
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'exit',
|
||||
description: '',
|
||||
@@ -85,7 +93,6 @@ export const useSlashCommandProcessor = (
|
||||
process.exit(0);
|
||||
},
|
||||
},
|
||||
// Removed /theme command, handled in App.tsx
|
||||
];
|
||||
|
||||
// Checks if the query is a slash command and executes the command if it is.
|
||||
|
||||
@@ -49,6 +49,7 @@ const addHistoryItem = (
|
||||
export const useGeminiStream = (
|
||||
setHistory: React.Dispatch<React.SetStateAction<HistoryItem[]>>,
|
||||
config: Config,
|
||||
openThemeDialog: () => void,
|
||||
) => {
|
||||
const toolRegistry = config.getToolRegistry();
|
||||
const [streamingState, setStreamingState] = useState<StreamingState>(
|
||||
@@ -74,6 +75,7 @@ export const useGeminiStream = (
|
||||
setHistory,
|
||||
setDebugMessage,
|
||||
getNextMessageId,
|
||||
openThemeDialog,
|
||||
);
|
||||
|
||||
const { handleShellCommand } = useShellCommandProcessor(
|
||||
|
||||
Reference in New Issue
Block a user