feat: Tool-Call-Anzeige in Settings konfigurierbar (alle/modifikationen/verstecken)

- Neue Chat-Section in Settings mit Dropdown für Tool-Call-Sichtbarkeit
- Default: Nur Modifikationen (write_file, edit_file, delete_file, memory_write)
- isToolVisible() filtert beim Streaming, History und Archiv-Rendering
- Reset-Button setzt auch Tool-Call-Einstellung zurück
This commit is contained in:
Meleki committed 2026-03-01 16:04:00 +01:00
1 parent 0b842357a3
commit 7490d483c2
6 files changed
+52 -5

No files matched your search

+1 -1
View File
@@ -20,4 +20,4 @@
- [x] Chat: Es scrollt beim Laden nicht ganz nach unten, ich denke weil im DOM noch etwas nachgeladen wird (ich denke es ist die Schriftart), und die Höhe sich beim Laden nochmal verändert
- [x] Chat: User-Nachrichten mit dem Tag [Datei: pfat/zur/datei.xyz:1-10] wird nicht als HTML geparsed
- [x] Chat: Wird zwar erkannt und ist klickbar, aber es öffnet sich einfach nur der File Explorer, ohne dass sich die Datei öffnet und die Darstellung in Monospace ist auch nicht schön
- [ ] Chat: Es werden momentan alle Tool-Calls angezeigt - die Anzeige soll individuell in den Einstellungen gemacht werden können. Auswahl aus drei Stufen: "Alle anzeigen" / "Nur Modifikationen" (file änderungen, memory änderungen, etc.) / "Verstecken"
- [x] Chat: Es werden momentan alle Tool-Calls angezeigt - die Anzeige soll individuell in den Einstellungen gemacht werden können. Auswahl aus drei Stufen: "Alle anzeigen" / "Nur Modifikationen" (file änderungen, memory änderungen, etc.) / "Verstecken"
+16
View File
@@ -208,6 +208,22 @@
</div>
</div>
</section>
<section class="settings-section">
<h2>Chat</h2>
<div class="setting-row">
<div class="setting-info">
<label>Tool-Calls</label>
<span class="setting-hint">Welche Tool-Aufrufe im Chat angezeigt werden</span>
</div>
<div class="setting-control">
<select id="settingToolCallDisplay">
<option value="all">Alle anzeigen</option>
<option value="modifications">Nur Modifikationen</option>
<option value="hidden">Verstecken</option>
</select>
</div>
</div>
</section>
<section class="settings-section">
<h2>Daten</h2>
<div class="setting-row">
+8 -2
View File
@@ -156,11 +156,17 @@ async function sendMessage() {
case 'tool_start':
endStreamBubble();
currentToolBox = addToolBoxLoading(data.name);
if (isToolVisible(data.name)) {
currentToolBox = addToolBoxLoading(data.name);
} else {
currentToolBox = null;
}
break;
case 'tool_end':
finishToolBox(currentToolBox, data);
if (currentToolBox) {
finishToolBox(currentToolBox, data);
}
currentToolBox = null;
break;
+4 -1
View File
@@ -53,7 +53,9 @@ function renderMessages(msgs, addToConversation) {
break;
case 'tool_use':
addToolBoxStatic(msg.toolName, msg.content, null, false);
if (isToolVisible(msg.toolName)) {
addToolBoxStatic(msg.toolName, msg.content, null, false);
}
break;
case 'tool_result':
@@ -141,6 +143,7 @@ async function loadLatestArchive() {
}
break;
case 'tool_use':
if (!isToolVisible(msg.toolName)) continue;
div.className = 'tool-box archived';
renderToolBoxContent(div, msg.toolName, msg.content, null, false);
break;
+11 -1
View File
@@ -3,7 +3,8 @@
const SETTINGS_KEY = 'settings';
const SETTINGS_DEFAULTS = {
pageWidth: 900
pageWidth: 900,
toolCallDisplay: 'modifications' // 'all' | 'modifications' | 'hidden'
};
function loadSettings() {
@@ -34,11 +35,13 @@ registerPage('settings', {
init() {
const slider = document.getElementById('settingPageWidth');
const display = document.getElementById('settingPageWidthValue');
const toolCallSelect = document.getElementById('settingToolCallDisplay');
const resetBtn = document.getElementById('settingsResetBtn');
const s = loadSettings();
slider.value = s.pageWidth;
display.textContent = s.pageWidth + 'px';
toolCallSelect.value = s.toolCallDisplay;
slider.addEventListener('input', () => {
display.textContent = slider.value + 'px';
@@ -51,6 +54,12 @@ registerPage('settings', {
applySettings();
});
toolCallSelect.addEventListener('change', () => {
const s = loadSettings();
s.toolCallDisplay = toolCallSelect.value;
saveSettings(s);
});
const backupBtn = document.getElementById('settingsBackupBtn');
if (backupBtn) backupBtn.addEventListener('click', async () => {
backupBtn.disabled = true;
@@ -72,6 +81,7 @@ registerPage('settings', {
// Update UI
slider.value = SETTINGS_DEFAULTS.pageWidth;
display.textContent = SETTINGS_DEFAULTS.pageWidth + 'px';
toolCallSelect.value = SETTINGS_DEFAULTS.toolCallDisplay;
});
},
destroy() {}
+12
View File
@@ -245,6 +245,18 @@ function endStreamBubble() {
_streamText = '';
}
// ── Tool Call Visibility ──
const MODIFICATION_TOOLS = ['write_file', 'edit_file', 'delete_file', 'memory_write'];
function isToolVisible(toolName) {
const mode = loadSettings().toolCallDisplay;
if (mode === 'all') return true;
if (mode === 'hidden') return false;
// 'modifications' – nur modifizierende Tools anzeigen
return MODIFICATION_TOOLS.includes(toolName);
}
// ── Tool Boxes ──
function addToolBoxLoading(name) {