Fix delete workspace confirmation spacing (#6304)

This commit is contained in:
Brennan Benson
2026-06-24 16:51:08 -07:00
committed by GitHub
parent a82859020f
commit 379db68e43
2 changed files with 19 additions and 1 deletions
@@ -115,6 +115,10 @@ function buttonText(props: Record<string, unknown>): 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(<DeleteWorktreeDialog />)
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 }
@@ -16,7 +16,7 @@ export function DeleteWorktreeDialogDescription({
}): React.JSX.Element {
return (
<DialogDescription className="text-xs">
{translate('auto.components.sidebar.DeleteWorktreeDialog.91492c9ad6', 'Remove')}
{translate('auto.components.sidebar.DeleteWorktreeDialog.91492c9ad6', 'Remove')}{' '}
<span className={targetClassName}>{targetLabel}</span>
{canDeleteAllLineage ? (
<>