diff --git a/apps/host/src/styles/app.css b/apps/host/src/styles/app.css index 10ef9623..b7bbbfd4 100644 --- a/apps/host/src/styles/app.css +++ b/apps/host/src/styles/app.css @@ -7133,3 +7133,8 @@ textarea { .tune-step[data-s="run"] .tune-step__badge::before, .tune-step[data-s="run"] .tune-step__badge svg, .tune-step[data-s="done"] .tune-step__badge, .tune-hero__big { animation: none !important; } .tune-live__bar i, .tune-compare__bar i { transition: none; } } + +/* ---- tool rows: compact, no dividers between them ---- */ +.tool-summary { border-top: 0; padding-block: 3px; color: var(--st-ink-muted); } +.tool-summary summary { font-weight: 500; min-height: 22px; cursor: pointer; } +.tool-summary > div { margin-top: 6px; padding-left: 20px; } diff --git a/apps/host/tests/tool-rows.test.mjs b/apps/host/tests/tool-rows.test.mjs new file mode 100644 index 00000000..49ee75a3 --- /dev/null +++ b/apps/host/tests/tool-rows.test.mjs @@ -0,0 +1,23 @@ +/** Item 3: the tool rows in a chat are compact lines with no divider between them (they used to inherit the settings disclosure's top border and 18px padding). */ +import test from 'node:test'; +import assert from 'node:assert/strict'; +import { readFile } from 'node:fs/promises'; + +const css = await readFile(new URL('../src/styles/app.css', import.meta.url), 'utf8'); +function lastRule(selector) { + const at = css.lastIndexOf(`\n${selector} {`); + if (at < 0) return ''; + return css.slice(at, css.indexOf('}', at)); +} + +test('a tool row has no top border and little padding', () => { + const rule = lastRule('.tool-summary'); + assert.match(rule, /border-top:\s*0/); + const pad = /padding-block:\s*(\d+)px/.exec(rule); + assert.ok(pad && Number(pad[1]) <= 4, `padding-block ${pad?.[1]}`); +}); + +test('the chat renders tool rows as a disclosure that the compact rule overrides', async () => { + const chat = await readFile(new URL('../src/screens/Chat.tsx', import.meta.url), 'utf8'); + assert.match(chat, /className="disclosure tool-summary"/); +});