refactor(frontend): dedupliziere JS-Code und fixe Bugs

- fix: _oldestLoadedMessageId → _oldestLoadedSortKey (chat.js, chat-page.js)
- move: formatTimestamp nach ui-helpers.js (war _formatTimestamp in msg-actions.js)
- move: _isReviewMessage nach ui-helpers.js (war in history.js)
- add: _getSubAgentMeta + _createSubAgentHeader in ui-helpers.js
- refactor: stream-ui.js + history.js nutzen _createSubAgentHeader
- refactor: flushText() Hilfsfunktion in _renderReviewGroup (history.js)
- refactor: shared-page.js nutzt _mergeConsecutiveAssistantTexts statt eigener Kopie
- refactor: _initCardMenu + _onCardMenuAction Helper in dashboard.js

-53 Zeilen netto
This commit is contained in:
Meleki committed 2026-03-09 07:17:54 +01:00
1 parent 57560cbbea
commit 33934b2c4a
9 files changed
+114 -167

No files matched your search

+2 -2
View File
@@ -162,7 +162,7 @@ async function clearChat() {
chatEl().innerHTML = '';
lastKnownMessageId = 0;
loadedArchiveCount = 0;
_oldestLoadedMessageId = 0;
_oldestLoadedSortKey = 0;
_hasMoreOlderMessages = false;
clearReply();
@@ -272,7 +272,7 @@ async function sendMessage() {
let msgText = text;
if (pendingReply) {
const roleLabel = pendingReply.role === 'user' ? 'User' : 'Assistant';
const timeLabel = _formatTimestamp(pendingReply.timestamp) || 'Jetzt';
const timeLabel = formatTimestamp(pendingReply.timestamp) || 'Jetzt';
const quoteText = pendingReply.text.split('\n').map(l => '> ' + l).join('\n');
const quoteHeader = `> [Zitat: ${timeLabel}, ${roleLabel}]:`;
msgText = quoteHeader + '\n' + quoteText + '\n\n' + (text || '');