Repository navigation
feat(mobile): prototype Enriched Markdown as the sole renderer - #12781
juliusmarminge wants to merge 11 commits into
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
Thanks for working on this. We merged the orchestrator V2 rewrite in #2829, and we are closing this PR as part of that transition. The patch conflicts with the rewrite in apps/mobile/src/features/threads/ThreadFeed.tsx. Even where the conflict is small enough to rebase, we are asking for fresh PRs against the new base so we can review and verify the behavior in V2. Sorry for the extra work this creates. If the change is still needed on V2, please rebuild it on current main, verify it there, and open a new PR linking back here. We're closing the current implementation without assuming the underlying request is resolved. |
September 24 upstream compatibility integration
Consumer 5b6a1441 carries core 7781ab17 and tint 0eca6691. The new archive includes upstream paragraph minimum-line-height behavior for tall inline code, pill baseline centering and shared Android background geometry/spoiler concealment, alongside inherited upstream fixes. Public nested pill API and T3 integration are unchanged. Font #861 is now merged; core/tint remain open. The combined integration commit is local
105fd60e2c57dfec0370ccef577c253ac9d3ec7f, retaining contributor credit.Unique
main-compat-v1.tgzcontains 926 files/1,033,101 bytes, SHA25659ba5df5492476181ecbe1ba573a1c163c4da3eaeea0431f30ed5ea235876319. Exact upstream geometry/background shipping sources were checked byte for byte. Original shipping Gradle configuration is retained. Combined 93 JS tests/14 suites, types, Bob modules/declarations/both native codegens, normal commit hooks, frozen Linux/Mac installs and mobile types pass.The official iOS ensure rebuilt and installed this exact archive on iPhone 17 Pro/iOS 26.5, fingerprint
c6809326ed4555205bcbb19db0319156b120257c. The successful retry used the previously documented host-only explicit-module/debug-symbol resource settings. An initial iOS attempt failed on disk exhaustion and supplies no proof. Authorized cleanup removed disposable download caches and stale prototype dependency caches while retaining the active package. Android's full consumer development APK passed on this exact archive, 1301 tasks; its initial attempt stopped on full Linux tmpfs before native compilation, corrected by relocating this task's Gradle cache to the main disk.Personally inspected temporary style probes with 34px inline code and paragraph/list/quote line-height floors of 18px and 44px, below and above the pill height. Wrapped code glyphs and one pill per original link remain visible without observed overlap; the following ordinary list row stays separate. These are visual combined-consumer probes, not strict U+FFFC reference assertions. The shipping wrapper was restored byte-identical and fully reloaded afterward.
Restored shipping proof includes actual AX visible/original file and skill names, genuine discovered skill metadata, original
$mobile-checkclipboard, exact relative/full file clipboard, correct source-file routing, native root/quote/nested-quote/quoted-table menus and nonlink quoted-table Copy as Markdown retaining its original label and URL. An accessibility-reference long press landed on adjacent nonlink quote text; screenshot-guided presses on the actual pill verified the configured menus. The nonlink quote also retained its original link on Markdown copy. No native behavior patch was needed during this validation. No new media playback or Android device UI claim is made.Current consumer REST metadata/target/configuration checks pass; no current-head full consumer CI or human review is claimed. Earlier captures below remain tied to their documented prior sources. Native pill XCTest and strict U+FFFC reference geometry are unwired/unrun; no VoiceOver traversal, Android UI or isolated-upstream-head device assertion.
Mobile Markdown now uses Enriched as its only renderer. This removes the custom Markdown parser/render tree and the Nitro Markdown dependency, while keeping T3 file routing, context metadata, asset authorization, previews and playback in the mobile app.
This is a prototype for discussing the generic integration APIs with the Enriched team. The prepared Enriched package is committed as a local 1 MB tarball in
apps/mobile/deps, replacing the 9,761-line pnpm patch. The original 909-file archive matched the previously verified patch byte for byte. The current 917-file archive includes the reviewed nested pill API, accessibility/metrics/cache fixes and the opt-in link-menu API; changed shipping sources match the verified combined prototype. Generic native dependency extensions are reviewable in the upstream PRs below; they contain no T3 routing, context records, branded icons, authentication or media player code. The archive includes source, built JS/types, generated native bindings and the MIT license, with its usual postinstall behavior intact. The package note explains inspection and replacement. This uses the samedepsdirectory previously used by Nitro Markdown.Integration APIs
markdownStyle.linkVariants, extended with font and nestedpillboolean/configuration for geometry, presentation label, local icon URI and optional tintlinkRegexandinlineCodeLinkRegex, sharing the input API's regex normalizationonDocumentAssets({ revision, assets })linkContextMenus, keyed by original URL with title, text, icon, disabled/destructive state and JS callbacksonLinkLongPressremains the fallback elsewhere.renderMedia(asset)resolveImageSource(asset)returning a URI and headers, synchronously or asynchronouslyExisting
onLinkPress,onLinkLongPressandonImagePressremain the integration points for routing, fallback link menus and media previews. Configured native link menus take precedence overonLinkLongPresson iOS 17+. The packaged library handles measurement, selection and generic presentation. The app handles product actions. The remainingt3-source-textmodule provides only selectable source documents on iOS, with React Native Text on Android. Shared link/chip helpers and icons now live in the app, and Android’s composer chip lives int3-composer-editor. Unused native pill/menu/copy machinery fromt3-markdown-texthas been removed.Upstream work
Separate agents prepared focused upstream PRs using existing library conventions. The font/pill/tint layers preserve Ernest's font cleanup and example; upper layers link their dependencies and layer-only comparisons. The current consumer archive integrates core 3ba9ea74 and tint e3e7b18e, including maintainer font feedb0b0.
These statuses were refreshed September 23, 2026. Closed proposals remain prototype-only extensions in the archive; they are not represented as accepted upstream APIs or refiled. Existing hourly review/CI follow-up continues for open PRs and settles owning threads once their PRs are merged or closed. Nothing is being merged by this prototype task.
September 23 verification and limits
Current consumer cf0dc9b3 migrates the app's single variant hook to nested
pillconfiguration and replaces the prepared dependency archive. Combined generic source is committed locally as0f05b38e7fc788e0f1282d7ed75fed545032414d; no combined branch was published on the fork. Archivepill-review-v2.tgzis 1,025,248 bytes/917 files, SHA256569ae48ad0efd93946a9ed5726f98228bcfdf7554418639e3a4f1bb191ec9f53. Its 681 production source files match the committed combined source byte for byte, excluding the combined worktree's local Android unit-test Gradle harness. Existing shipping Gradle configuration is retained.Passed: 88 combined-library JS tests/13 suites, library types, Bob modules/declarations, both native code generators, normal library commit hooks, frozen installation and grammar restoration on Linux and Mac, mobile typecheck, scoped lint, 19 focused app tests, release smoke and normal consumer commit hooks. The full Android development APK compiles the new native resolver/cache/accessibility/renderer sources. That build used the immediately preceding archive revision; the final archive changes only an iOS header import order, so all compiled Android/JS sources are byte-identical. The Android Device panel still fails to boot its emulator; there is no Android UI proof.
The official native-client ensure rebuilt and installed the final archive on iPhone 17 Pro/iOS 26.5, fingerprint
8df81c7cdd3c7f4f179c23194c324d409120e471. The first build failed because the Mac ran out of disk. After authorized disposable-cache cleanup, the successful retry used host-onlyXCODE_XCCONFIG_FILEsettings disabling explicit Clang/Swift modules and debug-symbol generation to reduce temporary disk use; development behavior and repository build configuration were unchanged.Personally inspected the restored shipping wrapper: one visual pill per link in root text, inline code, quotes/nested quotes and tables/quoted tables; local icons and GitHub tint; actual accessibility nodes include shortened file label plus original path and
Mobile Check, $mobile-check. Verified original skill-token clipboard, relative/full file-path clipboard, file routing, native anchored root/quote/table menus, and nonlink quoted-table Copy as Markdown preserving the original link destination. Temporary known-skill-input and publicpill:falseprobes were restored byte for byte; final shipping captures use real discovered skill metadata. Signed native list/table/linked images, SVG and video previews render. No new end-to-end video playback claim is made. A dropped task SSH tunnel was restored and backend reachability confirmed before the final healthy capture.These are combined-consumer results. Phone-width rendering was inspected visually; the strict single-U+FFFC reference geometry tests were not executed. No claim is made that every resource URI/cache-pressure branch was exercised.
Current-head REST checks were refreshed after verification: metadata/target/configuration checks pass, CodeRabbit skips this draft, and the main consumer CI run is not observed. No current-head full-CI or human-review pass is claimed. Shared GraphQL quota was exhausted, so older-thread resolution was not independently verified. Preceding consumer 703927c1 passed 14 checks with 4 skipped; that does not establish current-head CI. Upstream core/tint native iOS and Android build jobs pass, but core still has the preceding CHANGES_REQUESTED review and needs maintainer rereview. Native XCTest sources remain unwired/unrun and native test-lane wiring is maintainer-owned. No isolated-upstream-head device proof, VoiceOver traversal, older-iOS/macOS runtime, library example or Maestro pass is claimed. This consumer PR remains a draft.
React media slots support standalone direct media at the root and recursively inside quotes. Inline/list/table/linked images retain native rendering and use the source resolver for signed access. Native decoding does not add SVG/video support in those placements. Occurrence IDs survive ordinary trailing appends; arbitrary edits and reference reclassification may renumber them. Asynchronous decisions are guarded by document identity, revision and width.
Known clipboard limits remain: linked-image Copy as Markdown loses its enclosing link, and the pill-spanning fixture omitted emphasis markers inferred from font traits. Original file destinations, skill tokens and link URLs were preserved. Android keeps its app-owned fallback link menu; the generic anchored native menu API is iOS 17+.
September 23 reviewed-pill consumer proof
Root native menu and relative-path copy: https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/e3831edb1a867683/t3-enriched-pill-review-actions-relative.mp4
File pill tap opens the source viewer: https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/3a39bc5f58b99b3c/t3-enriched-pill-review-actions-routing.mp4
Initial renderer comparison
These captures use the same original fixture and viewport, before the expanded pills/media fixture was added.
Before, custom renderer:
After, initial Enriched replacement:
Earlier combined media example
Final combined iOS native client, fingerprint
04fe792ea85df13a3fab2f2b9a3c91596ebfc860:Final combined iOS SVG and two-video playback recording
Earlier pill proof
Combined consumer iOS fingerprint
04fe792ea85df13a3fab2f2b9a3c91596ebfc860, including the final ordinary-text glyph optimization. This is app integration proof, not isolated upstream-head proof.Final file-pill routing and long-press action recording
Source-only module after cleanup
The iOS clipboard exactly matched the original six-line source fixture. This evidence uses the combined consumer build after the module cleanup, not an isolated upstream head.
Earlier anchored native link-menu proof
Before, the Enriched prototype's JS action sheet:
After, native anchored menu with JS actions, final combined iOS fingerprint
8e87eff1da695f5c12f0e666884a623725704e4d:Native menu relative-path copying and file-viewer navigation
Temporary quoted-table fixture on the same native client: