Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(mobile): preserve Markdown views while streaming #9664

Closedt3dotgg(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromt3code/perf-mobile-markdown-identityopened View on GitHub

Streaming Markdown used growing end offsets and text in React keys. Each update could replace the active text view, code block, and scroll container.

Keep block keys tied to type and start position. Keep text-run and code-token keys stable as content grows. Formatting and block-type changes still get separate identities.

Checked:

  • 49 focused Markdown tests passed.
  • Mobile typecheck, targeted lint, and formatting passed. Two existing React lint warnings remain in the code-block renderer.
  • The locked C++ parser confirmed stable keys for prose, open and closed fences, tables, nested code, and completed blocks. A paragraph-to-heading change gets a new key.

No browser or device testing, as requested. Selection, copy feedback, and horizontal scrolling have source checks only. No native source or configuration changed.

Merge hold: CI detects an iOS fingerprint change because Expo hashes the whole local Markdown module. This needs a native-release merge window under the current fingerprint policy.

Part of the performance audit.

Created with GPT-6 Astra (preview) in Codex.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. github-actions[bot](GitHub profile, opens in a new tab) added labels📱 Native Change

    3. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.5 KiB13.7 KiB+237 B (+1.7%)15.1 KiB✅
      CodexThread snapshot wire7.0 KiB7.0 KiB−3 B (−0.0%)7.3 KiB✅
      CodexLive turn WebSocket wire6.5 KiB6.7 KiB+240 B (+3.6%)7.8 KiB✅
      CodexLive turn WebSocket decoded57.0 KiB58.5 KiB+1.5 KiB (+2.6%)66.4 KiB✅
      CodexLive turn messages810+2 (+25.0%)21✅
      ClaudeTotal thread wire13.7 KiB13.6 KiB−158 B (−1.1%)15.1 KiB✅
      ClaudeThread snapshot wire7.0 KiB7.0 KiB+1 B (+0.0%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.7 KiB6.6 KiB−159 B (−2.3%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded59.3 KiB57.9 KiB−1.4 KiB (−2.4%)66.4 KiB✅
      ClaudeLive turn messages10100 (0.0%)21✅

      Baseline: caa8a0d · PR result: 36318af · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 113.8 KiB
      • Claude decoded thread snapshot: 114.5 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    4. Approvability

      Verdict: Approved at 36318af

      Macroscope's review found this PR approvable — The PR narrowly stabilizes iOS Markdown component identities during streaming, preserving existing text, code, and block views while still remounting when rendering attributes or node types change. The implementation is covered by focused tests and introduces no schema, deployment, security, billing, or product-default changes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Superseded by #11211 (perf(mobile): reuse completed code lines while streaming), which landed the stable Markdown sibling keys (offset:<beg> / index:<i>) plus incremental completed-line highlight reuse on main. Closing this older native-hold PR as wash leftover hygiene.

    6. Closed as superseded by #11211.

    7. juliusmarminge closed this

Sign in to join this conversation.