Skip to content

Evaluate: text selection + code-copy (upstream #358) — parked, decisions needed #19

Description

@fl4p

Tracking the evaluation of upstream off-grid-ai#358 ("text selection + code copy") for the fork. The merge was resolved and reviewed but parked pending product decisions — this issue records what it is, what's done, and what blocks it.

What off-grid-ai#358 does

  • Enables native text selection in chat messages (long-press + drag, including across paragraphs) and a per-code-block Copy button.
  • Mechanism: swaps the markdown renderer @ronradtke/react-native-markdown-displayreact-native-enriched-markdown (a Fabric / New-Architecture native C renderer), and replaces the message-bubble TouchableOpacity wrapper with View (the TouchableOpacity was intercepting selection gestures).

Evaluation status

The merge onto the fork was resolved cleanly and adversarially reviewed. Resolutions verified correct: dropping the bare react-native-fs re-add (fork uses @dr.pogodin/react-native-fs via shim), taking-ours for ChatScreen (PR's debug-logs drift was unrelated), and the onRemember + text-selection auto-merge. Fixes already applied and staged: setTimeout cleanup leak, removed the now-dead @ronradtke dep, and a jest mock for the native renderer (cleared 31 of 46 broken tests).

The work is staged, uncommitted, not pushed in worktree feat/text-selection-code-copy.

Open decisions (why it's parked)

  1. GFM tables regress vs cross-paragraph selection (the core trade-off).
    react-native-enriched-markdown defaults to flavor="commonmark" = single-TextView → enables the cross-paragraph selection that is the feature's headline, but renders pipe tables as raw | a | b | text. flavor="github" restores tables but is container-based → likely reintroduces the per-block selection boundary the PR set out to remove. Pick one: selection (commonmark) or tables (github).

  2. UX change: long-press no longer opens the action menu.
    ~13 ChatMessage tests fail because they open the Copy/Regenerate/Edit menu via long-press, which Feat/text selection code copy off-grid-ai/OGAM#358 repurposes to text-selection (menu moves to the ••• button). Updating those tests bakes in that behavior change — needs sign-off.

  3. Native rebuild required. The renderer is a Fabric/New-Arch native module → pod install + a fresh iOS/Android build to run at all (JS reload crashes with "unregistered component").

To resume

Decide (1) commonmark-vs-github and (2) whether the long-press→selection UX change is wanted, then finish the ~15 test updates and do a native build to verify. Depends on the onRemember tsc break on main being resolved first (unrelated in-flight feature).

Refs: upstream off-grid-ai#358

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