From 9588aa6ef971918b8acfeefdad4f6a33f93349cf Mon Sep 17 00:00:00 2001 From: Shreya Keshive Date: Tue, 19 Aug 2025 10:24:58 -0700 Subject: feat: Show /ide subcommands based on connection status instead of ideMode boolean (#6496) --- packages/cli/src/ui/hooks/slashCommandProcessor.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'packages/cli/src/ui/hooks/slashCommandProcessor.ts') diff --git a/packages/cli/src/ui/hooks/slashCommandProcessor.ts b/packages/cli/src/ui/hooks/slashCommandProcessor.ts index d1af9964..4e70eab7 100644 --- a/packages/cli/src/ui/hooks/slashCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/slashCommandProcessor.ts @@ -206,7 +206,22 @@ export const useSlashCommandProcessor = ( ], ); - const ideMode = config?.getIdeMode(); + useEffect(() => { + if (!config) { + return; + } + + const ideClient = config.getIdeClient(); + const listener = () => { + reloadCommands(); + }; + + ideClient.addStatusChangeListener(listener); + + return () => { + ideClient.removeStatusChangeListener(listener); + }; + }, [config, reloadCommands]); useEffect(() => { const controller = new AbortController(); @@ -228,7 +243,7 @@ export const useSlashCommandProcessor = ( return () => { controller.abort(); }; - }, [config, ideMode, reloadTrigger]); + }, [config, reloadTrigger]); const handleSlashCommand = useCallback( async ( -- cgit v1.2.3