@zefina/inline-discussions 為 AI 生成的 Markdown 加入原位遞迴討論
In-Situ Recursive Discussions for AI-Generated Markdown (Zero-Login Demo)
Jagath Saradigi 建立開源 React 引擎 @zefina/inline-discussions,讓 AI 生成的 Markdown 回覆可直接加入原位上下文討論。
Traditional AI chat interfaces (like ChatGPT, Claude, and Gemini) have a fundamental UX flaw: everything flows to the bottom.
If an LLM writes a 600-word response and you have a doubt about a sentence at the top, you are forced to scroll to the very bottom, manually re-quote the text, and ask your question—completely breaking your reading flow.
To solve this, I built @zefina/inline-discussions: an open-source React engine that brings Google Docs-style contextual threads directly inside AI Markdown responses.
1) Video Demo:
2)Live Interactive Playground:https://jagathsaradagi.github.io/inline-discussions/
3)GitHub Repository:
How It Works
Highlight Any Sentence: Select any text in an AI response to open an in-situ ask box directly beneath that sentence.
DOM-to-AST Source Mapping: The engine maps browser text selections back to raw Markdown source coordinates using AST character maps.
Sibling-Block AST Injection: Instead of illegally nesting
cards inside HTML
tags, the compiler splits the parent paragraph into valid sibling blocks.
Arbitrary Recursion: You can highlight text inside a nested clarification at Depth 1 to branch a Depth 2 discussion, creating structured conversation trees.
The engine is completely headless, works with any AI model or backend, and is AGPL-3.0 dual-licensed.
Check out the interactive playground and let me know your thoughts!
來源:DEV Community · dev.to