fix: offer New folder in Clone Repo's parent folder picker (release review)

Clone Repo's custom folder became a parent that must already exist (#774),
while its picker still had no New folder button (#761 turned it on for
Create New only). A parent that does not exist yet was refused with no way
to make it from the form, so the same job worked on one tab and dead-ended
on the other.

The test pin that kept Clone off dated from when the field was the exact
target, which could be a folder not yet created. Clone moves to the on side
of that pin, so every picker in the file stays covered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-11-06 08:01:39 +01:00
1 parent ea5f6615c8
commit 436037e0e3
6 files changed
+22 -10

No files matched your search

+8 -1
View File
@@ -117,9 +117,16 @@ describe('Clone Repo custom folder', () => {
(win as unknown as { PathPicker: { open: unknown } }).PathPicker = { open };
(doc.getElementById('cloneCustomPathToggle') as HTMLInputElement).checked = true;
app.openCloneCasePathPicker();
const options = open.mock.calls[0]![0] as { title: string; directoriesOnly: boolean; onSelect(p: string): void };
const options = open.mock.calls[0]![0] as {
title: string;
directoriesOnly: boolean;
allowNewFolder: boolean;
onSelect(p: string): void;
};
expect(options.title).toBe('Choose the parent folder for the clone');
expect(options.directoriesOnly).toBe(true);
// A parent that does not exist yet is refused, so the picker has to be able to make it.
expect(options.allowNewFolder).toBe(true);
options.onSelect('/mnt/projects');
expect((doc.getElementById('cloneCasePath') as HTMLInputElement).value).toBe('/mnt/projects');
expect(preview()).toBe('Will clone into: /mnt/projects/bifrost');
+6 -2
View File
@@ -182,9 +182,13 @@ describe('PathPicker New folder', () => {
expect(pickerOptions('openNewCasePathPicker')).toContain('allowNewFolder: true');
});
it('is on for Link Existing and off for the Clone and Docker pickers', () => {
it("is on for Clone Repo's parent folder picker: that parent must already exist", () => {
expect(pickerOptions('openCloneCasePathPicker')).toContain('allowNewFolder: true');
});
it('is on for Link Existing and off for the Docker pickers', () => {
expect(pickerOptions('openLinkCasePathPicker')).toContain('allowNewFolder: true');
for (const other of ['openDockerWorkspacePathPicker', 'openDockerWorkdirPicker', 'openCloneCasePathPicker']) {
for (const other of ['openDockerWorkspacePathPicker', 'openDockerWorkdirPicker']) {
expect(pickerOptions(other), other).not.toContain('allowNewFolder');
}
});