Skip to content

fix(mobile): route snapshot-init progress to the working indicator row - #4766

Merged
iscekic merged 1 commit into
mainfrom
fix/mobile-session-loading-ux-pr
Jul 25, 2026
Merged

fix(mobile): route snapshot-init progress to the working indicator row#4766
iscekic merged 1 commit into
mainfrom
fix/mobile-session-loading-ux-pr

Conversation

@iscekic

@iscekic iscekic commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Problem

At the start of a live agent chat turn, while the CLI initializes its git snapshot baseline (cold track > ~500 ms), the CLI injects a synthetic text part (synthetic: true, text ⠋ Initializing snapshot…) into the live assistant message. Mobile rendered it as an inline line in the message list while the fixed status row above the composer simultaneously showed the generic Writing response · Ns — two stacked, mismatched spinner lines. The line could also linger in the finished transcript.

Baseline on-device evidence (E2E, forced cold-snapshot window): inline Initializing snapshot... line under the user bubble + fixed row Writing response · Ns at the same time, and the inline line persisted in the finished transcript after close/reopen.

Fix

Mirror the VS Code extension's special case with the narrowest change:

  • part-types.ts: new isSnapshotProgressPart guard (text part + synthetic === true + text includes Initializing snapshot; same match rule as kilo-vscode snapshotProgress()).
  • compute-status.ts: new SNAPSHOT_PROGRESS_STATUS = 'Initializing snapshot…' (U+2026, matching the CLI's own typography); the fixed working-indicator row now reads Initializing snapshot… · Ns during snapshot init instead of Writing response · Ns.
  • part-renderer.tsx: snapshot-progress parts render null, unconditionally — no inline duplicate while streaming, and a persisted part (long/killed turn) never lingers in the transcript.
  • collect-copyable-text.ts: the same narrow signature is excluded from long-press copy; synthetic user optimistic parts stay copyable.

Everything else (user optimistic messages, all other part routing, copy, status mappings) is byte-identical. Degrades gracefully if CLI wording changes: the part would render as before, no crash.

Test plan

  • New/updated unit tests: part-types, compute-status (new), part-renderer, message-copy-text (27 tests in the touched files)
  • Full mobile suite: 220 files / 1820 tests pass
  • pnpm format && pnpm typecheck && pnpm lint && pnpm check:unused clean; git diff --check clean
  • Baseline E2E (repro): dual-indicator facet + transcript linger demonstrated on the unmodified app
  • Acceptance E2E on this branch (iOS simulator, forced cold-snapshot window on a 100k-file scratch repo):
    • No inline Initializing snapshot line in any frame during the window, after completion, or after close/reopen (the baseline run's lingering line is gone on the fixed build)
    • Fixed row reads Initializing snapshot… · Ns throughout the cold window (frame series, 5s→43s)
    • Row flips to the normal computed status when the turn proceeds (Considering next steps · 45sThinking · 49s), elapsed timer continues; row clears at completion
    • Regressions: session reopen, Home, Agents list unchanged
  • Long-press copy exclusion (unit-gated; on-device copy automation not operationalized)

Note: during E2E a TypeError: isSnapshotProgressPart is not a function appeared once in Metro logs with a "3 earlier items could not be displayed" banner. Triaged to a Metro fast-refresh module-skew artifact caused by switching branches under a running app: after a cold app start on a consistent bundle, the same session renders correctly with no banner and no new errors. Not a defect in this change.

@iscekic iscekic self-assigned this Jul 25, 2026
@kilo-code-bot

kilo-code-bot Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

Reviewed the snapshot-init progress routing changes across part-types.ts, compute-status.ts, part-renderer.tsx, and collect-copyable-text.ts with high confidence; the new isSnapshotProgressPart guard is applied consistently and covered by matching tests.

Files Reviewed (8 files)
  • apps/mobile/src/components/agents/collect-copyable-text.ts
  • apps/mobile/src/components/agents/compute-status.ts
  • apps/mobile/src/components/agents/compute-status.test.ts
  • apps/mobile/src/components/agents/message-copy-text.test.ts
  • apps/mobile/src/components/agents/part-renderer.tsx
  • apps/mobile/src/components/agents/part-renderer.test.ts
  • apps/mobile/src/components/agents/part-types.ts
  • apps/mobile/src/components/agents/part-types.test.ts

Reviewed by claude-sonnet-5 · Input: 14 · Output: 5.3K · Cached: 277.2K

Review guidance: REVIEW.md from base branch main

@iscekic
iscekic enabled auto-merge (squash) July 25, 2026 07:18
@iscekic
iscekic merged commit 0a1974e into main Jul 25, 2026
19 checks passed
@iscekic
iscekic deleted the fix/mobile-session-loading-ux-pr branch July 25, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants