Skip to content
20 changes: 3 additions & 17 deletions apps/web/src/components/files/FileBrowserPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { useTheme } from "~/hooks/useTheme";
import { cn } from "~/lib/utils";
import { readLocalApi } from "~/localApi";
import { T3_PIERRE_ICONS } from "~/pierre-icons";
import { PIERRE_TREE_UNSAFE_CSS, pierreTreeStyle } from "~/pierre-tree-theme";

import { createFileTreeDragMentionController } from "./fileTreeDragMention";
import { useProjectEntriesQuery } from "./projectFilesQueryState";
Expand All @@ -33,18 +34,6 @@ interface FileBrowserPanelProps {
onOpenFile: (relativePath: string) => void;
}

const TREE_UNSAFE_CSS = `
:host {
--trees-bg-override: transparent;
--trees-selected-bg-override: color-mix(in srgb, currentColor 12%, transparent);
--trees-hover-bg-override: color-mix(in srgb, currentColor 7%, transparent);
--trees-border-color-override: color-mix(in srgb, currentColor 14%, transparent);
--trees-font-family-override: var(--font-sans);
--trees-font-size-override: 12px;
}
button[data-type='item'] { border-radius: 5px; }
`;

function treePath(entry: ProjectEntry): string {
return entry.kind === "directory" ? `${entry.path}/` : entry.path;
}
Expand Down Expand Up @@ -244,7 +233,7 @@ export default function FileBrowserPanel({
},
paths: [],
search: false,
unsafeCSS: TREE_UNSAFE_CSS,
unsafeCSS: PIERRE_TREE_UNSAFE_CSS,
});
const search = useFileTreeSearch(model);
const handleSearchValueChange = (value: string) => {
Expand Down Expand Up @@ -370,10 +359,7 @@ export default function FileBrowserPanel({
model={model}
aria-label={`${projectName} files`}
className="min-h-0 flex-1 overflow-hidden"
style={{
colorScheme: resolvedTheme,
["--trees-fg-override" as string]: "var(--foreground)",
}}
style={pierreTreeStyle(resolvedTheme)}
/>
)}
</div>
Expand Down
Loading
Loading