From 69b2d77df503d757b6f82b2f9b9cc15eebaec988 Mon Sep 17 00:00:00 2001 From: hritan <48129645+hritan@users.noreply.github.com> Date: Wed, 10 Sep 2025 16:31:12 +0000 Subject: [PATCH] fix(cli): added directory name to folder trust dialog (#8165) Co-authored-by: Taneja Hriday --- .../cli/src/ui/components/FolderTrustDialog.test.tsx | 10 +++++++++- packages/cli/src/ui/components/FolderTrustDialog.tsx | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/ui/components/FolderTrustDialog.test.tsx b/packages/cli/src/ui/components/FolderTrustDialog.test.tsx index c583617aae..649ae8967c 100644 --- a/packages/cli/src/ui/components/FolderTrustDialog.test.tsx +++ b/packages/cli/src/ui/components/FolderTrustDialog.test.tsx @@ -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( + , + ); + expect(lastFrame()).toContain('Trust folder (project)'); + }); + it('should correctly display the parent folder name for a nested directory', () => { mockedCwd.mockReturnValue('/home/user/project'); const { lastFrame } = renderWithProviders( diff --git a/packages/cli/src/ui/components/FolderTrustDialog.tsx b/packages/cli/src/ui/components/FolderTrustDialog.tsx index 0060187925..ebcadd7a35 100644 --- a/packages/cli/src/ui/components/FolderTrustDialog.tsx +++ b/packages/cli/src/ui/components/FolderTrustDialog.tsx @@ -46,11 +46,12 @@ export const FolderTrustDialog: React.FC = ({ { isActive: !!isRestarting }, ); + const dirName = path.basename(process.cwd()); const parentFolder = path.basename(path.dirname(process.cwd())); const options: Array> = [ { - label: 'Trust folder', + label: `Trust folder (${dirName})`, value: FolderTrustChoice.TRUST_FOLDER, }, {