fix(mobile): bound Android text spans per line in chat code and PR diff - #6197
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental fix skips the blank-line placeholder for an empty fence ( Files Reviewed (2 files)
Previous Review Summaries (3 snapshots, latest commit a69e62e)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit a69e62e)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe previously reported span-bounding gaps (stale mount reset and the single-line run budget) are fixed; one residual edge case remains where an empty code fence gains a blank line box. Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (9 files)
Fix these issues in Kilo Cloud Previous review (commit 5e4387d)Status: 2 Issues Found | Recommendation: Address before merge Executive SummaryTwo residual gaps in the new Android span-bounding path: a replaced fence can resume from a stale chunk mount count, and a single very long source line still lands in one Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (8 files)
Fix these issues in Kilo Cloud Previous review (commit 213dc0b)Status: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (7 files)
Notes: untagged-run color parity holds for all three callers ( Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
6bba86e to
5e4387d
Compare
ca36acd to
a69e62e
Compare
a69e62e to
d883211
Compare
|
(bot) kwf reopened its section for this PR: verification restarted (phase verify) The proof in the body came from an earlier round and can be stale. This PR is human-ready, so nothing here was changed. |
Changelog for users
Changelog for maintainers
apps/mobile/src/components/agents/code-block.tsx:232— accepted: the mount state now resets during render whenever the fence text no longer extends the stored text, instead of waiting for the batch effect; a replaced fence shorter than the first paint kept the replaced-away text in state, so a later fence that extended that text matched it and mounted more than one bounded batch in a single commit.apps/mobile/src/components/agents/code-block-model.ts:73— accepted:chunkTokenLinesnow bounds tagged runs per chunk as well as lines (CODE_CHUNK_TOKENS = 512); a line denser than the budget is split at token boundaries before packing, so a single very long source line no longer becomes oneTextholding that line's whole run set. Ordinary lines stay whole and keep the 32-line cap.apps/mobile/src/components/agents/code-block.tsx:304— accepted: a selectable fence no longer renders as oneText; it chunks like every other fence, so the tool detail sheet's 50,000-character body bounds itsSetSpanOperation.executespans to one chunk. Selection now spans the chunk the gesture starts in, and the message-details Select text view still offers whole-fence selection.apps/mobile/src/components/agents/code-block.tsx:320— accepted: oneTextper source line is replaced by oneTextper 32-line chunk, so native view count no longer scales with line count (a 1,300-line fence no longer needs 1,300 views).apps/mobile/src/components/agents/code-block.tsx:329— accepted: chunkTexts areaccessible={false}inside one accessible hostViewthat carriescopyCode, so a fence stays one screen-reader element instead of one per line.Text; untagged runs stay raw strings, and the chat/tool code block and both diff renderers (per-line and side-by-side) share it. Non-selectable and selectable fences share one chunked render path; the first paint mounts four chunks (128 lines) and each later commit adds four.SetSpanOperation.execute(fewer spans, capped per chunk),ReactTextView.onDrawandonMeasure(chunked layout instead of one whole-fence layout), and the input-dispatch timeout reported asMessageQueue.nativePollOnce.Viewwrapper, and scroll mode keeps the intrinsic-width wrapper for height measurement; selecting across more than one chunk takes a second gesture, or the message-details Select text view.E2E proof
scripted-shard1.mp4.trim.mp4
e1-scroll.mp4
e1-scroll.mp4.trim.mp4
e4-scroll.mp4
e4-scroll.mp4.trim.mp4
Skipped checks (pending owner verification)
The transcript and tool detail sheet checks in the appended log excerpts are this change's evidence; they replace the earlier tool-detail-sheet and TalkBack excerpts. The transcript fence lays out to its tail with its copy trigger present, and the tool sheet renders its large read body in wrap mode; the fence still exposes one accessibility element with a single copy trigger. Limitations: the copy action was not fired, no dark capture was taken, and the sheet's Scroll mode and long-press-drag sub-check were not driven. The evidence was collected on 2026-09-16 on an unrecorded platform, and the request asked for Android.
Owner request
E2E proof — log excerpts
/home/igor_kilocode_ai/.local/share/kwf/sections/kwf-fix-review-1a74/e2e-mobile-app/e1-send-scene.log/home/igor_kilocode_ai/.local/share/kwf/sections/kwf-fix-review-1a74/e2e-mobile-app/e2-sheet.log/home/igor_kilocode_ai/.local/share/kwf/sections/kwf-fix-review-1a74/e2e-mobile-app/e2-transcript.log