Skip to content

Add chat history retention limit and Clear Chat option for ClimateBot #247

Description

@hainsshaju1919-png

Description

ClimateBot currently stores chat history in localStorage and restores it when the page is refreshed. While this improves continuity, there is currently no option for users to clear saved conversations and no retention limit is applied to stored messages.

As a result, chat history can continue growing indefinitely over time, increasing localStorage usage and potentially affecting performance when restoring conversations.

Steps to Reproduce

  1. Open ClimateBot.
  2. Send several messages.
  3. Refresh the page.
  4. Observe that previous messages are restored.
  5. Continue chatting and refreshing.
  6. Notice that there is no option to clear chat history and stored messages continue accumulating.

Expected Behavior

  • Users should have a Clear Chat option.
  • Stored chat history should have a reasonable retention limit (for example, the most recent 50–100 messages).
  • Local storage usage should remain bounded.

Actual Behavior

  • Chat history persists after page refresh.
  • There is no way to clear stored conversations.
  • Message history can grow indefinitely.

Suggested Enhancement

  • Add a "Clear Chat" button to remove stored conversations.
  • Implement a retention limit before saving messages to localStorage.
  • Optionally provide a confirmation prompt before clearing history.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions