feat: Show /ide subcommands based on connection status instead of ideMode boolean (#6496)

This commit is contained in:
Shreya Keshive 2025-08-19 10:24:58 -07:00 committed by GitHub
parent fde5511c27
commit 9588aa6ef9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 60 additions and 12 deletions

View file

@ -237,13 +237,11 @@ export const ideCommand = (config: Config | null): SlashCommand | null => {
},
};
const ideModeEnabled = config.getIdeMode();
if (ideModeEnabled) {
ideSlashCommand.subCommands = [
disableCommand,
statusCommand,
installCommand,
];
const { status } = ideClient.getConnectionStatus();
const isConnected = status === IDEConnectionStatus.Connected;
if (isConnected) {
ideSlashCommand.subCommands = [statusCommand, disableCommand];
} else {
ideSlashCommand.subCommands = [
enableCommand,