fix(web): bound segment summary editor height

This commit is contained in:
Codex 2026-08-14 17:12:33 +08:00
parent 211344d0b0
commit b02b64dcb8
2 changed files with 6 additions and 0 deletions

View File

@ -26,6 +26,11 @@ describe('SummaryText', () => {
expect(screen.getByTestId('textarea')).toHaveValue('My summary')
})
it('should cap the auto-growing summary field', () => {
render(<SummaryText />)
expect(screen.getByTestId('textarea')).toHaveAttribute('maxRows', '6')
})
it('should render empty string when value is undefined', () => {
render(<SummaryText onChange={onChange} />)
expect(screen.getByTestId('textarea')).toHaveValue('')

View File

@ -22,6 +22,7 @@ const SummaryText = ({ value, onChange, disabled }: SummaryTextProps) => {
)}
placeholder={t(($) => $['segment.summaryPlaceholder'], { ns: 'datasetDocuments' })}
minRows={1}
maxRows={6}
value={value ?? ''}
onChange={(e) => onChange?.(e.target.value)}
disabled={disabled}