This commit is contained in:
Timothy Jaeryang Baek
2026-04-01 04:00:18 -05:00
parent acaf9ab50c
commit 0638b9f56c
8 changed files with 109 additions and 4 deletions
+15
View File
@@ -200,6 +200,11 @@
window.setTimeout(() => scrollToBottom(), 0);
await tick();
// Mark chat read when initially loading it
if (chatIdProp && !$temporaryChatEnabled) {
updateLastReadAt(chatIdProp);
}
// Process any queued requests if the chat is idle
const lastMessage = history.currentId ? history.messages[history.currentId] : null;
@@ -403,6 +408,13 @@
saveChatHandler(_chatId, history);
};
const updateLastReadAt = (id) => {
$socket?.emit('events:chat', {
chat_id: id,
data: { type: 'last_read_at' }
});
};
const terminalEventHandler = (type: string, data: any) => {
if (type === 'terminal:display_file') {
if (!data?.path) return;
@@ -768,6 +780,9 @@
return () => {
try {
if (chatIdProp && !$temporaryChatEnabled) {
updateLastReadAt(chatIdProp);
}
pageSubscribe();
showControlsSubscribe();
selectedFolderSubscribe();