Skip to content

Commit 83d1b86

Browse files
Lexus2016claude
andcommitted
fix: remove tool_result rendering, clean up JSONL parser, fix thinking badge padding
- Remove collapsible tool result blocks (cluttered chat history with system responses) - Remove tool_result parsing from parseJsonlToMessages (tool results are noise, not user content) - Remove toolUseIdToName tracking (no longer needed) - Fix thinking-msg left padding: 44px → 34px - loadSess: remove tool_result from badge-count skip list Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8b32f8d commit 83d1b86

5 files changed

Lines changed: 12 additions & 56 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Not a chatbot. "Refactor this function and add tests" → Claude opens files, ed
8787

8888
**Claude CLI session import** — import existing sessions from Claude Code CLI (`~/.claude/projects/`) directly into Studio. Click the ↓ button in the header, pick a project path, select sessions, import. Already-imported sessions are marked so you don't duplicate them. Works on Windows (`C:\...`), macOS, and Linux; supports `~` path expansion.
8989

90-
**Extended thinking** — when Claude uses extended thinking, each thinking block appears as a "Chain of thought" badge showing estimated word count. Click to open the full reasoning in a modal with a copy button. Tool results are shown as collapsible blocks with tool name, preview, and line count — no more noise, full detail on demand.
90+
**Extended thinking** — when Claude uses extended thinking, each thinking block appears as a "Chain of thought" badge showing estimated word count. Click to open the full reasoning in a modal with a copy button.
9191

9292
### 📋 Kanban Board
9393

@@ -249,7 +249,7 @@ npx github:Lexus2016/claude-code-studio # launch as usual
249249

250250
| Category | Features |
251251
|----------|----------|
252-
| **Chat** | Real-time streaming, screenshot paste, file attach (`@file`), conversation fork, auto-continue (3x), session compact, sidebar quick-filter, CLI session import, extended thinking display, collapsible tool results |
252+
| **Chat** | Real-time streaming, screenshot paste, file attach (`@file`), conversation fork, auto-continue (3x), session compact, sidebar quick-filter, CLI session import, extended thinking display |
253253
| **Kanban** | Task queue, parallel + sequential, cross-tab sync, drag-and-drop tabs, dependency graphs |
254254
| **Scheduler** | One-time + recurring (hourly/daily/weekly/monthly), 5 parallel workers, Run Now, SQLite-persisted |
255255
| **Task Manager** | Autonomous child tasks, chains, context passing, result reporting, cancellation (MCP) |

README_RU.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ MIRROR=my-registry.company.com docker compose up -d --build
8787

8888
**Импорт сессий Claude CLI** — импортируйте существующие сессии Claude Code CLI из `~/.claude/projects/` прямо в Studio. Нажмите кнопку ↓ в шапке, укажите путь к проекту, выберите сессии, импортируйте. Уже импортированные сессии отмечаются, чтобы не было дублей. Работает на Windows (`C:\...`), macOS и Linux; поддерживается раскрытие `~`.
8989

90-
**Расширенное мышление** — когда Claude использует extended thinking, каждый блок размышлений отображается как бейдж «Chain of thought» с оценкой количества слов. Нажмите, чтобы открыть полную цепочку рассуждений в модальном окне с кнопкой копирования. Результаты инструментов отображаются как сворачиваемые блоки с названием инструмента, превью и количеством строк — минимум шума, полная детализация по запросу.
90+
**Расширенное мышление** — когда Claude использует extended thinking, каждый блок размышлений отображается как бейдж «Chain of thought» с оценкой количества слов. Нажмите, чтобы открыть полную цепочку рассуждений в модальном окне с кнопкой копирования.
9191

9292
### 📋 Kanban-доска
9393

@@ -249,7 +249,7 @@ npx github:Lexus2016/claude-code-studio # запуск как обычно
249249

250250
| Категория | Возможности |
251251
|----------|----------|
252-
| **Чат** | Потоковая передача в реальном времени, вставка скриншотов, прикрепление файлов (`@file`), ветвление разговора, автопродолжение (3x), сжатие сессий, быстрый фильтр боковой панели, импорт сессий CLI, отображение extended thinking, сворачиваемые результаты инструментов |
252+
| **Чат** | Потоковая передача в реальном времени, вставка скриншотов, прикрепление файлов (`@file`), ветвление разговора, автопродолжение (3x), сжатие сессий, быстрый фильтр боковой панели, импорт сессий CLI, отображение extended thinking |
253253
| **Kanban** | Очередь задач, параллельное + последовательное выполнение, синхронизация между вкладками, drag-and-drop вкладок, графы зависимостей |
254254
| **Планировщик** | Разовые + повторяющиеся (ежечасно/ежедневно/еженедельно/ежемесячно), 5 параллельных воркеров, Run Now, хранение в SQLite |
255255
| **Менеджер задач** | Автономные дочерние задачи, цепочки, передача контекста, отчётность о результатах, отмена (MCP) |

README_UA.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ MIRROR=my-registry.company.com docker compose up -d --build
8787

8888
**Імпорт сесій Claude CLI** — імпортуйте наявні сесії Claude Code CLI з `~/.claude/projects/` прямо в Studio. Натисніть кнопку ↓ у шапці, вкажіть шлях до проекту, виберіть сесії, імпортуйте. Вже імпортовані сесії позначаються, щоб уникнути дублів. Працює на Windows (`C:\...`), macOS та Linux; підтримується розкриття `~`.
8989

90-
**Extended thinking** — коли Claude використовує розширене мислення, кожен блок думок відображається як бейдж «Chain of thought» з оцінкою кількості слів. Натисніть, щоб відкрити повний ланцюжок міркувань у модальному вікні з кнопкою копіювання. Результати інструментів відображаються як згортувані блоки з назвою інструменту, прев'ю та кількістю рядків — мінімум шуму, повна деталізація на запит.
90+
**Extended thinking** — коли Claude використовує розширене мислення, кожен блок думок відображається як бейдж «Chain of thought» з оцінкою кількості слів. Натисніть, щоб відкрити повний ланцюжок міркувань у модальному вікні з кнопкою копіювання.
9191

9292
### 📋 Kanban-дошка
9393

@@ -249,7 +249,7 @@ npx github:Lexus2016/claude-code-studio # запуск як зазвичай
249249

250250
| Категорія | Можливості |
251251
|----------|----------|
252-
| **Чат** | Потокова передача в реальному часі, вставка скріншотів, прикріплення файлів (`@file`), форк розмови, авто-продовження (3x), стиснення сесій, швидкий фільтр бічної панелі, імпорт сесій CLI, відображення extended thinking, згортувані результати інструментів |
252+
| **Чат** | Потокова передача в реальному часі, вставка скріншотів, прикріплення файлів (`@file`), форк розмови, авто-продовження (3x), стиснення сесій, швидкий фільтр бічної панелі, імпорт сесій CLI, відображення extended thinking |
253253
| **Kanban** | Черга завдань, паралельно + послідовно, синхронізація між вкладками, drag-and-drop вкладки, графи залежностей |
254254
| **Scheduler** | Одноразово + повторювані (щогодини/щодня/щотижня/щомісяця), 5 паралельних воркерів, Run Now, збереження в SQLite |
255255
| **Task Manager** | Автономні дочірні завдання, ланцюжки, передача контексту, звітування про результати, скасування (MCP) |

public/index.html

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -41,26 +41,9 @@
4141
}
4242
.thinking-badge:hover { border-color: var(--accent); color: var(--accent2); background: var(--abg); }
4343
.thinking-badge svg { width: 11px; height: 11px; flex-shrink: 0; }
44-
.mw.assistant.thinking-msg { background: transparent; padding: 2px 12px 2px 44px; }
44+
.mw.assistant.thinking-msg { background: transparent; padding: 2px 12px 2px 34px; }
4545
.mw.assistant.thinking-msg .msg { background: transparent; box-shadow: none; padding: 0; }
4646

47-
/* ─── Tool result block ─── */
48-
.tool-result-block {
49-
border: 1px solid var(--border); border-radius: var(--r-sm);
50-
background: var(--tool-bg); font-size: 11px; overflow: hidden; margin: 2px 0;
51-
}
52-
.tr-header {
53-
display: flex; align-items: center; gap: 6px; padding: 5px 10px;
54-
cursor: pointer; user-select: none; color: var(--muted);
55-
transition: background .1s; font-family: var(--font-mono);
56-
}
57-
.tr-header:hover { background: var(--s2); }
58-
.tr-header .tr-arrow { font-size: 10px; transition: transform .2s; flex-shrink: 0; }
59-
.tr-header.open .tr-arrow { transform: rotate(90deg); }
60-
.tr-content { margin: 0; padding: 8px 10px; border-top: 1px solid var(--border); overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow-y: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text); display: none; }
61-
.tr-content.open { display: block; }
62-
.mw.user.tool-result-msg { background: transparent; padding: 2px 12px; }
63-
.mw.user.tool-result-msg .msg { background: transparent; box-shadow: none; padding: 0; border: none; }
6447

6548
/* ─── Thinking modal ─── */
6649
.thinking-modal-body {
@@ -7553,28 +7536,6 @@ <h3 id="rlModalTitle">Ліміт вичерпано</h3>
75537536
return w;
75547537
}
75557538

7556-
// ── Tool result: render as collapsible block ──
7557-
if (m.type === 'tool_result') {
7558-
const w = document.createElement('div');
7559-
w.className = 'mw user tool-result-msg';
7560-
if (m.id) w.dataset.msgId = String(m.id);
7561-
const raw = m.content || '';
7562-
const lines = raw.split('\n');
7563-
const lineCount = lines.length;
7564-
const preview = lines.slice(0, 2).join('\n');
7565-
const block = document.createElement('div');
7566-
block.className = 'tool-result-block';
7567-
const toolLabel = m.tool_name ? escH(m.tool_name) + ' result' : 'tool result';
7568-
block.innerHTML = `<div class="tr-header" onclick="this.classList.toggle('open');this.nextElementSibling.classList.toggle('open')"><span class="tr-arrow">▶</span><span style="font-size:11px;color:var(--muted)">${toolLabel}</span><span style="margin-left:4px;color:var(--text);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${escH(preview.substring(0,80))}${lineCount > 2 ? '…' : ''}</span><span style="font-size:10px;color:var(--muted);flex-shrink:0;margin-left:6px">${lineCount} line${lineCount !== 1 ? 's' : ''}</span></div><pre class="tr-content">${escH(raw)}</pre>`;
7569-
const div = document.createElement('div');
7570-
div.className = 'msg';
7571-
div.appendChild(block);
7572-
w.appendChild(div);
7573-
if (prepend) { const f = msgsEl.querySelector('.mw, .agent-team-card'); if (f) msgsEl.insertBefore(w, f); else msgsEl.prepend(w); }
7574-
else msgsEl.appendChild(w);
7575-
return w;
7576-
}
7577-
75787539
const w = document.createElement('div');
75797540
w.className = `mw ${m.role}`;
75807541
if (m.id) w.dataset.msgId = String(m.id);
@@ -7810,7 +7771,7 @@ <h3 id="rlModalTitle">Ліміт вичерпано</h3>
78107771
// Single mode: scan backward for consecutive tool rows before this text message
78117772
const tc = {};
78127773
for (let j = i - 1; j >= 0; j--) {
7813-
if (raw[j].type === 'thinking' || raw[j].type === 'tool_result') continue;
7774+
if (raw[j].type === 'thinking') continue;
78147775
if (raw[j].type !== 'tool' || raw[j].agent_id) break;
78157776
const tn = raw[j].tool_name || 'tool';
78167777
tc[tn] = (tc[tn] || 0) + 1;

server.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3964,8 +3964,6 @@ function parseJsonlToMessages(jsonlPath) {
39643964
const lines = fs.readFileSync(jsonlPath, 'utf8').trim().split('\n').filter(Boolean);
39653965
const msgs = [];
39663966
let idCounter = 1;
3967-
// Maps tool_use_id → tool name so tool_result messages show the real tool name
3968-
const toolUseIdToName = {};
39693967
for (const line of lines) {
39703968
let d; try { d = JSON.parse(line); } catch { continue; }
39713969
const ts = d.timestamp || null;
@@ -3976,23 +3974,20 @@ function parseJsonlToMessages(jsonlPath) {
39763974
msgs.push({ id: idCounter++, role: 'user', type: 'text', content: mc, tool_name: null, agent_id: null, created_at: ts });
39773975
continue;
39783976
}
3977+
// Only show text blocks; tool_result entries are system responses to tool calls
3978+
// (not user-written messages) — showing them clutters history with "Read result" etc.
39793979
const textBlocks = mc.filter(b => b.type === 'text' && b.text?.trim());
39803980
if (textBlocks.length > 0)
39813981
msgs.push({ id: idCounter++, role: 'user', type: 'text', content: textBlocks.map(b => b.text).join('\n'), tool_name: null, agent_id: null, created_at: ts });
3982-
for (const b of mc.filter(b => b.type === 'tool_result')) {
3983-
const raw = typeof b.content === 'string' ? b.content : (Array.isArray(b.content) ? b.content.map(c => c.text || '').join('\n') : '');
3984-
msgs.push({ id: idCounter++, role: 'user', type: 'tool_result', content: raw.substring(0, 20000), tool_name: toolUseIdToName[b.tool_use_id] || null, agent_id: null, created_at: ts });
3985-
}
39863982
} else if (d.type === 'assistant') {
39873983
const mc = d.message?.content;
39883984
if (!Array.isArray(mc)) continue;
39893985
for (const b of mc) {
39903986
if (b.type === 'thinking' && b.thinking)
39913987
msgs.push({ id: idCounter++, role: 'assistant', type: 'thinking', content: b.thinking, tool_name: null, agent_id: null, created_at: ts });
3992-
else if (b.type === 'tool_use' && b.name) {
3993-
if (b.id) toolUseIdToName[b.id] = b.name; // register for tool_result lookup
3988+
else if (b.type === 'tool_use' && b.name)
39943989
msgs.push({ id: idCounter++, role: 'assistant', type: 'tool', content: (typeof b.input === 'string' ? b.input : JSON.stringify(b.input || {})).substring(0, 2000), tool_name: b.name, agent_id: null, created_at: ts });
3995-
} else if (b.type === 'text' && b.text)
3990+
else if (b.type === 'text' && b.text)
39963991
msgs.push({ id: idCounter++, role: 'assistant', type: 'text', content: b.text, tool_name: null, agent_id: null, created_at: ts });
39973992
}
39983993
}

0 commit comments

Comments
 (0)