Skip to content

Commit 76d4783

Browse files
fix(web): preserve all project picker paths and filesystem roots
Show the path for single repositories without a GitHub identity. Keep Windows drive and network share roots intact when splitting display paths. All 31 project import tests pass, including five root cases that failed before the fix. Web typecheck passes; existing lint warnings are unchanged. Browser verification could not run because the computer-use service is unavailable.
1 parent 69bb0ad commit 76d4783

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

‎apps/web/src/components/onboarding/WelcomeWizard.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ function ImportRepositoryGroup({
13841384
<ImportCandidateRow
13851385
candidate={only}
13861386
label={group.label}
1387-
{...(group.repository === null ? {} : { path: only.path })}
1387+
path={only.path}
13881388
checked={selectedKeys.has(only.key)}
13891389
onCheckedChange={(checked) => onToggle([only.key], checked)}
13901390
/>

‎apps/web/src/onboarding/projectImport.logic.test.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,4 +373,18 @@ describe("splitOnboardingProjectPath", () => {
373373
expect(splitOnboardingProjectPath("t3code")).toEqual({ name: "t3code", parent: "" });
374374
expect(splitOnboardingProjectPath("t3code/")).toEqual({ name: "t3code", parent: "" });
375375
});
376+
377+
it.each(["C:\\", "C:/", "\\\\server\\share", "\\\\server\\share\\", "//server/share/"])(
378+
"keeps the filesystem root %s whole",
379+
(path) => {
380+
expect(splitOnboardingProjectPath(path)).toEqual({ name: path, parent: "" });
381+
},
382+
);
383+
384+
it("splits a folder below a network share", () => {
385+
expect(splitOnboardingProjectPath("\\\\server\\share\\project\\")).toEqual({
386+
name: "project",
387+
parent: "\\\\server\\share\\",
388+
});
389+
});
376390
});

‎apps/web/src/onboarding/projectImport.logic.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ export function splitOnboardingProjectPath(path: string): {
145145
readonly name: string;
146146
readonly parent: string;
147147
} {
148+
if (/^[A-Za-z]:[\\/]+$/.test(path) || /^[\\/]{2}[^\\/]+[\\/][^\\/]+[\\/]*$/.test(path)) {
149+
return { name: path, parent: "" };
150+
}
148151
const trimmed = path.replace(/[\\/]+$/, "");
149152
const separatorIndex = Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\"));
150153
if (trimmed.length === 0) return { name: path, parent: "" };

0 commit comments

Comments
 (0)