Skip to content

feat(picker): New folder button for Create New's custom folder picker - #761

Merged
Ark0N merged 2 commits into
Ark0N:masterfrom
opticon454:feature/picker-new-folder-create-case
Nov 6, 2026
Merged

Ark0N merged 2 commits into
Ark0N:masterfrom
opticon454:feature/picker-new-folder-create-case

Conversation

@opticon454

Copy link
Copy Markdown
Contributor

Context

Create New has a Create in a custom folder option whose Browse opens the path picker ("Choose the folder to create the case in"). Like Link Existing's picker, it could only choose a folder that already exists, so putting a new case in a new folder meant making that folder in a shell first.

This turns on the New folder button for that picker.

Stacked on #745, which adds the button, the POST /api/filesystem/mkdir route and their tests. Until #745 merges this PR's diff also shows that commit; the change that is new here is one line in session-ui.js (allowNewFolder: true on openNewCasePathPicker()), a test, and the docs line naming the second caller. I will rebase onto master once #745 merges so the diff is only that.

What changed

  • openNewCasePathPicker() passes allowNewFolder: true. The folder made inside the viewed folder is selected, and Create New's existing rules still judge it when the case is created (prepareNewCasePath(): not a system or credentials folder, not the cases folder, and so on), so a folder made here is no more trusted than one picked from the list.
  • test/path-picker-new-folder.test.ts: one more case, that this picker opts in.
  • The picker paragraph in CLAUDE.md and docs/architecture-invariants.md names both callers.

Verification

Turns on the picker's New folder button for "Choose the folder to create the
case in", the folder picker behind Create New's custom folder option.
@Ark0N

Ark0N commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Thank you for this one. It turns on the New folder button in Create New's custom folder picker, so a new case can go into a folder that does not exist yet without a trip to a shell.

I ran the whole flow in Chromium (Browse, New folder, Select, Create) on this branch and on a merge with master, and it works. The new test fails when the flag is removed, so it pins the right thing. Three small items are left:

  1. Merge conflict, CLAUDE.md:233. feat(picker): New folder button in the path picker, on for Link Existing #745 is in, and master changed two em-dashes to colons in the picker paragraph, so that one line conflicts. The resolution is master's line with your phrase "Link Existing and Create New's custom folder have it". The other three files merge cleanly.
  2. User manual, docs/wiki/Working-With-Files.md:162 (line 174 on master). It still says "In Link Existing's picker". It needs to name both pickers, since docs/wiki/ is the manual users read.
  3. Test, test/path-picker-new-folder.test.ts:182. Master has openCloneCasePathPicker from feat(cases): clone a repository into a custom folder #744, which does not set the flag. It belongs in the other list, so the test keeps covering every picker in the file.

I will apply all three at merge, so no push is needed from you.

@opticon454
opticon454 force-pushed the feature/picker-new-folder-create-case branch from 1598dd2 to b89de12 Compare November 5, 2026 00:16
@opticon454

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Rebased onto 1.48.0 (2aa6016d) and force-pushed, with all three items done so you do not need to apply them:

  1. CLAUDE.md: master's wording with "Link Existing and Create New's custom folder have it".
  2. docs/wiki/Working-With-Files.md: the New folder paragraph now names both pickers.
  3. test/path-picker-new-folder.test.ts: openCloneCasePathPicker is in the other list.

Checked here: path-picker-new-folder.test.ts (10 passed), typecheck and format. I did not rerun the whole suite for this small change.

@Ark0N

Ark0N commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Thank you for this one, and for the quick rebase. It turns on the New folder button in Create New's custom folder picker, so a new case can go into a folder that does not exist yet without a trip to a shell.

All three items from the last round are in. I ran the rebased head in Chromium (Browse, New folder, Select, Create, including a folder name with a space) and the case landed in the new folder, scaffolded and listed. CI is green, and the new test fails when the flag is removed.

Three small things are left, and none of them needs a push from you:

  1. Refusal wording, src/web/routes/file-routes.ts:1493. With the folder field empty, Browse opens in the cases folder, and New folder there answers "Use Add Case > New Case to make one there". A Create New user is already on that tab, and its label is "Create New". The sentence needs to work for both pickers, for example "Pick a folder outside it, or make the case with Add Case > Create New (no custom folder)." The test pin at test/routes/filesystem-mkdir-routes.test.ts:54 and docs/wiki/Working-With-Files.md:177 move with it. The wording predates this PR, which gives it a second caller.
  2. Test guard, test/path-picker-new-folder.test.ts:178. block() returns an empty string for a picker name that is not in the file, so .not.toContain passes and a renamed picker drops out of the check. expect(start, name).toBeGreaterThan(-1) inside block closes that.
  3. Manual, docs/wiki/Working-With-Files.md:160 and :174. Line 160 says the picker appears in two places and leaves out Create New, which line 174 now names. Line 174 also runs to 125 columns in a page wrapped at about 90.

I will apply all three at merge.

@Ark0N
Ark0N merged commit ae0de7a into Ark0N:master Nov 6, 2026
2 checks passed
Ark0N pushed a commit that referenced this pull request Nov 6, 2026
…lder picker

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ark0N pushed a commit that referenced this pull request Nov 6, 2026
…eview)

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>
@opticon454
opticon454 deleted the feature/picker-new-folder-create-case branch November 6, 2026 09:45
@Ark0N

Ark0N commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Thank you, this is in the 1.49.0 release. The three items from my last comment went in at merge, and the status line now wraps so a long refusal can be read. Since #774 makes Clone Repo's field a parent, its picker has the New folder button too, and the refusal in the cases folder now names both tabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants