Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/cli/src/ui/AppContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,9 @@ Logging in with Google... Restarting Gemini CLI to continue.
(result: IdeIntegrationNudgeResult) => {
if (result.userSelection === 'yes') {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
handleSlashCommand('/ide install');
handleSlashCommand(
result.isExtensionPreInstalled ? '/ide enable' : '/ide install',
);
settings.setValue(SettingScope.User, 'ide.hasSeenNudge', true);
} else if (result.userSelection === 'dismiss') {
settings.setValue(SettingScope.User, 'ide.hasSeenNudge', true);
Expand Down
32 changes: 32 additions & 0 deletions packages/cli/src/ui/IdeIntegrationNudge.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,36 @@ describe('IdeIntegrationNudge', () => {
});
unmount();
});

it('sets isExtensionPreInstalled to true in onComplete value for dismiss selection when preinstalled envs are set', async () => {
vi.stubEnv('GEMINI_CLI_IDE_SERVER_PORT', '1234');
vi.stubEnv('GEMINI_CLI_IDE_WORKSPACE_PATH', '/tmp');

const onComplete = vi.fn();
const { stdin, waitUntilReady, unmount } = await renderWithProviders(
<IdeIntegrationNudge {...defaultProps} onComplete={onComplete} />,
);

// Navigate to "No, don't ask again"
await act(async () => {
stdin.write('\u001B[B'); // Down arrow
});
await waitUntilReady();

await act(async () => {
stdin.write('\u001B[B'); // Down arrow
});
await waitUntilReady();

await act(async () => {
stdin.write('\r'); // Enter
});
await waitUntilReady();

expect(onComplete).toHaveBeenCalledWith({
userSelection: 'dismiss',
isExtensionPreInstalled: true,
});
unmount();
});
});
Loading