feat(web): fold the search truncation total into the summary line

Replace the separate '已截断 · 共 N' pill with '显示 X / 共 N 处匹配 · K 个文件'
(and '显示 X / 共 N 个路径' for glob), mirroring the read card's '显示 X / Y 行',
so the retained count and the pre-cap total read as one clause instead of two
numbers that appear to disagree.
This commit is contained in:
Chinesezjc
2026-07-30 18:09:03 +08:00
parent 71adea8ba4
commit 2928c65ccd
3 changed files with 18 additions and 19 deletions
@@ -61,10 +61,10 @@ describe('SearchBlock matches kind', () => {
expect(lines(view.container)).toEqual(['1: x', '2: y'])
})
it('shows the truncation pill with the pre-cap total', () => {
it('folds the pre-cap total into the summary when truncated', () => {
const view = render(<SearchBlock kind="matches" truncated total={99} files={[group('a.ts', 2)]} />)
expect(view.getByText('已截断 · 共 99')).toBeTruthy()
expect(view.getByText('2 处匹配 · 1 个文件')).toBeTruthy()
expect(view.getByText('显示 2 / 共 99 处匹配 · 1 个文件')).toBeTruthy()
expect(view.queryByText(/已截断/u)).toBeNull()
})
})
@@ -77,9 +77,10 @@ describe('SearchBlock paths kind', () => {
expect(fileHeaders(view.container)).toEqual([])
})
it('shows the truncation pill with the pre-cap total', () => {
it('folds the pre-cap total into the paths summary when truncated', () => {
const view = render(<SearchBlock kind="paths" truncated total={50} paths={['a', 'b']} />)
expect(view.getByText('已截断 · 共 50')).toBeTruthy()
expect(view.getByText('显示 2 / 共 50 个路径')).toBeTruthy()
expect(view.queryByText(/已截断/u)).toBeNull()
})
})