Skip to content

fix(mobile): count grep/glob badge from sheet rows - #5315

Merged
iscekic merged 1 commit into
mainfrom
grep-count-7dd1
Aug 18, 2026
Merged

fix(mobile): count grep/glob badge from sheet rows#5315
iscekic merged 1 commit into
mainfrom
grep-count-7dd1

Conversation

@iscekic

@iscekic iscekic commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • User: the grep and glob tool cards now show a badge count that matches the files shown when you tap the card. A card with only a Found N summary and no files no longer shows a misleading 1 matches badge.
  • Product: the badge count on grep/glob cards now reflects the actual visible result rows, removing a misleading off-by-one badge.
  • Maintainer: getToolDisplay now derives the badge from buildResultRowsModel(output, kind).rows.length instead of a raw non-empty-line count, so the lifted Found N caption is not counted. The badge is omitted when the model has zero rows.

Verification

  • Automated only: pnpm --filter kilo-app exec vitest run src/components/agents/tool-card-display.test.ts (36 tests pass), pnpm --filter kilo-app typecheck, pnpm --filter kilo-app lint.
  • No manual device test: this is a pure string projection, unit-tested against the same model the sheet uses.

Visual Changes

N/A

Reviewer Notes

  • E2E: bot-e2e — skipped; pure string projection unit-tested against the same model the sheet uses. No runtime behavior to verify on a device.
  • Human steps: none.

Use buildResultRowsModel so the Found caption is not a match or a file.
@iscekic iscekic self-assigned this Aug 18, 2026
@iscekic
iscekic requested a review from jeanduplessis August 18, 2026 01:37
@kilo-code-bot

kilo-code-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Reviewed the grep/glob badge fix at HEAD 1c82d0f: getToolDisplay now derives the badge from buildResultRowsModel(output, kind).rows.length — the same pure model the detail sheet renders — so the badge matches visible rows and is omitted when only a lifted Found N caption exists. The change is a pure string projection with no state, side effects, or memory-leak surface; the four new unit tests pin both the counting and badge-omission behavior for grep and glob.

Files Reviewed (2 files)
  • apps/mobile/src/components/agents/tool-card-display.ts
  • apps/mobile/src/components/agents/tool-card-display.test.ts

Reviewed by kimi-k3 · Input: 85.6K · Output: 2.7K · Cached: 175.1K

Review guidance: REVIEW.md from base branch main

@iscekic iscekic added the human-ready The PR is ready for human review. label Aug 18, 2026
@iscekic
iscekic merged commit 5cfbf7b into main Aug 18, 2026
18 checks passed
@iscekic
iscekic deleted the grep-count-7dd1 branch August 18, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human-ready The PR is ready for human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants