KI-Chat: Verlaufs-Titel live aktualisiert + sauberes Floating-Icon

- Der automatisch generierte Verlaufs-Titel (aus der ersten Nachricht) erscheint
  jetzt sofort in der Sidebar, nicht erst nach Reload. Der titel wird im
  done-Event mitgeschickt und clientseitig gesetzt.
- Floating-Button-Icon durch eine saubere Chat-Bubble ersetzt.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-07 14:57:35 +00:00
co-authored by Claude
parent 26a61aa302
commit 40b4de12e1
3 changed files with 9 additions and 2 deletions
+6
View File
@@ -258,6 +258,12 @@
if (typing) typing.remove();
addMessage('assistant', ev.content || '(keine Antwort)');
}
// Live-update the auto-generated thread title in the sidebar.
if (ev.titel && activeId) {
const li = threadList && threadList.querySelector('li[data-thread-li="' + activeId + '"]');
const titleEl = li && li.querySelector('.threadLink .font-medium');
if (titleEl && ev.titel && ev.titel !== titleEl.textContent) titleEl.textContent = ev.titel;
}
scrollBottom();
} else if (ev.type === 'error') {
if (typing) typing.remove();
+2 -1
View File
@@ -2546,7 +2546,8 @@ initializeDatabase().then(() => {
[threadId, 'assistant', saved]
);
await dbRun('UPDATE chat_threads SET updated_at = CURRENT_TIMESTAMP WHERE id = ?', [threadId]);
send({ type: 'done', messageId: lastID, content: saved });
const threadRow = await dbGet('SELECT titel FROM chat_threads WHERE id = ?', [threadId]);
send({ type: 'done', messageId: lastID, content: saved, titel: threadRow && threadRow.titel });
} catch (error) {
send({ type: 'error', message: 'Antwort konnte nicht gespeichert werden.' });
}
+1 -1
View File
@@ -12,7 +12,7 @@
class="fixed bottom-5 right-5 z-40 flex items-center gap-2 rounded-full bg-blue-600 hover:bg-blue-700 text-white shadow-lg px-4 py-3 text-sm font-medium transition-colors"
title="KI-Bewerbungs-Assistent öffnen">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 10h8M8 14h5m4 7a8 8 0 100-16 8 8 0 000 16z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.86 9.86 0 01-4-.8L3 20l1.3-3.9A7.97 7.97 0 013 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path>
</svg>
<span class="hidden sm:inline">KI-Chat</span>
</a>