fix: >1 path breadcrumb not displaying root label

This commit is contained in:
2025-12-15 22:35:36 +00:00
parent 5beb238b6d
commit 23d9b2fefe

View File

@@ -52,9 +52,9 @@ export function DirectoryPathBreadcrumb({
const breadcrumbItems: React.ReactNode[] = [ const breadcrumbItems: React.ReactNode[] = [
<FilePathBreadcrumbItem <FilePathBreadcrumbItem
key={directory.path[0].id} key={directory.path[0]!.id}
segment={directory.path[0]} segment={directory.path[0]!}
rootLabel={rootLabel} label={rootLabel}
directoryUrlFn={directoryUrlFn} directoryUrlFn={directoryUrlFn}
fileDragInfoAtom={fileDragInfoAtom} fileDragInfoAtom={fileDragInfoAtom}
/>, />,
@@ -65,7 +65,6 @@ export function DirectoryPathBreadcrumb({
<BreadcrumbSeparator /> <BreadcrumbSeparator />
<FilePathBreadcrumbItem <FilePathBreadcrumbItem
segment={directory.path[i]!} segment={directory.path[i]!}
rootLabel={rootLabel}
directoryUrlFn={directoryUrlFn} directoryUrlFn={directoryUrlFn}
fileDragInfoAtom={fileDragInfoAtom} fileDragInfoAtom={fileDragInfoAtom}
/> />
@@ -88,12 +87,12 @@ export function DirectoryPathBreadcrumb({
function FilePathBreadcrumbItem({ function FilePathBreadcrumbItem({
segment, segment,
rootLabel, label,
directoryUrlFn, directoryUrlFn,
fileDragInfoAtom, fileDragInfoAtom,
}: { }: {
segment: PathSegment segment: PathSegment
rootLabel: string label?: string
directoryUrlFn: (directoryId: string) => string directoryUrlFn: (directoryId: string) => string
fileDragInfoAtom: PrimitiveAtom<FileDragInfo | null> fileDragInfoAtom: PrimitiveAtom<FileDragInfo | null>
}) { }) {
@@ -102,7 +101,7 @@ function FilePathBreadcrumbItem({
dragInfoAtom: fileDragInfoAtom, dragInfoAtom: fileDragInfoAtom,
}) })
const dirName = segment.name || rootLabel const dirName = label || segment.name
return ( return (
<Tooltip open={isDraggedOver}> <Tooltip open={isDraggedOver}>