Skip to content

Port selectable Markdown native renderer to Android #3

Description

@HorusGoul

Context

@t3tools/mobile-markdown-text provides the iOS-native selectable Markdown renderer. It is backed by Fabric components T3MarkdownText and T3MarkdownTextRun, with iOS code under apps/mobile/modules/t3-markdown-text/ios.

The package currently disables Android native linking in apps/mobile/modules/t3-markdown-text/react-native.config.js, and the codegen native component excludes Android.

Why this matters

The iOS implementation gives the conversation and file-preview UI selectable rich Markdown while preserving native text behavior. Android currently relies on app-level JS Markdown fallbacks in call sites such as the thread feed and Markdown file preview.

Important behavior to preserve:

  • selectable assistant and user message Markdown
  • links and file-link presentation
  • inline code and code blocks
  • headings, lists, tables, blockquotes, dividers, and images
  • inline file icons and skill chips
  • code block copy affordances
  • native text layout and selection-change events

Feature examples

  • Assistant responses in ThreadFeed should render rich Markdown and remain selectable.
  • User messages with review-comment segments should keep readable Markdown formatting.
  • Markdown file previews should render with native selectable text when available.

Acceptance criteria

  • Add Android support for the Markdown native text primitives or an equivalent Android-native renderer.
  • Match the existing exported renderer contract used by apps/mobile/src/native/SelectableMarkdownText.ios.tsx.
  • Remove the Android exclusion/null behavior once the native implementation is available.
  • Preserve selectable text, link press handling, inline attachment icons, and rich block rendering.
  • Keep JS fallbacks safe for builds where the native view is unavailable.
  • Add targeted tests for shared Markdown transformation logic plus Android-native rendering/selection behavior where practical.

Current test coverage note

There is substantial TypeScript coverage for Markdown transformation/link logic (apps/mobile/src/lib/nativeMarkdownText.test.ts, apps/mobile/src/lib/markdownLinks.test.ts) and widget-level consumers, but I did not find native Objective-C++/UIKit tests for T3MarkdownText itself or Android native tests for a corresponding renderer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions