aiecho-react-chat: AI Echo React Chat: A Debugger for Gemini’s Hidden Conversation

A local React viewer that reconstructs turns, reveals reasoning on demand, and turns Gemini JSON exports into a navigable, citation-aware transcript.

7 min read • View on GitHub • More from mirzahusadzic

A wide editorial scene of layered conversation sheets on a white desk, with a hand lifting the top layer to reveal a hidden reasoning layer beneath. A sidebar index and a thin citation ledger frame the stack, showing that the app is about inspection, not just chat.
AI Echo React Chat treats an exported Gemini log like evidence, with layers you can reveal, index, and inspect.
Key Takeaways

Most chat apps optimize for the moment of conversation. This one optimizes for the afterward. You load a Gemini export, and the UI stops behaving like a messenger and starts behaving like a forensic viewer for model behavior.

The Chat Window That Shows Its Work

That framing matters because it changes what counts as a good interface. Instead of flattening everything into one stream of bubbles, the app preserves the structure inside Gemini output: user message, thought, final answer, and grounding data. The result is less like a conversation app and more like a transcript debugger.

An interactive React application to explore and visualize Gemini chat conversations with advanced rendering, sidebar navigation, and local JSON file loading.

mirzahusadzic, Project Maintainer · mirzahusadzic/aiecho-react-chat - GitHub

From Chunked JSON to Human-Readable Turns

The key move happens in App.jsx. The app does not trust the export as a ready-made conversation. It groups chunked JSON into turns, then keeps an originalIndexToTurnIndexMap so sidebar clicks and scroll position still make sense after the data is reassembled.

Raw Gemini chunks become navigable turns through a parser, an index map, and a virtualized renderer.

That index map is not a small detail. It is what makes long logs feel searchable and stable even after grouping, because the navigation layer can jump from a raw source position to the right rendered turn without guesswork.

const groupedTurns = useMemo(() => buildTurns(chunks), [chunks]);
const originalIndexToTurnIndexMap = useMemo(
  () => buildIndexMap(groupedTurns),
  [groupedTurns]
);

function handleSidebarClick(originalIndex) {
  const turnIndex = originalIndexToTurnIndexMap.get(originalIndex);
  listRef.current?.scrollToItem(turnIndex, 'center');
}

Why the Thinking Toggle Changes the UX

The most interesting interaction here is the collapsible thought block. Hiding model reasoning outright makes the transcript opaque. Forcing it open makes the interface noisy. This middle path keeps the reasoning available without making every answer harder to scan.

A close-up editorial illustration of a single conversation card split into two stacked layers, with a latch holding the upper thought layer open. Beneath it sits the final answer and a slim citation strip, showing how the interface can reveal or hide internal reasoning without losing structure.
The collapsible thought pattern preserves transparency without turning every response into visual clutter.

That is the conceptual heart of the repo. It treats reasoning as part of the record, but not always part of the foreground.

Rendering Rich AI Output Without Breaking the Page

This viewer has to survive mixed media. Markdown, code fences, LaTeX, and long responses all appear in one stream, so the renderer leans on react-markdown, KaTeX, syntax highlighting, sanitization, and virtualization. That combination matters because the log is not just text. It is text plus math plus code plus metadata.

// The app uses a virtualized list so long transcripts stay fast.
// Row heights are measured dynamically because markdown, math, and code
// blocks all expand differently after render.

The technical trick is not any single library. It is the combination of measurement, sanitization, and lazy rendering that keeps the page responsive when the conversation gets dense.

Grounding Tables Make Citations Feel Native

Gemini’s grounding data is the feature that pushes this project beyond a simple chat log viewer. Instead of burying sources inside a blob of metadata, the app exposes them as a structured table with sources, corroboration segments, and web search queries. That makes the answer feel documentable.

CategoryGeneric chat UIAI Echo React Chat
InputLive messagesLocal Gemini JSON export
Main jobSend and receiveInspect and analyze
ReasoningUsually hidden or absentCollapsible and preserved
CitationsOften informalNative grounding table
PrivacyOften cloud-backedBrowser-local file loading
Best forConversationForensics

This is why the project reads like a debugger. It does not merely show what the model said. It shows what supported the answer, which is a different and more demanding product choice.

Why This Tool Is Local-First by Design

The privacy story is simple and strong. The file is loaded through the browser with FileReader, so the transcript stays on the machine. For sensitive prompts, internal experiments, or personal logs, that makes the viewer practical in a way cloud-first tools are not.

It also narrows the problem beautifully. Once the app only has to understand Gemini exports, it can spend its complexity budget on readability, navigation, and evidence handling instead of on broad model support.

Where It Fits in the Viewer Landscape

Compared with generic chat frameworks, this repo is much less flexible and much more legible. Compared with bare JSON viewers, it is dramatically easier to scan. Compared with other offline Gemini viewers, it stands out by treating the transcript as a structured record with hidden layers, not just a file to pretty-print.

Project typeStrengthWeaknessBest fit
Generic real-time chat UIBroad support for live conversationWeak on post-hoc inspectionNew chat products
Simple JSON viewerFast to build and easy to sharePoor semantic structureQuick debugging
AI Echo React ChatDeep inspection of Gemini exportsTied to Gemini schemaPrompt analysis and forensic review

That specialization is the design thesis. The repo is not trying to become a universal LLM viewer. It is trying to become the cleanest place to study one specific kind of AI artifact.