fix: bug
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
Globe,
|
||||
FileStack,
|
||||
Settings2,
|
||||
ChevronDown,
|
||||
} from "lucide-react";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { Separator } from "@/components/ui/separator";
|
||||
@@ -21,6 +22,7 @@ export function AppSidebar() {
|
||||
const pathname = usePathname();
|
||||
const [cloudDocs, setCloudDocs] = useState<CloudDocLinkRead[]>([]);
|
||||
const [portalLinks, setPortalLinks] = useState<PortalLinkRead[]>([]);
|
||||
const [projectArchiveOpen, setProjectArchiveOpen] = useState(false);
|
||||
|
||||
const loadCloudDocs = useCallback(async () => {
|
||||
try {
|
||||
@@ -90,6 +92,24 @@ export function AppSidebar() {
|
||||
))}
|
||||
</nav>
|
||||
<Separator />
|
||||
{/* 项目档案放在云文档之前,支持收纳折叠 */}
|
||||
<div className="px-2 pt-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setProjectArchiveOpen((v) => !v)}
|
||||
className="w-full flex items-center justify-between text-xs text-muted-foreground hover:text-foreground"
|
||||
>
|
||||
<span>项目档案</span>
|
||||
<ChevronDown
|
||||
className={cn(
|
||||
"h-3 w-3 transition-transform",
|
||||
projectArchiveOpen ? "rotate-180" : "rotate-0"
|
||||
)}
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
{projectArchiveOpen && <HistoricalReferences />}
|
||||
<Separator />
|
||||
<div className="flex-1 min-h-0 overflow-y-auto flex flex-col">
|
||||
<div className="p-2 shrink-0">
|
||||
<div className="flex items-center justify-between px-2 mb-2">
|
||||
@@ -156,7 +176,6 @@ export function AppSidebar() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{pathname === "/workspace" && <HistoricalReferences />}
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user