okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221merge f-split-ui3 088f8685a (live status line, reasoning panel, goal bar, tool rows, time-skip comparison) into f-split-int334dde73a

main
1.0 KiB23 linesraw
1/** 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). */
2import test from 'node:test';
3import assert from 'node:assert/strict';
4import { readFile } from 'node:fs/promises';
5
6const css = await readFile(new URL('../src/styles/app.css', import.meta.url), 'utf8');
7function lastRule(selector) {
8  const at = css.lastIndexOf(`\n${selector} {`);
9  if (at < 0) return '';
10  return css.slice(at, css.indexOf('}', at));
11}
12
13test('a tool row has no top border and little padding', () => {
14  const rule = lastRule('.tool-summary');
15  assert.match(rule, /border-top:\s*0/);
16  const pad = /padding-block:\s*(\d+)px/.exec(rule);
17  assert.ok(pad && Number(pad[1]) <= 4, `padding-block ${pad?.[1]}`);
18});
19
20test('the chat renders tool rows as a disclosure that the compact rule overrides', async () => {
21  const chat = await readFile(new URL('../src/screens/Chat.tsx', import.meta.url), 'utf8');
22  assert.match(chat, /className="disclosure tool-summary"/);
23});