feat: render research Markdown and navigate citations to deck posts

This commit is contained in:
2026-09-24 18:18:15 +09:00
parent 9c3917541b
commit bd9c1b77b7
26 changed files with 1970 additions and 20 deletions
+7 -1
View File
@@ -82,6 +82,7 @@ function publicPost(post: ResearchPost) {
throw new SourceFailure('invalid-source-result')
return {
key: post.key,
nativeId: post.nativeId,
platform: post.platform,
url: url.href,
text: post.text,
@@ -100,7 +101,11 @@ export function createResearchTools(
connections: Connection[],
onDeck: (deck: Deck) => void,
loadPage: FetchPage = fetchPage,
options: { contextDeck?: Deck; temporaryDeckId?: string } = {},
options: {
contextDeck?: Deck
temporaryDeckId?: string
onPosts?: (column: DeckColumn, posts: ResearchPost[]) => void
} = {},
) {
const selected = connections.map((connection) => ({
id: connection.id,
@@ -343,6 +348,7 @@ export function createResearchTools(
? page.nextCursor
: undefined
for (const post of posts) evidence.add(post.key)
options.onPosts?.(structuredClone(column), structuredClone(posts))
return {
ok: true,
column: structuredClone(column),