fix(chat): place per-message reasoning left of the tools count

This commit is contained in:
2026-10-24 11:47:07 +01:00
parent 8547a1527f
commit b355679507
5 changed files with 189 additions and 37 deletions
+11
View File
@@ -96,6 +96,17 @@ try {
part: { id: 'reasoning-0', type: 'reasoning' }, delta: 'Checking the recorded evidence.' });
await event({ kind: 'text', message_id: 'live-answer',
part: { id: 'text-0', type: 'text' }, delta: 'The answer is arriving.' });
await event({ kind: 'tool', message_id: 'live-answer',
part: { id: 'tool-0', type: 'tool', name: 'read', state: { status: 'completed' } } });
const footerNodes = await axNodes(connection);
const reasoningControl = footerNodes.find(node => node.name?.value === 'Reasoning' && node.role?.value === 'button');
const toolsControl = footerNodes.find(node => node.name?.value === '1 tool call, expand for details');
assert.ok(reasoningControl?.backendDOMNodeId && toolsControl?.backendDOMNodeId, 'message footer controls');
const reasoningBox = (await connection.send('DOM.getBoxModel', { backendNodeId: reasoningControl.backendDOMNodeId })).model.content;
const toolsBox = (await connection.send('DOM.getBoxModel', { backendNodeId: toolsControl.backendDOMNodeId })).model.content;
assert.ok(reasoningBox[2] < toolsBox[0], 'reasoning is left of tools');
assert.ok(Math.abs((reasoningBox[1] + reasoningBox[5]) / 2 - (toolsBox[1] + toolsBox[5]) / 2) < 3, 'same footer row');
log.checks.push('per-message reasoning is immediately left of tools count');
await assertPainted('Checking the recorded evidence.', 'reasoning visible while text streams', 'chat-live-reasoning');
await assertPainted('The answer is arriving.', 'streamed answer visible', 'chat-live-answer');
const field = (await axNodes(connection)).find(node => node.role?.value === 'textbox');