Skip to content
Source
Sign inSign up
pingdotgg/t3code

[Feature][Mobile] Copy thread ID, branch, and path from thread menus (desktop parity) #12185

ClosedImBIOS(GitHub profile, opens in a new tab) opened this issue 1 comment

Description

The T3 Code mobile app has no visible way to copy a thread's ID, branch, or workspace path, while the desktop/web app does.

Desktop/web exposes a per-thread Copy submenu in both the sidebar row right-click menu and the chat header menu (buildThreadActionMenuItems in apps/web/src/components/threadActionMenu.logic.ts):

  • Copy Path (workspace path, falls back to project cwd)
  • Copy Branch (when the thread has a branch)
  • Copy Thread ID (always)

plus a separate PR-link-or-thread-ID shortcut via resolveThreadReferenceCopyTarget (packages/shared/src/threadReference.ts, wired in ChatView.tsx / command palette).

On mobile (React Native client):

  • Thread row long-press menus (ThreadListRow in apps/mobile/src/features/threads/thread-list-items.tsx, ThreadListV2Row in thread-list-v2-items.tsx) offer only lifecycle/title actions (Archive/Settle/Snooze/Pin/Regenerate/Delete, plus New-thread-on-branch) — no Copy submenu.
  • The only copy path is the hardware-keyboard shortcut in HardwareKeyboardCommandProvider.tsx (copyThreadReference), which is invisible on touch devices.

Expected behavior

  • Add a Copy submenu to the mobile thread row long-press menus (both v1 and v2 lists), mirroring desktop ordering/labels:
    • Path (worktree path, falling back to project workspace root where available; error feedback when unavailable, like desktop's "Path unavailable")
    • Branch (only when the thread has one)
    • Thread ID (always)
  • Use the existing copyTextWithHaptic helper with failure feedback, matching other mobile copy surfaces.
  • Add the missing number SF Symbol Android mapping (Tabler Hash) so the Thread ID row has an icon on Android, as the prior full-parity attempt did.
  • Desktop origin: feat(web) add Copy Thread ID to the sidebar and chat header thread context menu (#5574, merged)
  • Mobile full-parity attempt (included this Copy submenu, closed unmerged as too large): feat(mobile) Bring Thread Menus to Desktop Parity (#5962, closed)
  • SwiftUI-only equivalent (does not cover the React Native client): feat(swift-ios) copy thread metadata from row menus (#8622, merged)
  • Adjacent mobile parity gap: [Bug][Mobile] Archive action is missing from thread actions (#9328, open)
  • Hardware-keyboard-only copy on mobile: apps/mobile/src/features/keyboard/HardwareKeyboardCommandProvider.tsx

Acceptance criteria

  • A mobile user can long-press a thread row and copy its Thread ID.
  • Branch and Path are copyable from the same submenu under the same conditions as desktop.
  • Missing-path and clipboard-failure cases surface an error instead of silently doing nothing.
  • Existing Archive/Delete/Settle/Snooze/Pin/Regenerate behavior does not regress.
  1. Triage

    Valid enhancement. Confirmed on current main (901db8966). The React Native thread-row menus still have no Copy group. Desktop and SwiftUI already do. Not already fixed. Not a duplicate of #9328.

    What you reported. On mobile, a long-press on a thread row cannot copy Thread ID, Branch, or Path. Desktop exposes all three under a per-thread Copy submenu. The only mobile copy path is a hardware-keyboard / command-palette shortcut, which touch users never see.

    That matches the code.

    What the code does

    1. Desktop already has the menu.

    buildThreadActionMenuItems (apps/web/src/components/threadActionMenu.logic.ts) is the single source for the sidebar row right-click menu and the chat header menu. After rename / regenerate / mark-unread it adds:

    • Copy → Path (folder), Branch (git-branch, only when state.branch is set), Thread ID (hash)

    useThreadActionMenu / Sidebar.tsx dispatch those ids:

    • Path copies thread.worktreePath ?? projectCwd. Missing both → error toast Path unavailable.
    • Branch copies thread.branch when present.
    • Thread ID always copies thread.id.

    2. Mobile v1 and v2 long-press menus omit Copy.

    v1 ThreadListRow (apps/mobile/src/features/threads/thread-list-items.tsx): optional New thread on branch, then Archive / Rename / Regenerate title / Delete. No Copy. v1 is still mounted from HomeScreen and ThreadNavigationSidebar when the v2 flag is off.

    v2 ThreadListV2Row (thread-list-v2-items.tsx): lifecycle (Settle / Snooze / Pin / Archive on legacy cards), title actions, Delete. A comment in that file keeps Archive off the default v2 card (“thread screen / settings rather than crowding v2 rows”). Still no Copy.

    handleMenuAction in both files has no copy-* cases.

    3. The only mobile copy path is keyboard / palette, and it is a different action.

    HardwareKeyboardCommandProvider + CommandPalette expose copyThreadReference. That uses resolveThreadReferenceCopyTarget (packages/shared/src/threadReference.ts): PR link if one is open, otherwise Thread ID. It does not copy Path or Branch. It is hidden on phones without a hardware keyboard.

    4. The Android icon gap is real.

    ANDROID_ICON_BY_SF_SYMBOL in apps/mobile/src/components/AppSymbol.tsx has no number key. A Thread ID row that uses the number SF Symbol will have no Tabler fallback on Android. Desktop’s matching icon is hash.

    5. Copy helpers already exist.

    copyTextWithHaptic / tryCopyTextWithHaptic (apps/mobile/src/lib/copyTextWithHaptic.ts) are the shared clipboard + haptic path. copyTextWithHaptic is fire-and-forget and only console.errors a clipboard failure. The keyboard path uses tryCopyTextWithHaptic and surfaces success/failure in the UI. Missing-path should be an explicit error (desktop’s “Path unavailable”), not a silent no-op.

    6. SwiftUI already shipped the equivalent.

    #8622 (feat(swift-ios): copy thread metadata from row menus) added ThreadCopyActions on the native iOS client. That does not cover the React Native lists.

    Not a duplicate

    WorkWhy this is still open
    #5574 (merged)Desktop Copy Thread ID / Copy submenu origin.
    #5962 (closed)Full mobile menu parity, including this Copy group. Closed as too large after upstream covered most other items. This issue is the leftover slice.
    #8622 (merged)SwiftUI-only.
    #8994 (merged)Hardware-keyboard copyThreadReference (PR link or thread ID).
    #9328 (open)Missing Archive on mobile. Adjacent parity gap, different action.
    #7902 (open)Web “copy a link to a thread.” Different surface and payload.

    Suggested smallest scope

    Stay inside the RN thread-row menus. Do not reopen #5962’s full desktop-parity rewrite, and do not add chat-header Copy on mobile in the same change.

    • Shared helper for the Copy submenu: Path, Branch when the thread has one, Thread ID always. Same labels/order as buildThreadActionMenuItems.
    • Wire it into both ThreadListRow and ThreadListV2Row.
    • Path = thread.worktreePath ?? project.workspaceRoot. v1 rows today do not take a project prop (HomeScreen does not pass one), so the fallback needs a small thread-through or the compact list will toast “unavailable” on local-cwd threads. v2 already has props.project.
    • User-visible errors for missing path and failed clipboard writes (tryCopyTextWithHaptic, not only the fire-and-forget wrapper).
    • Map SF Symbol number → Tabler Hash in AppSymbol.tsx.
    • Leave Archive / Settle / Snooze / Pin / Rename / Regenerate / Delete alone.

    Open PR

    #12186 (feat(mobile): add Copy thread ID, branch, and path to thread menus) is the same author and Closes #12185. The mobile slice matches this scope (thread-copy-menu.ts, both lists, number → IconHash).

    Do not review that PR as-is. It is size:L / vouch:unvouched and mixes an unrelated OpenCode OSC/ANSI sanitizer (stripTerminalEscapes.ts, OpenCodeAdapter / OpenCodeProvider / opencodeRuntime, packages/shared/src/model.ts). CONTRIBUTING: do not mix unrelated fixes. That is the same size problem that closed #5962.

    The mobile half also copies v1 Path from thread.worktreePath only (no project-root fallback) and uses copyTextWithHaptic, so clipboard failures stay silent.

    Next step

    Accepted. Small, localized React Native menu change. Keep this issue open until a mobile-only PR lands. Split the OpenCode sanitizer out of #12186 (or open a fresh PR with just the Copy submenu) before review.

  2. juliusmarminge added labelsenhancement

  3. juliusmarminge added labelsaccepted

  4. juliusmarminge added labelsvia-triage

Sign in to join this conversation.