Skip to content

feat(persistence): sessionStorage with configurable key prefix#32

Merged
PAMulligan merged 1 commit into
mainfrom
11-session-storage-persistence-for-conversation-history
May 8, 2026
Merged

feat(persistence): sessionStorage with configurable key prefix#32
PAMulligan merged 1 commit into
mainfrom
11-session-storage-persistence-for-conversation-history

Conversation

@PAMulligan
Copy link
Copy Markdown
Contributor

Summary

  • Switch chat history persistence from localStorage to sessionStorage so conversations survive page navigation within the tab but clear on tab close
  • Add storageKeyPrefix option (default claudius:messages) so multiple widgets on the same page can keep separate histories
  • Expose the new option through ChatWidget props, window.ClaudiusConfig, and the <claudius-chat storage-key-prefix> web-component attribute
  • Storage access wrapped to degrade gracefully when sessionStorage is unavailable (private mode, SSR)

Test plan

  • pnpm test in widget/ (157/157 passing, including new storage key prefix describe block covering custom-prefix writes and isolation between two widgets on the same apiUrl)
  • pnpm exec tsc --noEmit clean
  • Manual: verify chat history survives an in-tab navigation
  • Manual: close the tab, reopen, confirm history is gone
  • Manual: embed two <claudius-chat> instances with different storage-key-prefix values and confirm their histories are independent

🤖 Generated with Claude Code

Switch chat history persistence from localStorage to sessionStorage so
conversations survive page navigation within the tab but clear on tab
close. Add storageKeyPrefix option (default claudius:messages) so multiple
widgets on the same page can keep separate histories.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@PAMulligan PAMulligan linked an issue May 8, 2026 that may be closed by this pull request
@PAMulligan PAMulligan merged commit 0155f94 into main May 8, 2026
2 checks passed
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.

Session storage persistence for conversation history

1 participant