Skip to content

[P1] Add Chatbot Conversation History / Save Past Threads #182

Description

@flexykrn

Bug Description

When users refresh the page or navigate to a different documentation section, their chatbot conversation is lost. There is no way to reference previous answers, continue a conversation, or review past interactions. This forces users to re-ask questions and re-explain context, creating significant friction.

Competitor Benchmark

  • ChatGPT: Full conversation history sidebar, searchable
  • Claude: Project-based threads with persistence
  • Perplexity: Thread library with shareable links
  • Intercom: Conversation history tied to user profile
  • Crisp: Chat history across sessions

Affected Users

  • Users researching across multiple pages
  • Developers working through multi-step tutorials
  • Users who need to reference previous answers
  • Anyone who accidentally refreshes the page

Blast Radius

  • Primary: All chatbot users in multi-session workflows
  • Secondary: Complex queries requiring follow-up questions
  • Impact: Reduced repetition, better UX, higher retention

Root Cause Analysis

Chatbot state is stored in memory (JavaScript variable) only. No localStorage, no backend persistence, no session restoration. Page refresh = total loss.

Proposed Solution

Option A: localStorage Persistence (Recommended for immediate fix)

Store conversations in browser localStorage:

// Save on each message
localStorage.setItem('xdc_chat_history', JSON.stringify(messages));

// Restore on page load
const history = JSON.parse(localStorage.getItem('xdc_chat_history'));

Option B: Session-Based Threads

Group conversations by session with timestamps:

  • 'Today, 2:30 PM' - 5 messages
  • 'Yesterday, 10:15 AM' - 12 messages
  • Show list of recent threads

Additional Fixes Required

  • localStorage serialization/deserialization
  • Thread list UI (collapsible sidebar or dropdown)
  • 'New conversation' button
  • Clear history option
  • Storage limit (e.g., last 10 conversations, max 100KB)
  • Privacy notice about local storage

Acceptance Criteria

  • Conversations persist after page refresh
  • User can view list of past conversations
  • User can click a past conversation to resume
  • 'New conversation' starts fresh thread
  • 'Clear history' removes all stored data
  • Works across different doc pages (same domain)
  • Mobile: thread list in modal or bottom sheet
  • Graceful fallback if localStorage disabled

Raw Context

A developer asking 'How do I deploy a subnet?' gets a 10-step answer. They navigate to a code example page, come back, and the answer is gone. They must re-ask and wait for the same response. This is frustrating and wastes time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions