Skip to content

Refine chat widget with session persistence and session reset ability#3

Open
Azie88 wants to merge 4 commits into
WayneSimpson:mainfrom
Azie88:session-persistent-chat
Open

Refine chat widget with session persistence and session reset ability#3
Azie88 wants to merge 4 commits into
WayneSimpson:mainfrom
Azie88:session-persistent-chat

Conversation

@Azie88

@Azie88 Azie88 commented Feb 10, 2026

Copy link
Copy Markdown

Overview

This PR upgrades the existing chatbot template into a session-persistent, premium chat widget, while preserving and enhancing the original experience.

The focus is on reliability, usability, and ensuring conversations persist across reloads and the widget behaves consistently across desktop and mobile.

Core Features & Logic

  • Added session persistence using localStorage, allowing chat state and history to survive page refreshes (with a 5-minute inactivity timeout).
  • Improved message rendering to support paragraphs, bulleted lists, and numbered lists with consistent spacing.
  • Implemented automatic URL linkification within chat messages.
  • Added a "thinking" indicator while awaiting bot responses to improve perceived responsiveness.

Welcome Screen Enhancements

  • Improved the "Send us a message" action to intelligently resume an active session if one exists, or start a new conversation otherwise.

UI & Aesthetic Refinements

  • Added a “New chat” action in the header (with confirmation) to allow manual session resets.
  • Redesigned the chat toggle button for a cleaner, more modern appearance with a hover interaction that reveals “Chat with Sade” via a smooth slide animation.

Files Modified

  • chat-widget.js
  • chat-script.html

Testing

  • Verified session persistence across refreshes and inactivity timeouts.
  • Tested welcome flow for both new and returning sessions.
  • Confirmed layout and interactions across desktop and mobile viewports.
  • Validated public widget API methods via console calls.

Notes

These changes aim to elevate the widget from a basic template to a production-ready, brand-aligned component with improved UX, extensibility, and resilience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant