Make chat reasoning a footer chip that opens a live sheet like tools
This commit is contained in:
@@ -376,6 +376,50 @@ try {
|
||||
await assertOcr(openTool, text);
|
||||
}
|
||||
|
||||
// Dismiss the tool sheet, then bring the live turn into view.
|
||||
for (const type of ['mousePressed', 'mouseReleased']) {
|
||||
await send('Input.dispatchMouseEvent', { type, x: 10, y: 10, button: 'left', clickCount: 1 }, session);
|
||||
}
|
||||
await delay(800);
|
||||
await send('Input.dispatchMouseEvent', { type: 'mouseWheel', x: 195, y: 420, deltaX: 0, deltaY: 3000 }, session);
|
||||
await delay(800);
|
||||
const liveName = 'Reasoning · 2 steps, expand for details';
|
||||
await requireNode(liveName);
|
||||
const liveChip = await capture(`${style}-live-chip`);
|
||||
await assertOcr(liveChip, 'Live answer so far');
|
||||
await assertOcr(liveChip, 'Reasoning');
|
||||
// The open sheet follows the live turn: its newest step keeps growing.
|
||||
// A real pointer tap on the chip's own node (the smallest one carrying its
|
||||
// name; its row group repeats the text).
|
||||
const chipNode = (await nodes())
|
||||
.filter((node) => node.label === liveName || node.text === liveName)
|
||||
.sort((a, b) => a.w * a.h - b.w * b.h)[0];
|
||||
for (const type of ['mousePressed', 'mouseReleased']) {
|
||||
await send('Input.dispatchMouseEvent', {
|
||||
type,
|
||||
x: chipNode.x + chipNode.w / 2,
|
||||
y: chipNode.y + chipNode.h / 2,
|
||||
button: 'left',
|
||||
clickCount: 1,
|
||||
}, session);
|
||||
}
|
||||
await delay(800);
|
||||
const tickOf = async (path) => {
|
||||
const match = (await ocr(path)).match(/Live tick (\d+)/);
|
||||
if (!match) throw new Error(`OCR of ${path} shows no live tick`);
|
||||
return Number(match[1]);
|
||||
};
|
||||
const liveA = await capture(`${style}-live-sheet-a`);
|
||||
await assertOcr(liveA, 'Live step one settled');
|
||||
const first = await tickOf(liveA);
|
||||
await delay(2000);
|
||||
const liveB = await capture(`${style}-live-sheet-b`);
|
||||
const second = await tickOf(liveB);
|
||||
evidence.checks.push({ check: 'open reasoning sheet follows live deltas', first, second });
|
||||
if (second <= first) {
|
||||
throw new Error(`Open sheet did not follow live deltas: ${first} then ${second}`);
|
||||
}
|
||||
|
||||
const report = JSON.stringify(evidence, null, 2);
|
||||
await writeFile(join(out, `${style}-evidence.json`), report);
|
||||
console.log(report);
|
||||
|
||||
Reference in New Issue
Block a user