mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 05:55:17 -07:00
fix(cli): added directory name to folder trust dialog (#8165)
Co-authored-by: Taneja Hriday <hridayt@google.com>
This commit is contained in:
@@ -98,7 +98,15 @@ describe('FolderTrustDialog', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('parentFolder display', () => {
|
describe('directory display', () => {
|
||||||
|
it('should correctly display the folder name for a nested directory', () => {
|
||||||
|
mockedCwd.mockReturnValue('/home/user/project');
|
||||||
|
const { lastFrame } = renderWithProviders(
|
||||||
|
<FolderTrustDialog onSelect={vi.fn()} />,
|
||||||
|
);
|
||||||
|
expect(lastFrame()).toContain('Trust folder (project)');
|
||||||
|
});
|
||||||
|
|
||||||
it('should correctly display the parent folder name for a nested directory', () => {
|
it('should correctly display the parent folder name for a nested directory', () => {
|
||||||
mockedCwd.mockReturnValue('/home/user/project');
|
mockedCwd.mockReturnValue('/home/user/project');
|
||||||
const { lastFrame } = renderWithProviders(
|
const { lastFrame } = renderWithProviders(
|
||||||
|
|||||||
@@ -46,11 +46,12 @@ export const FolderTrustDialog: React.FC<FolderTrustDialogProps> = ({
|
|||||||
{ isActive: !!isRestarting },
|
{ isActive: !!isRestarting },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const dirName = path.basename(process.cwd());
|
||||||
const parentFolder = path.basename(path.dirname(process.cwd()));
|
const parentFolder = path.basename(path.dirname(process.cwd()));
|
||||||
|
|
||||||
const options: Array<RadioSelectItem<FolderTrustChoice>> = [
|
const options: Array<RadioSelectItem<FolderTrustChoice>> = [
|
||||||
{
|
{
|
||||||
label: 'Trust folder',
|
label: `Trust folder (${dirName})`,
|
||||||
value: FolderTrustChoice.TRUST_FOLDER,
|
value: FolderTrustChoice.TRUST_FOLDER,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user