Files
claudecodeui/src/components/chat
Haileyesus 5554e4e85e fix(cursor-chat): count totals as rendered rows, not normalized transport rows
Cursor sessions were still showing inflated totals after the earlier total-count
work, producing UX mismatches like "Showing 16 of 31" while only ~16 visible
chat rows existed.

Why this happened:
- Cursor history normalization emits both `tool_use` and `tool_result` entries.
- The UI intentionally does not render `tool_result` as its own message bubble;
  it attaches tool results onto the related `tool_use` card.
- Total counting that includes `tool_result` therefore measures transport
  artifacts, not user-visible conversation rows.
- In practice, this makes totals look wrong and undermines trust in pagination
  status and session message counts.

Why this change:
- `total` is a user-facing semantic value and must represent what the user can
  actually see in the timeline.
- Cursor should follow the same rendered-message counting rule as other
  providers to keep behavior predictable across providers.
- Avoiding hidden/internal row counts in totals prevents confusion in
  "showing X of Y" indicators and load-more expectations.

What was changed:
- Replaced implicit/raw-style counting with explicit provider-side total
  tracking in Cursor history fetch.
- Total tracker increments only for processed messages that map to rendered chat
  rows, excluding standalone `tool_result` entries.
- Pagination windowing remains based on full normalized history payload to avoid
  changing ordering/loading mechanics; only displayed `total` semantics were
  corrected.

Result:
- Cursor `total` now reflects rendered chat rows rather than internal normalized
  event count.
- Session counters are now aligned with what users perceive in the UI.
2026-05-08 15:35:45 +03:00
..
2026-05-05 17:36:14 +03:00
2026-05-05 17:36:14 +03:00