mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 12:40:44 +00:00
Moved theme to slashCommand
This commit is contained in:
parent
5f5edb4c9b
commit
2616e965a7
3 changed files with 31 additions and 24 deletions
|
|
@ -35,16 +35,6 @@ interface AppProps {
|
|||
export const App = ({ config, cliVersion }: AppProps) => {
|
||||
const [history, setHistory] = useState<HistoryItem[]>([]);
|
||||
const [startupWarnings, setStartupWarnings] = useState<string[]>([]);
|
||||
const {
|
||||
streamingState,
|
||||
submitQuery,
|
||||
initError,
|
||||
debugMessage,
|
||||
slashCommands,
|
||||
} = useGeminiStream(setHistory, config);
|
||||
const { elapsedTime, currentLoadingPhrase } =
|
||||
useLoadingIndicator(streamingState);
|
||||
|
||||
const {
|
||||
isThemeDialogOpen,
|
||||
openThemeDialog,
|
||||
|
|
@ -52,18 +42,26 @@ export const App = ({ config, cliVersion }: AppProps) => {
|
|||
handleThemeHighlight,
|
||||
} = useThemeCommand();
|
||||
|
||||
const {
|
||||
streamingState,
|
||||
submitQuery,
|
||||
initError,
|
||||
debugMessage,
|
||||
slashCommands,
|
||||
} = useGeminiStream(setHistory, config, openThemeDialog);
|
||||
const { elapsedTime, currentLoadingPhrase } =
|
||||
useLoadingIndicator(streamingState);
|
||||
|
||||
useStartupWarnings(setStartupWarnings);
|
||||
|
||||
const handleFinalSubmit = useCallback(
|
||||
(submittedValue: string) => {
|
||||
const trimmedValue = submittedValue.trim();
|
||||
if (trimmedValue === '/theme') {
|
||||
openThemeDialog();
|
||||
} else if (trimmedValue.length > 0) {
|
||||
if (trimmedValue.length > 0) {
|
||||
submitQuery(submittedValue);
|
||||
}
|
||||
},
|
||||
[openThemeDialog, submitQuery],
|
||||
[submitQuery],
|
||||
);
|
||||
|
||||
const userMessages = useMemo(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue