Skip to content

#1043 Cut long user messages in the timeline and open them in full - #1049

Merged
ivanfenenko merged 6 commits into
mainfrom
fix/1043-collapse-long-user-messages
Nov 16, 2026
Merged

ivanfenenko merged 6 commits into
mainfrom
fix/1043-collapse-long-user-messages

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The crash. iOS threw NSInternalInconsistencyException: Content view returned an invalid size {408, 3617166} in MessageListTimelineHostCell.preferredLayoutAttributesFitting. One message is one timeline row with no height limit, and UIKit rejects a self-sized row taller than about 2,777,777 pt. A user message of roughly 74,000–147,000 lines (a pasted log) is enough, and the session then crashes every time it is opened. Android had the same uncapped rows.

The rule (MessageTextLimit, same name, constants and test vectors on both platforms, in the message pipeline where a message becomes its timeline presentation):

  • A line break counts as one line; every 40 characters within a line count as one line, so a source line costs max(1, ceil(length / 40)).
  • limit = 25, tolerance = 30. A message costing at most 30 shows in full. A longer one shows the prefix costing at most 25.
  • The cut ends after the last whole source line that fits. If the next line is long and budget is left, the part that fits is kept, cut at the last word boundary (ignored when it is within 20 characters of the line start), and ends with "…".
  • One pass that stops as soon as the cost passes 30: it reads at most ~1,230 characters, whatever the length (a 3 MB message costs the same as a 2 KB one). There is no String.count, split, copy or markdown parse of the whole text to decide. iOS counts Characters; Android counts UTF-16 units and never splits a surrogate pair.
  • Only the user's own messages are limited. Assistant replies, tool cards and everything else are unchanged.

Timeline. A cut user message shows only the prefix, rendered like any other user message: the markdown detector, parser and highlighter are given the prefix only (about 1,230 characters at most), so the timeline never lays out, measures or parses the hidden part. A cut inside a code fence renders as a code block running to the cut. Optimistic send rows are cut the same way. The row keeps the whole text, so Copy message, Select text, revert and fork still act on all of it. Tapping the bubble anywhere except the new row still opens the Message sheet.

New component: OpenCodeTruncationRow (iOS + Android, variant-first: .fullMessage(shownCharacters:totalCharacters:) / OpenCodeTruncationRowVariant.FullMessage). It is a full-width row inside the bubble, 8 pt under the text, corner radius 8, filled with the strong text colour at 6% (the same subtle fill the composer chips use), 12/8 padding, at least 40 tall. It shows "Show full message" in the button font, the caption "1,000 of 588,638 characters shown" in weak caption text, and the existing expandContent icon at 16 pt. It is added to both Component Galleries ("Truncation Row"). Accessibility: on iOS the bubble stays one element with a "Show full message" custom action; on Android the row is its own button node with a click label.

Sheet. Tapping the row opens the existing Select text sheet with the whole text, titled "Full message" (the Message sheet entry stays "Select text"). The body and the pinned Copy all button are unchanged. Analytics: chat_show_full_message on the Session Chat screen; the Select text screen view and its existing actions apply as before.

How the sheet handles very large text. Text above 32 KB (iOS: UTF-8 bytes, read without a scan; Android: UTF-16 length) opens the sheet at the half detent (it drags to full). The body then fills the sheet's body viewport exactly, through a new body-height value the bottom sheet exposes (openCodeBottomSheetBodyHeight / LocalOpenCodeBottomSheetBodyHeight), and scrolls itself:

  • iOS: a read-only UITextView (TextKit 2) with scrolling on, so it lays out only what is in view. Range selection with handles and the edit menu work as in the short body. Limits: TextKit 2 estimates the height of text it has not laid out, so the scroll indicator can jump on very long texts. A code-block focus is brought in with scrollRangeToVisible.
  • Android: a fixed-height LazyColumn of 40-line pieces (a line longer than 4,000 characters is split, never inside a surrogate pair) inside OpenCodeSelectionContainer. It lays out only the pieces in view. Limits: a drag selection reaches only the pieces on screen, and copying a selection that spans two pieces drops the line break between them. Copy all always copies the exact whole text.
  • Text at or below 32 KB keeps today's body (one non-scrolling text view / one Text), so short messages look exactly as before.

No protocol work: this is presentation only, and behaves the same on v1 and v2 servers.

Checks

  • iOS: xcodebuild build and xcodebuild build-for-testing (scheme OpenCode Mobile, generic/platform=iOS Simulator): both succeed.
  • iOS tests on a simulator: the new classes plus the existing timeline, bottom sheet and pipeline classes, 298 Swift Testing tests and 68 XCTest tests, 0 failures. This includes the 190,000-line row-height regression test.
  • Android: ./gradlew :app:assembleDebug and :app:assembleDebugAndroidTest succeed. :app:testDebugUnitTest for dev.opencode.mobile.ui.sessionchat.*, dev.opencode.mobile.domain.message.*, dev.opencode.mobile.ui.components.*, dev.opencode.mobile.ui.componentgallery.*: 1,558 tests, 0 failures (includes the new MessageTextLimitTest, SessionChatMessageLimitPresentationTest, and new cases in SessionChatSelectTextSheetTest and MessageContentPreparerTest).
  • Android instrumented on an emulator: OpenCodeSelectionContainerTest passes. OpenCodeBottomSheetTest failed 1 of 15 on the first of four runs and passed the other three; it looks flaky.
  • Real apps against a v2 harness server (generated filler; no v1 binary was available, and the change is presentation only), on an iOS simulator and a 192 MB-heap Android emulator:
    • A session with a 190,000-line user message (2,849,999 characters) opens on both platforms without crashing. The bubble is about one screen tall.
    • Cut cases behave as specified: 28 lines shown in full, 40 lines cut, a 3,008-character unbroken line cut at a word with "…", markdown and slash-command messages cut.
    • The row opens "Full message"; the huge text opens at the half stop in about 1.2 s (iOS) and 1.3 s (Android, Java heap 35–63 MB of 192 MB).
    • Copy all and Copy message are exact for texts up to 45 KB. The Message sheet on a cut bubble still offers Revert, Fork, Copy message and Select text.
    • Sending a long message shows the same cut on the optimistic row and after the server echo.
    • Device verification found three defects, fixed in 29c132a4e: the row stretched every cut bubble to full width (both platforms); every 40th line in the long Android sheet body sat too close to the next; and on Android, copying a text of a few MB crashed with TransactionTooLargeException (it now shows a "Too long to copy" toast).
  • ktlintCheck: no violations on any changed line (the files keep their earlier violations).
  • node scripts/check-string-keys.mjs: keys match (4 new keys on both platforms).
  • gitleaks git --pre-commit --staged: no leaks.

New tests:

  • Rule (same vectors on both): empty, short, exactly 25, 26–30 in full, 31 cut to 25, over by line breaks, blank lines, 1,200 vs 1,201 unbroken characters, 5,000 unbroken, mixed with a mid-line word cut, a word ending exactly at the cut, a word boundary too close to the line start, and 3 MB inputs (log lines and one unbroken line) asserting how many characters were read. Android also checks surrogate pairs.
  • Presentation: a long user message produces the cut text plus the counts, an assistant message of the same length is untouched, Copy message and the Full message target carry the whole text, and a cut user message is not parsed as markdown while the same assistant text is.
  • iOS regression (SessionChatLongUserMessageRowHeightTests): a user message of 190,000 short lines, hosted in the real SessionChatTimelineView and MessageListTimelineHostCell, must size its row between 100 and 1,000 pt.

Evidence

Screenshots for both platforms, light and dark: #1049 (comment)

Issue

Fixes #1043

Risks / Follow-ups

  • Not checked on iOS for the 2.85 MB text: scrolling to the end, selecting a range and Copy all. The device tool's accessibility query on a text view that large pins the app at 100% CPU, so the check could not be driven; these work at 45 KB. VoiceOver may hit the same path and needs a manual check.
  • Not checked: VoiceOver and TalkBack on a cut bubble and the row, iPad keyboard focus, long press on a cut bubble, and a v1 server.
  • iOS takes 8–34 s to load the session with the 2.85 MB message. The time goes to the markdown detector running over the whole text before the cut is applied; that code predates this change. 75b728bc6 moves the detector after the cut; the new load time is not measured yet.
  • The follow-up commit 75b728bc6 has not been run on a device yet. It renders markdown in the visible part of a cut message, keeps whole-text passes off the load path for over-limit user messages (hashing and equality use the prefix and byte length), and makes Android count \r\n as one line break. Still to check on devices: the iOS tests, a cut markdown bubble (heading, list, code fence, table) on both platforms, and the load time below.
  • Android: text of a few MB cannot be copied to the clipboard (system limit); the app shows a toast instead.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Note

Medium Risk
Broad changes across timeline layout, message markdown pipeline, and sheet scrolling for multi-MB texts; regression risk mainly in row sizing, markdown on cut bubbles, and copy/select behavior.

Overview
Fixes timeline crashes from uncapped user message row height by introducing shared MessageTextLimit rules (line-cost budget) that show only a prefix of long user prompts, while keeping the full text for copy, revert, and fork.

Timeline & pipeline: User text blocks gain a SessionChatTextLimit / OpenCodeOutgoingMessageLimit and an OpenCodeTruncationRow (“Show full message”) that opens Select text titled Full message (chat_show_full_message analytics). Markdown detection, parsing, enrichment, and viewport budgets now use markdownSourceText / MarkdownInputProbe so the hidden tail is never laid out or parsed; optimistic sends are cut the same way.

Very long text sheet: Select text switches to a half-height, self-scrolling body (chunked LazyColumn on Android; sheet LocalOpenCodeBottomSheetBodyHeight) above a 32 KB threshold; Copy all on Android catches oversized clipboard failures with a toast.

Parity: Matching iOS changes (limited text block type, truncation row, gallery entries, perf tweaks using UTF-8 counts / cheaper trim). Unit tests cover cut vectors, presentation, pipeline probes, and select-text chunking.

Reviewed by Cursor Bugbot for commit 8a03e09. Bugbot is set up for automated code reviews on this repo. Configure here.

A user message is one timeline row with no height limit, and UIKit
rejects a self-sized row taller than about 2.8 million points: a pasted
log of ~150,000 lines crashed the app on every open of the session.

Only the user's own messages are limited. MessageTextLimit (same name,
constants and vectors on iOS and Android) counts a line break as one
line and every 40 characters as one more, in one pass that stops as
soon as the message is over: up to 30 lines shows in full, longer shows
the first 25 (a long line is cut at a word and ends with "…"). The
timeline shows only that prefix, never parses it as markdown, and ends
the bubble with a new design-system OpenCodeTruncationRow, "Show full
message", that opens the whole text in the Select text sheet titled
"Full message". Copy message, Select text, revert and fork keep acting
on the whole text.

Very long text in the Select text sheet now opens at the half detent
and lays out only what is in view: a UITextView that scrolls itself on
iOS, a lazy list of line chunks on Android, sized from a new body-height
value the bottom sheet exposes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko
ivanfenenko marked this pull request as ready for review November 15, 2026 19:47

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: no finding that 2+ of 2 passes agreed on.

2 finding(s) from a single pass, not posted
  • android/app/src/main/java/dev/opencode/mobile/domain/message/pipeline/MessageTextLimit.kt:72 medium: CRLF line endings make Android overcount line cost, truncating messages iOS shows in full (deepseek-v4.1-flash)
  • android/app/src/main/java/dev/opencode/mobile/domain/message/pipeline/MessageContentPreparer.kt:213 low: Cut decision uses message.text while the timeline cuts each block's text, so markdown can be dropped without any truncation (deepseek-v4.1-flash)

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.149 · 1 pass(es) stopped early · 1 pass(es) failed

@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

…ash on Copy all

Found while checking the pull request on a simulator and an emulator:

- The Show full message row filled the bubble's full width on both
  platforms, so a cut bubble stretched to the maximum width and its text
  sat at the far edge with an empty area beside it. A cut bubble is now as
  wide as the wider of its text and the row, like an uncut bubble.
- Android: the long Select text body is a list of 40-line pieces, and each
  piece trimmed its outer line spacing, so every 40th line sat closer to the
  next. Pieces now keep it.
- Android: Copy all (and Copy message) on a text of a few MB crashed the
  app with TransactionTooLargeException from the clipboard. It now shows
  "Too long to copy. Select a part of it instead." (Android-only string).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

Device verification (iPhone 18 Pro Max simulator, iOS 27.2 · Android emulator API 37, 192 MB heap)

Real apps against a scenario-harness v2 server (opencode v2.2.5), generated filler sent over REST. v2 only: no v1 server binary is installed here, and the change is presentation only. Screenshots are after fix commit 29c132a.

Tests

  • iOS (-only-testing, on the simulator): MessageTextLimitTests, SessionChatMessageLimitPresentationTests, SessionChatLongUserMessageRowHeightTests (190,000 lines → row 100–1,000 pt), SessionChatSelectTextTests, plus Timeline Blocks / Projector / PendingPrompt / OffMain / OlderHistory, the five MessageListTimelineHost*/RowHeightEstimate/BottomOffset classes, the three OpenCodeBottomSheet* classes, OpenCodeMessageTimeReveal, DisplayMessagePipelineCharacterization: 298 Swift Testing tests (15 suites) + 68 XCTest, 0 failures, before and after the fix.
  • Android: :app:assembleDebug, :app:assembleDebugAndroidTest, JVM domain.message.*, ui.sessionchat.*, ui.components.*, ui.componentgallery.*: 1,558 tests, 0 failures, before and after the fix. Instrumented on the emulator: OpenCodeBottomSheetTest 15/15 (1 failure on the first of 4 runs, then 3 clean runs; looks flaky), OpenCodeSelectionContainerTest 2/2.

What was checked (both platforms unless noted)

  • Server accepted the 190,000-line paste whole: 2,849,999 characters (2.85 MB).
  • 190,000-line session opens without crashing; bubble is about one screen tall; caption "374 of 2,849,999 characters shown".
  • 3 lines: unchanged. 28 lines: shown in full, no row. 40 lines: cut at 25, "765 of 1,230". 3,008-char unbroken line: cut at a word with "…", "992 of 3,008". Markdown: cut, shown as raw text. Slash command (custom /review-log, 40 lines of args): cut, "620 of 1,088".
  • Row → "Full message" sheet with title and close button; Copy all of the 40-line text and of a 45 KB text is byte-identical to what was sent (iOS pasteboard; Android pasted into the composer).
  • Huge message sheet opens at the half stop, scrolls, drags to full. Android: drag-selection across a 40-line piece boundary copied the exact text, including the line break.
  • Bubble tap away from the row → Message sheet with Revert / Fork / Copy message / Select text; Copy message is byte-identical; Select text shows all of it; Fork opens its dialog.
  • Sending a 35-line message from the composer: cut with the same caption on the optimistic row and after the echo, no relayout.
  • "Truncation Row" renders in each Component Gallery.

Fixed in 29c132a

  • The row stretched every cut bubble to the full width (text pushed to the far edge). A cut bubble now fits its text, like an uncut one.
  • Android: every 40th line in the long Select text body sat closer to the next (each piece trimmed its line spacing).
  • Android: Copy all / Copy message on the 2.85 MB text crashed the app (TransactionTooLargeException from the clipboard). It now shows a "Too long to copy" toast.

iOS

Cut row, light Cut row, dark 28 lines, uncut Full message sheet
Message sheet on a cut message 190,000-line session 190,000-line sheet 45 KB sheet (half stop)
Unbroken line Markdown Short message, Select text Sent from composer Gallery

Android

Cut row, light Cut row, dark Full message sheet Message sheet on a cut message
190,000-line session 190,000-line sheet Piece boundary 40/41 Copy all on 2.85 MB
Unbroken line Markdown Short message Short message, Select text
Optimistic send After echo Gallery

Not checked / open

  • v1 protocol; VoiceOver / TalkBack; iPad keyboard focus.
  • iOS: long-press range selection inside the self-scrolling UITextView (the device tool's accessibility snapshot of a 2.85 MB text view pins the app at 100% CPU, so it couldn't drive it); Copy all of the 2.85 MB text on iOS.
  • iOS: the 190,000-line session took 8–34 s to show its timeline (spinner "Fetching timeline…"), most of it in the markdown detector over the whole text (shouldPlainFirstHistoryPublish → OpenCodeRenderedMarkdownDetector.shouldRender) — reported separately, not fixed here.

ivanfenenko and others added 3 commits November 15, 2026 22:42
…cost

A cut user message now goes through the same markdown decision and
rendering as an uncut one, applied to its shown part only: the detector,
parser and highlighter read `markdownSourceText` (the cut prefix of an
over-limit user message, else the whole text) on every preparer and
history-publish path. The document attaches to the cut text only when
that text is the same shown part, so it never lands on a collapsed
command or an uncut bubble. Copy, Select text, Full message, revert and
fork keep the whole text.

Whole-text passes on the load and frame path are removed or bounded for
over-limit user messages: row revisions hash the shown part plus the
whole length (both platforms), row equality and the iOS yield check use
the O(1) UTF-8 length, iOS cut counts use UTF-16 as Android does, the
prepared-history cache and snapshot score stop grapheme-counting, and
iOS text-part and command trims no longer copy text with nothing to
trim. Android's cut bubble sizes without intrinsic measurement, which
rendered tables cannot answer.

Android now counts CRLF as one line break, as iOS does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A long paste that opened with more blank lines than the tolerance kept
only those blank lines, which the trailing-whitespace trim then emptied:
the bubble was blank and read "0 of N characters shown". Leading blank
lines still count toward the cut decision, but the shown part now
starts at the first line with a non-blank character (keeping its
indentation), and the skipped blank lines count as shown. Same rule and
test vectors on both platforms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

/review

@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

@cursor review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: 1 finding(s) that 2+ of 3 passes agreed on.

Outside the diff lines:

  • ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/Timeline/SessionChatTimelineBlocks.swift:2493 medium: Cut row counts UTF-16/UTF-8 over the whole multi-MB text per build
7 finding(s) from a single pass, not posted
  • android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/view/SessionChatSelectTextSheet.kt:182 medium: Scrolling sheet drops a newline at every chunk boundary (muse-spark-1.3-contributor)
  • ios/OpenCode Mobile/OpenCode Mobile/Domain/Message/Pipeline/MessageTextLimit.swift:64 medium: All-blank long text reads the whole string and grows to its size (muse-spark-1.3-contributor)
  • android/app/src/main/java/dev/opencode/mobile/domain/message/pipeline/MessageTextLimit.kt:166 medium: All-blank fallback scans the entire message (muse-spark-1.3-contributor)
  • ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/Region/SessionChatComposer.swift:1140 medium: Optimistic send row may attach a document parsed from the full text to a cut block (deepseek-v4.1-flash)
  • android/app/src/main/java/dev/opencode/mobile/ui/components/chat/OpenCodeOutgoingMessage.kt:597 low: Limited-text layout measures text before choosing width and can measure the row twice at different widths (deepseek-v4.1-flash)
  • android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/view/SessionChatSelectTextSheet.kt:1345 low: Chunk splitter drops the line break at every CRLF boundary (deepseek-v4.1-flash)
  • android/app/src/main/java/dev/opencode/mobile/ui/components/chat/OpenCodeTruncationRow.kt:88 low: Semantics onClick lambda shadows the component's onClick parameter (deepseek-v4.1-flash)

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.163 · 1 pass(es) stopped early

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

…blank skip

Android: Copy all in Select text dismissed the sheet even when the copy
was too long and the toast asked the user to select a part instead; the
sheet now stays open then. The scrolling sheet's chunks end before a
CRLF, so no stray CR sits at every chunk boundary of a Windows log.

Both platforms: the search for the first line with content stops after
64 KiB past the decision pass, so a multi-MB blank paste is not read in
full.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

/review

@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

@cursor review

@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

Device check of 75b728b (iOS simulator, iOS 27.2 · Android emulator, API 37, 192 MB heap)

Real apps against a scenario-harness v2 server (opencode v2.2.5); generated filler seeded over REST. v2 only: no v1 server binary is installed here, and the change is presentation only. No code changes pushed from this run. Commits pushed after 75b728b (92dd36d, the merge from main, 8a03e09) were not device-checked here.

Tests

  • iOS (-only-testing, simulator): MessageTextLimitTests, SessionChatMessageLimitPresentationTests, MessageSnapshotAuthorityTests (34 Swift Testing tests, 3 suites) and SessionChatLongUserMessageRowHeightTests (1 XCTest): 0 failures.
  • iOS SceneWorldSignalsTests: 3 separate runs, 7/7 passed each time on this branch. The CI failure looks like a timing flake, not this change.
  • Android JVM domain.message.* + ui.sessionchat.*: 1,309 tests, 0 failures; :app:assembleDebug and :app:assembleDebugAndroidTest pass.

Load time: tap the 190,000-line (2.85 MB) session on Home → timeline shown

"Video" = measured from a screen recording, from the first frame that leaves Home to the first frame showing the bubble (the tap delay of the automation tool excluded). "Tool" = wall clock from dispatching the tap to the "Show full message" row being found, including the tool's own overhead (~0.5–1 s). Load = host 1-minute load average.

Build Run Video Tool Load
iOS 29c132a (before) cold 1 / 2 / 3 32.1 / 27.3 / 26.6 s 63.2 / 28.4 / 27.4 s 17 / 23 / 14
iOS 29c132a (before) cold, unrecorded 45.1 / 75.9 / 73.7 s 26 / 51 / 51
iOS 75b728b (after) cold 1 / 2 / 3 0.2 / 0.2 / 0.1 s 1.2 / 0.9 / 0.9 s 11 / 9 / 8
iOS 75b728b (after) cold, unrecorded (10 runs) 0.95–2.2 s 11–26
iOS 75b728b (after) warm × 3 0.76 / 0.74 / 0.74 s 6–7
Android 75b728b cold × 3 2.9 / 3.1 / 3.6 s (while recording) 2.8 / 2.5 / 2.3 s 5
Android 75b728b warm × 3 2.1 / 1.8 / 1.3 s 5
  • Before: "Loading messages · Fetching timeline…" for 27–32 s. After: the timeline is ready by the end of the push animation and no spinner shows.
  • iOS outliers: 3 of 16 "after" cold runs took 16–26 s by tool time. The recording shows the app sitting on Home until the tap lands, then the timeline appears at once. A sample of the app during that wait shows an idle main thread, so the delay is in delivering the tap, not in loading.
  • The 190,000-line session still scrolls normally on iOS, and the row stays about one screen tall (374 of 2,849,999 characters shown, same on Android).
  • Android now takes longer than iOS (~2.5–3 s of "Fetching timeline…" on this 192 MB-heap emulator). That is about the 2.6 s measured before, so it has not regressed.

Visual checks

