Skip to content

fix(mobile): support animated refs when opening Android chats - #6

Merged
khoi merged 1 commit into
mainfrom
fix/mobile-animated-ref
Oct 3, 2026
Merged

khoi merged 1 commit into
mainfrom
fix/mobile-animated-ref

Conversation

@khoi

@khoi khoi commented Oct 3, 2026

Copy link
Copy Markdown
Member

Opening an Android chat can throw Object is not a function when keyboard padding changes. The existing keyboard controller calls an animated ref as a function, while Reanimated 4.7 passes an object containing the native node.

Backport the mounted-node guard from the upstream fix, reported by bompus in keyboard-controller#1655. Both callable refs and object refs keep the unmounted-view check.

Verified by reproducing the failure in the Android API 35 development client, installing the patch, and opening the same chat successfully. Executed the patched callback with mounted and unmounted refs in both formats; all four cases passed. vp i applies the patch successfully.

Model: GPT-6-Astra. Harness: Codex.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 13.5 KiB — 15.1 KiB ✅
Codex Thread snapshot wire — 7.1 KiB — 7.3 KiB ✅
Codex Live turn WebSocket wire — 6.5 KiB — 7.8 KiB ✅
Codex Live turn WebSocket decoded — 56.3 KiB — 66.4 KiB ✅
Codex Live turn messages — 10 — 21 ✅
Claude Total thread wire — 13.5 KiB — 15.1 KiB ✅
Claude Thread snapshot wire — 7.1 KiB — 7.3 KiB ✅
Claude Live turn WebSocket wire — 6.4 KiB — 7.8 KiB ✅
Claude Live turn WebSocket decoded — 57.0 KiB — 66.4 KiB ✅
Claude Live turn messages — 8 — 21 ✅

Baseline: unavailable · PR result: 6aa0088 · Source CI: failure

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: 114.0 KiB
  • Claude decoded thread snapshot: 114.7 KiB

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

@khoi
khoi merged commit 79cdb52 into main Oct 3, 2026
21 of 24 checks passed
khoi added a commit that referenced this pull request Oct 3, 2026
Mermaid fences currently appear as source in chat and Markdown previews. Supported fences now render as selectable text diagrams, with source switching and copying. Unsupported, invalid, or oversized inputs keep their source.

The renderer is vendored into a standalone workspace package with no runtime dependencies. Web and desktop lazily render visible, closed fences in a browser worker. Mobile renders completed messages in a dedicated Worklets runtime. Its build produces one self-contained worklet, using the existing Expo/Babel setup. Native output uses ASCII borders so Android font fallback cannot misalign Unicode box characters. The text renderer omits terminal coloring and its extra canvases.

The clients share serialized admission, source deduplication, and a bounded cache. Input, graph, allocation, pathfinding, and cooperative time limits bound rendering work. Unsupported syntax and titles that cannot fit their layout retain source. Browser workers have startup and execution deadlines with replacement after failure. Native Worklets has no termination API and relies on the renderer's deterministic bounds and cooperative deadline. The server still delivers the original Markdown.

Implementation and submission were requested by the repository maintainer in the originating thread. This uses the shared Markdown paths for chat and previews, is provider-independent, and requires no server contract or connection-mode changes. The Android chat prerequisite in #6 has merged; this PR targets `main`.

**Verification:** 272 focused tests passed, including 100 golden fixtures, parser and drawing fidelity, deep-chain layout, bounds, queue/cache behavior, browser recovery, clipboard fallback, native representation switching, and native packaging. Packaging tests execute the actual serialized worklet for both platform Babel configurations, check parity for six diagram types, and exercise rejected inputs and deadlines. Scoped typechecks, targeted lint, and the mobile dependency check passed. The web production build passed with a separate 77,427-byte worker (23,651 bytes gzip). Production exports for iOS and Android produced Hermes bytecode.

An integrated web pass verified rendering, source switching, copying without the Clipboard API, and source fallback. The actual browser worker passed the statement, label, bottom-to-top, sequence-note, and long-title regressions. An installed Android API 35 development client verified cold startup, pairing with isolated server state, flowchart and sequence rendering, horizontal panning, source switching after panning, copy feedback, fallback-source copy/paste, and light/dark appearance. A renderer source edit appeared in the native background runtime through Fast Refresh; reverting it restored the original diagram. Native verification caught and fixed the startup integration, Android copy icon, scroll reset, and border alignment issues.

**iOS simulator execution remains unverified.** The installed Xcode 26.3 fails while compiling ExpoModulesJSI before application code runs. [Expo documents this toolchain incompatibility](expo/expo#49214); the simulator pass needs a newer Xcode. Packaged Electron and Android release APK execution were not tested. Landing checks exposed stale test fixtures left by the existing app-identity change; their WSL paths, branch prefixes, and release URLs now match production. The four affected test files pass locally (108 tests), and their 13 Linux-only cases pass in CI. CI passes the full test suite, lint, typecheck, build, Rust, and release smoke checks.

## Screenshots

Web: rendered sequence diagram and unsupported-input fallback.

![Web diagram view](https://github.com/supabitapp/supa3/releases/download/pr-evidence-mermaid-ascii/mermaid-after.png)

<details>
<summary>Web before: Mermaid source</summary>

![Web source before rendering](https://github.com/supabitapp/supa3/releases/download/pr-evidence-mermaid-ascii/mermaid-before.png)

</details>

Android: selectable ASCII diagrams with horizontal scrolling.

![Android diagram view](https://github.com/supabitapp/supa3/releases/download/pr-evidence-mermaid-ascii/android-mermaid-diagram.png)

<details>
<summary>Android source view</summary>

![Android source view](https://github.com/supabitapp/supa3/releases/download/pr-evidence-mermaid-ascii/android-mermaid-source.png)

</details>

Recordings: [web switching and copying](https://github.com/supabitapp/supa3/releases/download/pr-evidence-mermaid-ascii/mermaid-toggle-and-copy.mp4), [Android switching and copying](https://github.com/supabitapp/supa3/releases/download/pr-evidence-mermaid-ascii/android-mermaid-toggle-copy.mp4).

Model: GPT-6-Astra. Harness: Codex.
@khoi
khoi deleted the fix/mobile-animated-ref branch October 6, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant