Conversations and history
How Glossen saves conversations, drafts and background answers in the browser.
Saving
A conversation is saved in the reader's browser (localStorage) after the first question is sent. Empty chats are never saved and don't count toward the limit.
- The default limit is 20. Change it with
historyLimit. - When a new conversation goes over the limit, the least recently active conversation is removed. Conversations that are still generating are never removed; the history can go over the limit until they finish.
- Lowering the limit trims older conversations the next time the page loads.
historyLimit={0}turns persistence off. Chats and drafts stay in memory until the reader leaves the page.
Only sending a question and receiving an answer count as activity. Opening a conversation or typing a draft doesn't change its order.
History
The clock button beside New chat opens the history list. Conversations are titled with their first question and ordered by latest activity. Readers can resume a conversation, delete it, or clear all history after confirming.
History shows labels for conversations that are Answering, Answering in another tab, Interrupted or Failed.
After a reload, Glossen restores the last active conversation but keeps the panel closed.
Drafts
Every conversation has its own draft: unsent text, attached passages and whether to include the current page. Drafts survive closing the panel, navigating, switching conversations and reloading. An unsent draft in a new chat is kept too, without counting toward the limit.
Background answers
Answers keep generating when the reader switches to another conversation, starts a new one, closes the panel or navigates to another page. Each answer is tied to its own conversation, so it can't appear in the wrong chat.
While an answer generates, readers can type their next question but can't send it until the answer finishes or they press Stop.
Several tabs
Tabs on the same site share history:
- New conversations, answers and deletions appear in other tabs.
- Only the tab that sent a question streams the answer. Other tabs show the saved progress about once a second.
- While another tab is answering in a conversation, sending and editing in that conversation are disabled.
- Deleting a conversation in one tab stops its answer in the tab that was generating it.
Interrupted answers
Answers are generated by the browser tab that asked. If that tab reloads or closes before the answer finishes, the part saved so far is shown with an Interrupted notice and a Try again button. Reloading a different tab doesn't interrupt an answer that's still generating.
Progress is saved about once per second and when an answer finishes, stops or fails. Text generated after the last save can be lost.
When storage fails
If the browser refuses to save (for example, storage is full or disabled), Glossen keeps working in memory and shows "Chats aren't being saved in this browser." Existing saved history is never cleared to make room.
Saved records are versioned. Records Glossen can't read, such as ones written by a newer version, are left untouched and reported in the history view.