From 64193f2aa55b5b36b4cc701fcd239cf3fa4e0aaf Mon Sep 17 00:00:00 2001 From: richblack Date: Thu, 14 May 2026 18:01:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(mira):=20wiki=20listing=20=E5=8A=A0=20Inde?= =?UTF-8?q?x=20Entries=20section=EF=BC=88CC=20navigation=20=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit leo 反饋:原本只看到 wiki-page 列表沒看到 per-entity index-entry, 不知道 CC 從哪入口。新增 section 列出所有 type=index-entry blocks, 標題用 entity 名稱(剝 `index-` prefix),點進去看完整 markdown 摘要。 對應 design.md §3.5.12.4.2 雙層 outliner(v1.6): - 概覽層:index-entry markdown(含「段落 outline」/「涵蓋面向」等) - 完整 outliner:wiki page 自身(7B.3g 已實現的樹狀渲染) 部署:arcrun-landing.pages.dev(手動 wrangler pages deploy)。 --- landing/app/mira/wiki/page.tsx | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/landing/app/mira/wiki/page.tsx b/landing/app/mira/wiki/page.tsx index b2ef637..7b96d7e 100644 --- a/landing/app/mira/wiki/page.tsx +++ b/landing/app/mira/wiki/page.tsx @@ -28,6 +28,7 @@ export default function WikiIndexPage() { const [indexChildren, setIndexChildren] = useState([]); const [logEntries, setLogEntries] = useState([]); const [otherWikiPages, setOtherWikiPages] = useState([]); + const [indexEntries, setIndexEntries] = useState([]); const [loading, setLoading] = useState(true); const [error, setError] = useState(null); @@ -95,6 +96,22 @@ export default function WikiIndexPage() { .filter((b) => !hasAnyInfraSubtype(b) && !hasMetaTag(b)) .sort((a, b) => (b.created_at ?? 0) - (a.created_at ?? 0)), ); + + // 平行撈 index-entry blocks(per-entity 摘要,CC navigation entry point) + // 對應 design.md §3.5.12.4.1 / 7B.3f + const idxRes = await fetch( + `${KBDB_BASE}/blocks?type=index-entry&limit=200`, + { headers }, + ); + if (idxRes.ok) { + const idxData = await idxRes.json(); + if (!cancelled) { + const idxBlocks: Block[] = idxData.blocks ?? []; + setIndexEntries( + idxBlocks.sort((a, b) => (a.page_name ?? '').localeCompare(b.page_name ?? '')), + ); + } + } } catch (e: any) { if (!cancelled) setError(e?.message ?? 'load failed'); } finally { @@ -163,6 +180,29 @@ export default function WikiIndexPage() { )} +
+ {indexEntries.length > 0 ? ( +
+ {indexEntries.map((b) => { + const entity = (b.page_name ?? '').replace(/^index-/, ''); + const firstLine = firstLineOf(b.content) + .replace(/^#+\s*/, '') + .slice(0, 80); + return ( + + ); + })} +
+ ) : ( + 尚未有 index-entry(wiki_synthesis 跑完後自動建) + )} +
+
{logEntries.length > 0 ? (