Repository navigation
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The change moves the Files Reviewed (2 files)
Reviewed by deepseek-v4.1-flash · Input: 43.5K · Output: 3.9K · Cached: 287.5K Review guidance: REVIEW.md from base branch |
|
Investigated as KILO-APP-3R1. On current Evidence:
The 1.0.13 event (reported 2026-10-10T10:27Z) is from a build cut 2026-10-06/07, before #7110. No code fix is needed on Separately (not this PR): the tap-to-copy block-copy affordance became dead code in #7110, because no caller passes |
Problem
On Android 1.0.13 (build 393), a tap on a code block in the transcript can crash the app with
TypeError: Cannot read property 'locationY' of null.Sentry: KILO-APP-3R1 (culprit
setCopyActionTop$argument_0,code-block.tsx:318).handleToggleCopyActionreadevent.nativeEvent.locationYinside thesetCopyActionTopupdater. React runs that updater later, at render time, when the block already has a pending update. At that time, React has released the press event andnativeEventisnull.Fix
Read
locationYsynchronously in the press handler, before thesetCopyActionTopcall. The updater uses the captured value. The fallback to the block top for a press without coordinates does not change.Verification
keeps the tap Y when React releases the press event before the state update runs: it queues a layout update on the block (so React does not run the updater eagerly), presses, then setsnativeEventtonull.TypeError: Cannot read properties of null (reading 'locationY')(the Sentry error).top: 321.vitest run src/components/agents/code-block.test.ts: 48 passed.oxlint(mobile config) andoxfmt --checkon the changed files: clean.