fix: /help remove flickering and respect clear shortcut (ctr+l) (#3611)

Co-authored-by: Jacob Richman <jacob314@gmail.com>
Co-authored-by: Allen Hutchison <adh@google.com>
This commit is contained in:
Pyush Sinha
2025-08-04 09:53:50 -07:00
committed by GitHub
parent 16d29e2d6f
commit ca19aa9125
10 changed files with 72 additions and 70 deletions

View File

@@ -42,7 +42,6 @@ export const useSlashCommandProcessor = (
clearItems: UseHistoryManagerReturn['clearItems'],
loadHistory: UseHistoryManagerReturn['loadHistory'],
refreshStatic: () => void,
setShowHelp: React.Dispatch<React.SetStateAction<boolean>>,
onDebugMessage: (message: string) => void,
openThemeDialog: () => void,
openAuthDialog: () => void,
@@ -105,6 +104,11 @@ export const useSlashCommandProcessor = (
selectedAuthType: message.selectedAuthType,
gcpProject: message.gcpProject,
};
} else if (message.type === MessageType.HELP) {
historyItemContent = {
type: 'help',
timestamp: message.timestamp,
};
} else if (message.type === MessageType.STATS) {
historyItemContent = {
type: 'stats',
@@ -138,7 +142,6 @@ export const useSlashCommandProcessor = (
},
[addItem],
);
const commandContext = useMemo(
(): CommandContext => ({
services: {
@@ -333,9 +336,6 @@ export const useSlashCommandProcessor = (
return { type: 'handled' };
case 'dialog':
switch (result.dialog) {
case 'help':
setShowHelp(true);
return { type: 'handled' };
case 'auth':
openAuthDialog();
return { type: 'handled' };
@@ -462,7 +462,6 @@ export const useSlashCommandProcessor = (
[
config,
addItem,
setShowHelp,
openAuthDialog,
commands,
commandContext,