mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-14 04:01:35 +00:00
Derive --dsh-content-font-size-secondary (setting -1 at <=14, setting -2 above; 13px at the default) with --dsh-content-font-delta-secondary in gradient-shadow-text.css, and move every one-step-under-the-body text onto it: think text and reasoning summaries, the shared DisclosureRow title, ToolRow and bash-row summaries and file links, compaction/ context/command/retry/error rows, StatsLine, the workflow-run panel tiers, reference summaries, the turn-status clock, and the feedback note trigger. The markdown table variants join the same tier instead of staying fixed; its 13px floor keeps them legible at the 12px setting. At the default setting the flow-row titles and summaries render at 13px (previously 14px) so they match think text at every setting instead of sitting 2px above it.
58 lines
2.7 KiB
TypeScript
58 lines
2.7 KiB
TypeScript
/**
|
|
* The one-line contract of the ToolRow summary line as CSS text. jsdom has no
|
|
* layout, so the rendering specs (chat-tool-row.spec.tsx) can pin which spans
|
|
* exist but not whether a narrow row still fits on one line; these read the
|
|
* declarations the layout depends on.
|
|
*/
|
|
import { readFileSync } from 'node:fs'
|
|
import { fileURLToPath } from 'node:url'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
const css = readFileSync(fileURLToPath(new URL('../src/client/tool/components/ToolRow.module.css', import.meta.url)), 'utf8')
|
|
/** Declarations only: the sheet's prose names the properties it explains. */
|
|
const declarationText = css.replace(/\/\*[\s\S]*?\*\//g, ' ')
|
|
|
|
function declarations(selector: string): string[] {
|
|
// Anchored at a rule boundary: an unanchored match would silently read a
|
|
// compound rule that merely contains the selector (`.root:hover .summarySuffix`)
|
|
// if one ever lands above the base rule.
|
|
const rule = new RegExp(`(?:^|\\})\\s*\\${selector}\\s*\\{([^{}]*)\\}`).exec(declarationText)
|
|
if (rule === null) throw new Error(`ToolRow.module.css has no \`${selector}\` rule`)
|
|
return (rule[1] ?? '').split(';').map(part => part.trim()).filter(Boolean)
|
|
}
|
|
|
|
describe('ToolRow.module.css summary line', () => {
|
|
it('keeps the summary suffix on one line and unshrunk', () => {
|
|
// `flex: none` stops the box shrinking, not the text wrapping: without
|
|
// `nowrap`, a row too narrow for title + separator + suffix wraps the `+n`
|
|
// onto a second line — the exact case the slot exists to survive.
|
|
expect(declarations('.summarySuffix')).toEqual(expect.arrayContaining([
|
|
'flex: none',
|
|
'white-space: nowrap',
|
|
]))
|
|
})
|
|
|
|
it('leaves the truncation to the summary text alone', () => {
|
|
// The suffix must never ellipsize: a clipped count reads as a smaller
|
|
// number rather than as missing information.
|
|
expect(declarations('.summary')).toEqual(expect.arrayContaining([
|
|
'overflow: hidden',
|
|
'text-overflow: ellipsis',
|
|
'white-space: nowrap',
|
|
]))
|
|
expect(declarations('.summarySuffix')).not.toEqual(expect.arrayContaining(['text-overflow: ellipsis']))
|
|
})
|
|
|
|
it('sizes the summary texts from the secondary content tier', () => {
|
|
// The Settings font-size preference must reach tool-call rows, not only
|
|
// the narration body: summary, suffix, and file link read the secondary
|
|
// tier (one step under the body), matching think text.
|
|
for (const selector of ['.summary', '.summarySuffix', '.fileLink']) {
|
|
expect(declarations(selector)).toEqual(expect.arrayContaining([
|
|
'font-size: var(--dsh-content-font-size-secondary, 13px)',
|
|
'line-height: calc(24px + var(--dsh-content-font-delta, 0px))',
|
|
]))
|
|
}
|
|
})
|
|
})
|