Check iOS Android
Cut markdown renders markdown, same fonts/spacing/inline code as the uncut copy pass pass
Bubble width full width, like the uncut markdown bubble fits content, like the uncut markdown bubble
"…" in prose after the last word same
"…" in a list item after the last word of the item; bold closed before the cut renders fine same
Cut inside a code fence code block runs to the cut; a mid-line "…" is hidden past the block's right edge (horizontal clip) same
Bold open at the cut literal ** shown (**rounding difference … keeps open…) same
Table cut inside rows / cut after the table clean (last whole row, no half row) / clean same, no crash
40-line plain log as before (673 of 2,150) as before (673 of 2,150)
Emoji message over the limit 25 lines, 1,031 of 1,493 17 lines, 695 of 1,493
CRLF message over the limit 25 lines, 689 of 997 25 lines, 689 of 997
Send a long markdown message from the composer optimistic row = echo, no relayout optimistic row = echo, but the echo briefly shows raw markdown (~0.3 s)
Copy all ("Full message") / Copy message on a cut markdown message 1,297 / 1,297 chars, identical to what was sent Copy all: 1,297 chars (pasted into the composer)
Light / dark pass pass

Open for a decision

  1. Emoji cut differs by platform. iOS counts a line's cost in grapheme clusters (Character) and Android in UTF-16 units, so the same message cuts at different lines. Only the counts were moved to UTF-16 in this commit, not the cost. Recommendation: one unit on both. Count cost in UTF-16 units on iOS but never split a Character; on Android, also avoid cutting inside a grapheme cluster (ZWJ, skin tone). Add a shared emoji test vector.
  2. Dangling ** at a cut. When the cut falls inside bold text, the opening marker shows literally. Recommendation: drop any inline marker left open in the visible prefix before parsing, or close it.
  3. Android echo flash (raw markdown for a few frames when the server echo replaces the optimistic row). An uncut markdown message flashes the same way, so this predates the commit. Worth its own issue.
  4. Bubble width: each platform matches its own uncut markdown bubble, so a cut bubble does not jump when compared with an uncut one. The platforms differ from each other (iOS full width, Android fits content), as they did before. Recommendation: keep it as is in this PR. If the platforms should match, decide that in a separate design pass.

Not checked

  • iOS 2.85 MB "Full message" sheet: scrolling to the end, range selection and Copy all could not be driven. Even a coordinate tap from the automation tool goes through an accessibility capture, which pins the app at 100% CPU in UIAccessibility on that text view (it never finished in 2 minutes). Needs a manual check on a device.
  • v1 protocol; VoiceOver / TalkBack; Android Copy message (Copy all checked).

iOS

Uncut (prose) Cut, light Cut, dark List cut
Code: uncut above, cut below Code cut mid-line Table cut inside Table cut after
Emoji CRLF 40-line log 190,000 lines
Send: optimistic Send: echo Full message

Android

Uncut above, cut below Cut, light Dark List cut
Code cut Code cut mid-line Table cut inside Table cut after
Emoji CRLF 40-line log 190,000 lines
Send: optimistic Echo, first frames (raw) Echo, settled Full message

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 8a03e09. Configure here.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review: no finding that 2+ of 2 passes agreed on.

4 finding(s) from a single pass, not posted
  • ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/Timeline/SessionChatTimelineBlocks.swift:2493 medium: Full-text scan on every timeline build defeats cut budget (muse-spark-1.3-contributor)
  • ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/Timeline/DisplayFrame.swift:28 medium: ContentRevision hashes full text length with O(n) utf8.count (muse-spark-1.3-contributor)
  • android/app/src/main/java/dev/opencode/mobile/ui/sessionchat/timeline/SessionChatTimelineBlocks.kt:1706 low: Cut message's markdown is dropped when the first line starts with whitespace (glm-5.3-flash)
  • ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/Timeline/DisplayFrame.swift:201 low: matchingMarkdown guard compares cut of raw text against trimmed block text (glm-5.3-flash)

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.160 · 2 pass(es) stopped early · 1 pass(es) failed

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.

iOS crash: NSInternalInconsistencyException in MessageListTimelineHostCell.preferredLayoutAttributesFitting, invalid row height (1.4.0 (45))

1 participant