0.1.13 AI功能大改

This commit is contained in:
liaibo
2026-01-10 23:08:56 +08:00
parent 63050f3927
commit be71849aa5
37 changed files with 6400 additions and 160 deletions
+8 -3
View File
@@ -20,15 +20,20 @@ export function Breadcrumb({ documents }: BreadcrumbProps) {
const showInspector = usePageLayoutStore((state) => state.showInspector);
const toggleInspector = usePageLayoutStore((state) => state.toggleInspector);
if (!path.length) {
// 新建页面后,侧边栏数据可能还没同步到 layout(SSR)注入的 documents,导致 findBreadcrumb 暂时为空。
// 这里用 activeId 兜底,避免右上角“收藏/更多”按钮消失。
if (!activeId) {
return <div className="text-sm text-gray-400"></div>;
}
const displayPath: Array<Pick<DocumentRecord, "id" | "title">> = path.length
? path
: [{ id: activeId, title: "无标题" }];
return (
<div className="flex flex-1 items-center justify-between">
<nav className="flex items-center text-sm text-gray-500">
{path.map((node, index) => {
const isLast = index === path.length - 1;
{displayPath.map((node, index) => {
const isLast = index === displayPath.length - 1;
return (
<span key={node.id} className="flex items-center">
{index > 0 && <ChevronRight className="mx-1 h-4 w-4 text-gray-400" />}