Show top level dir (#4165)

* Reload FileTree and File when changed externally

* Added tests

* Show project root in files pane

* Cut off titles that are too long

* Fix tests
This commit is contained in:
49fl
2024-10-28 14:29:47 -04:00
committed by GitHub
parent 4a62862ca0
commit 05610bb0f3
11 changed files with 81 additions and 29 deletions

View File

@ -538,3 +538,19 @@ export const FileTreeInner = ({
</div>
)
}
export const FileTreeRoot = () => {
const loaderData = useRouteLoaderData(PATHS.FILE) as IndexLoaderData
const { project } = loaderData
// project.path should never be empty here but I guess during initial loading
// it can be.
return (
<div
className="max-w-xs text-ellipsis overflow-hidden cursor-pointer"
title={project?.path ?? ''}
>
{project?.name ?? ''}
</div>
)
}