diff --git a/src/lib/components/ConversationTabs.svelte b/src/lib/components/ConversationTabs.svelte index 75fe9e1..d45a4b8 100644 --- a/src/lib/components/ConversationTabs.svelte +++ b/src/lib/components/ConversationTabs.svelte @@ -216,6 +216,14 @@ // Keyboard shortcuts onMount(() => { + // Initialise all conversations as seen on mount so that remounting + // this component (e.g. after closing the file editor) doesn't falsely + // mark existing messages as unread. + for (const [id, conversation] of $conversations) { + lastSeenMessageCount.set(id, conversation.terminalLines.length); + } + lastSeenMessageCount = lastSeenMessageCount; + function handleGlobalKeydown(event: KeyboardEvent) { // Ctrl/Cmd + T: New tab if ((event.ctrlKey || event.metaKey) && event.key === "t") {