summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/slashCommandProcessor.ts
diff options
context:
space:
mode:
authorShreya Keshive <[email protected]>2025-08-19 10:24:58 -0700
committerGitHub <[email protected]>2025-08-19 17:24:58 +0000
commit9588aa6ef971918b8acfeefdad4f6a33f93349cf (patch)
treeb72ff1f169eb88b832059cd824c58c132463771e /packages/cli/src/ui/hooks/slashCommandProcessor.ts
parentfde5511c270ace148c6328b03fa61d917850f6d3 (diff)
feat: Show /ide subcommands based on connection status instead of ideMode boolean (#6496)
Diffstat (limited to 'packages/cli/src/ui/hooks/slashCommandProcessor.ts')
-rw-r--r--packages/cli/src/ui/hooks/slashCommandProcessor.ts19
1 files changed, 17 insertions, 2 deletions
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 (