diff --git a/src/renderer/src/components/sidebar/DeleteWorktreeDialog.test.tsx b/src/renderer/src/components/sidebar/DeleteWorktreeDialog.test.tsx index e09257ea01f..2a7e5bfbc36 100644 --- a/src/renderer/src/components/sidebar/DeleteWorktreeDialog.test.tsx +++ b/src/renderer/src/components/sidebar/DeleteWorktreeDialog.test.tsx @@ -115,6 +115,10 @@ function buttonText(props: Record): string { return renderToStaticMarkup(<>{props.children as ReactNode}) } +function visibleMarkupText(markup: string): string { + return markup.replace(/<[^>]*>/g, '') +} + describe('DeleteWorktreeDialog lineage copy', () => { beforeEach(() => { vi.clearAllMocks() @@ -212,6 +216,20 @@ describe('DeleteWorktreeDialog lineage copy', () => { expect(markup).not.toContain('including uncommitted or untracked files') }) + it('keeps a space between remove copy and the workspace name', async () => { + const workspace = makeWorktree('Hide working dot', '/workspaces/hide-working-dot') + mocks.state.modalData = { worktreeId: workspace.id } + mocks.state.allWorktrees.mockReturnValue([workspace]) + + const { default: DeleteWorktreeDialog } = await import('./DeleteWorktreeDialog') + const markup = renderToStaticMarkup() + + expect(visibleMarkupText(markup)).toContain( + 'Remove Hide working dot from git and delete its workspace folder.' + ) + expect(markup).not.toContain('RemoveHide working dot') + }) + it('shows an inline warning when the workspace has uncommitted or untracked changes', async () => { const workspace = makeWorktree('Feature workspace', '/workspaces/feature') mocks.state.modalData = { worktreeId: workspace.id } diff --git a/src/renderer/src/components/sidebar/DeleteWorktreeDialogDescription.tsx b/src/renderer/src/components/sidebar/DeleteWorktreeDialogDescription.tsx index 0d960e16844..60beeda6759 100644 --- a/src/renderer/src/components/sidebar/DeleteWorktreeDialogDescription.tsx +++ b/src/renderer/src/components/sidebar/DeleteWorktreeDialogDescription.tsx @@ -16,7 +16,7 @@ export function DeleteWorktreeDialogDescription({ }): React.JSX.Element { return ( - {translate('auto.components.sidebar.DeleteWorktreeDialog.91492c9ad6', 'Remove')} + {translate('auto.components.sidebar.DeleteWorktreeDialog.91492c9ad6', 'Remove')}{' '} {targetLabel} {canDeleteAllLineage ? ( <>