fix(web): preserve agent composer shrink sizing

This commit is contained in:
2026-11-08 18:42:27 -08:00
parent bb43b8beda
commit bc92651509
2 changed files with 29 additions and 6 deletions
@@ -107,11 +107,19 @@ try {
if (process.env.RECORD_ONLY !== '1') for (const result of all) {
for (const sample of result.bottom) assert.ok(Math.abs(sample.gap) <= 1,
`bottom pin drift at ${result.config.width}px/${result.config.dpr}x: ${JSON.stringify(sample)}`);
const byLabel = Object.fromEntries(result.bottom.map(sample => [sample.label, sample]));
assert.equal(byLabel['wrapped-and-capped'].textareaHeight, 156, `textarea cap changed: ${JSON.stringify(result.bottom)}`);
assert.ok(byLabel.shrink.textareaHeight <= 48 && byLabel.cleared.textareaHeight <= 48,
`textarea did not shrink with the draft: ${JSON.stringify(result.bottom)}`);
assert.equal(byLabel.cleared.clientHeight, byLabel.empty.clientHeight,
`composer did not return to its empty height: ${JSON.stringify(result.bottom)}`);
const before = result.nonbottom.find(sample => sample.before)?.before;
for (const sample of result.nonbottom.filter(sample => sample.label?.startsWith('nonbottom-'))) {
assert.equal(sample.anchorId, before.anchorId, `nonbottom anchor changed: ${JSON.stringify({ before, sample })}`);
assert.ok(Math.abs(sample.anchorTop - before.anchorTop) <= 1, `nonbottom transcript jumped: ${JSON.stringify({ before, sample })}`);
}
const nonbottomShrink = result.nonbottom.find(sample => sample.label === 'nonbottom-shrink');
assert.ok(nonbottomShrink.textareaHeight <= 48, `nonbottom textarea did not shrink: ${JSON.stringify(nonbottomShrink)}`);
}
process.stdout.write(JSON.stringify({ browser, all }, null, 2) + '\n');
} finally {