From 39fad306c331431e2e9f7c5a4d75c8ab04835441 Mon Sep 17 00:00:00 2001 From: Codex Bot Date: Thu, 29 Oct 2026 16:49:31 +0800 Subject: [PATCH] Connect discovery and navigation to real published documents --- apps/waterfall-wiki/src/components/GuidanceShell.tsx | 2 +- apps/waterfall-wiki/src/pages/index.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/waterfall-wiki/src/components/GuidanceShell.tsx b/apps/waterfall-wiki/src/components/GuidanceShell.tsx index 9f88625..bcc5985 100644 --- a/apps/waterfall-wiki/src/components/GuidanceShell.tsx +++ b/apps/waterfall-wiki/src/components/GuidanceShell.tsx @@ -1,4 +1,4 @@ import Link from 'next/link'; import type {ReactNode} from 'react'; import s from '@/styles/guidance.module.css'; -export default function GuidanceShell({children}:{children:ReactNode}){return
↗ 织页 实验版登录 / 注册 ↗
{children}
织页 · Linked Guidance · 名称与协议仍在探索中让每一页都能成为起点 ↗
} +export default function GuidanceShell({children}:{children:ReactNode}){return
↗ 织页 实验版登录 / 注册 ↗
{children}
织页 · Linked Guidance · 名称与协议仍在探索中让每一页都能成为起点 ↗
} diff --git a/apps/waterfall-wiki/src/pages/index.tsx b/apps/waterfall-wiki/src/pages/index.tsx index a0943b7..200d64f 100644 --- a/apps/waterfall-wiki/src/pages/index.tsx +++ b/apps/waterfall-wiki/src/pages/index.tsx @@ -1,7 +1,7 @@ import Head from 'next/head'; import Link from 'next/link'; -import {useState} from 'react'; +import {useEffect,useState} from 'react'; import GuidanceShell from '@/components/GuidanceShell'; import {guides} from '@/content/guides/catalog'; import s from '@/styles/guidance.module.css'; -export default function Home(){const[q,setQ]=useState(''),[kind,setKind]=useState('all');const items=guides.filter(g=>(kind==='all'||g.kind===kind)&&`${g.title} ${g.summary} ${g.tags.join(' ')}`.toLowerCase().includes(q.toLowerCase()));return 织页 · 为 Agent 找到下一页
A WEB OF USEFUL KNOWLEDGE

一个起点,
连接下一种可能。

每一篇文档,都能独立帮助你的 Agent。
从当前问题出发,沿着有用的链接继续探索。

{['代码审查','规划','验证'].map(t=>)}

从这里开始 {items.length} 篇

协议样例 · v0.1
{items.map(g=>
{g.kind==='guide'?'↗':'≋'}
织页 / protocol-examples · r{g.revision}

{g.title}

{g.summary}

{g.tags.map(t=>{t})}↗ {g.links.length} 个关联
)}{!items.length&&

没有匹配文档,请尝试其他关键词或分类。

}
} +export default function Home(){const [published,setPublished]=useState<{id:string;revision:number;title:string;summary:string;kind:string}[]>([]),[loadError,setLoadError]=useState('');useEffect(()=>{fetch('/api/documents').then(async r=>{const b=await r.json();if(!r.ok)throw Error(b.error);setPublished(b.documents);}).catch(e=>setLoadError(e.message));},[]);const[q,setQ]=useState(''),[kind,setKind]=useState('all');const items=guides.filter(g=>(kind==='all'||g.kind===kind)&&`${g.title} ${g.summary} ${g.tags.join(' ')}`.toLowerCase().includes(q.toLowerCase()));return 织页 · 为 Agent 找到下一页
A WEB OF USEFUL KNOWLEDGE

一个起点,
连接下一种可能。

每一篇文档,都能独立帮助你的 Agent。
从当前问题出发,沿着有用的链接继续探索。

{['代码审查','规划','验证'].map(t=>)}

用户发布

发布一篇文档 ↗
{loadError&&

{loadError}

}
{published.filter(g=>(kind==='all'||g.kind===kind)&&`${g.title} ${g.summary}`.toLowerCase().includes(q.toLowerCase())).map(g=>
↗
{g.id} · {g.kind} · v{g.revision}

{g.title}

{g.summary}

)}

从这里开始 {items.length} 篇

协议样例 · v0.1
{items.map(g=>
{g.kind==='guide'?'↗':'≋'}
织页 / protocol-examples · r{g.revision}

{g.title}

{g.summary}

{g.tags.map(t=>{t})}↗ {g.links.length} 个关联
)}{!items.length&&

没有匹配文档,请尝试其他关键词或分类。

}
}