mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-14 10:39:32 +01:00
Merge #761 feat(picker): New folder button for Create New's custom folder picker
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
9ba5a89123
9 files changed
+63
-31
No files matched your search
@@ -4051,6 +4051,7 @@ Object.assign(CodemanApp.prototype, {
|
||||
title: 'Choose the folder to create the case in',
|
||||
initialPath: input.value.trim(),
|
||||
directoriesOnly: true,
|
||||
allowNewFolder: true,
|
||||
onSelect: (path) => {
|
||||
input.value = path;
|
||||
this.updateNewCasePathPreview();
|
||||
|
||||
@@ -16016,8 +16016,10 @@ body.touch-device.cjk-input-visible .main {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* An ordinary status fits one line; a refusal may not, and it must be readable whole. */
|
||||
.path-picker-status.error {
|
||||
color: var(--danger, #ef4444);
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.path-picker-list {
|
||||
|
||||
@@ -1500,7 +1500,9 @@ export function registerFileRoutes(app: FastifyInstance, ctx: SessionPort & Even
|
||||
}
|
||||
// The cases directories (shared, and the caller's own in multi-user mode) are what GET /api/cases lists as
|
||||
// local cases: a folder made there is a case with no scaffold, which Link then refuses by name and which
|
||||
// deleting would take the linked folder with. A case there is made through Add Case > New Case.
|
||||
// deleting would take the linked folder with. A case there is made through Add Case > Create New with no
|
||||
// custom folder. The refusal has to read right from both pickers that offer New folder: a Create New user
|
||||
// is already on that tab, with the custom folder ticked.
|
||||
const casesDirs = await Promise.all(
|
||||
[...new Set([CASES_DIR, resolveCasesDir(getAuthUser(req))])].map((dir) =>
|
||||
fs.realpath(dir).catch(() => resolve(dir))
|
||||
@@ -1510,7 +1512,7 @@ export function registerFileRoutes(app: FastifyInstance, ctx: SessionPort & Even
|
||||
reply.code(400);
|
||||
return createErrorResponse(
|
||||
ApiErrorCode.INVALID_INPUT,
|
||||
'This is a cases folder: every folder in it is a case. Use Add Case > New Case to make one there.'
|
||||
'This is a cases folder: every folder in it is a case. Pick a folder outside it, or make the case with Add Case > Create New (no custom folder).'
|
||||
);
|
||||
}
|
||||
// Like browse, a file is not a place to create in.
|
||||
|
||||
Reference in new issue
Block a user