修复了导入bug

This commit is contained in:
2026-03-04 10:28:31 +08:00
parent ea8113f072
commit 087323e58a
20 changed files with 355 additions and 173 deletions
+13 -6
View File
@@ -107,10 +107,10 @@ function TreeNode({
<div key={node.id} style={style} ref={setNodeRef} {...attributes} {...listeners}>
<div
className={cn(
"sidebar-tree-item group relative flex h-10 items-center justify-between rounded-lg border border-transparent px-1.5 text-[13px] transition-colors cursor-pointer select-none md:h-8",
"sidebar-tree-item group relative flex h-10 items-center justify-between rounded-lg border border-transparent px-1.5 text-[14px] transition-colors cursor-pointer select-none md:h-9 md:text-[13px]",
isActive
? "border-border/60 bg-accent/75 text-accent-foreground"
: "text-muted-foreground hover:border-border/45 hover:bg-muted/55 hover:text-foreground"
: "text-foreground/85 hover:border-border/45 hover:bg-muted/55 hover:text-foreground"
)}
onClick={() => {
setActivePageId(node.id);
@@ -127,7 +127,7 @@ function TreeNode({
toggleExpand(node.id);
}}
className={cn(
"flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground/70 transition-colors hover:bg-muted-foreground/15 hover:text-foreground md:h-6 md:w-6",
"flex h-9 w-9 items-center justify-center rounded-md text-muted-foreground/80 transition-colors hover:bg-muted-foreground/15 hover:text-foreground md:h-8 md:w-8",
!hasChildren && !isFolder && "invisible"
)}
>
@@ -147,7 +147,14 @@ function TreeNode({
)}
</span>
<span className="flex min-w-0 items-center gap-1.5">
<span className="truncate">{node.title || "无标题"}</span>
<span
className={cn(
"sidebar-title",
level === 0 ? "text-[15px] font-semibold md:text-[14px]" : "text-[14px] md:text-[13px]"
)}
>
{node.title || "无标题"}
</span>
{isFolder && (
<span className="inline-flex min-w-[1.2rem] shrink-0 items-center justify-center rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground">
{folderFileCount[node.id] ?? 0}
@@ -160,7 +167,7 @@ function TreeNode({
<DropdownMenu.Trigger asChild>
<button
onPointerDown={(e) => e.stopPropagation()}
className="flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground/75 transition-opacity hover:bg-muted-foreground/15 hover:text-foreground opacity-100 md:h-6 md:w-6 lg:opacity-0 lg:group-hover:opacity-100"
className="flex h-9 w-9 items-center justify-center rounded-md text-muted-foreground/85 transition-opacity hover:bg-muted-foreground/15 hover:text-foreground opacity-100 md:h-8 md:w-8 lg:opacity-0 lg:group-hover:opacity-100"
>
<MoreHorizontal size={13} />
</button>
@@ -268,7 +275,7 @@ export function TreeView({ pages, parentId, expanded, toggleExpand, level = 0, f
return (
<SortableContext items={nodes.map((n) => n.id)} strategy={verticalListSortingStrategy}>
<div className="flex flex-col gap-0.5">
<div className="flex flex-col gap-0 md:gap-0.5">
{nodes.map((node) => (
<TreeNode
key={node.id}