Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(web): copy a link to a thread #7902

Closedfbehrens(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/7902/headopened View on GitHub

Problem

In a browser, a thread's URL is its link — you can copy it out of the address bar. The desktop app is served from t3code://app and has no address bar, and nothing in the UI exposes a thread's address, so there is no way to get a link to a thread out of desktop at all.

Change

Thread context menus now offer Copy → Link. The sidebar row menu and the chat header menu share one builder, so both surfaces get it.

resolveThreadLink picks the base the same way a user would: the client's own web origin when there is one (browser and hosted app), otherwise the address this client reaches the environment at, which is the T3 server that owns the thread — localhost for a server on this machine, the tunnel host for T3 Connect. When neither is an http(s) origin the item is hidden rather than copying something that cannot be opened.

The link is not a share link: the other device still has to reach that address and be paired with the environment. docs/user/thread-sidebar.md says so explicitly.

Mobile is deliberately untouched — it has no thread copy actions at all, so there is no parity to keep.

Before / after

Sidebar thread context menu, Copy submenu.

BeforeAfter

Verification

  • vp test run apps/web/src/threadLink.test.ts apps/web/src/components/threadActionMenu.logic.test.ts — 14 passed
  • tsgo --noEmit in apps/web — clean
  • Lint on the touched files — clean
  • Screenshots above are from a real client: vp run dev against an isolated .t3 home with seeded fixture threads, driven through a browser

Written by Claude Opus 5 (1M context) in T3 Code.


Note

Low Risk Clipboard and URL construction only; no auth or access-control changes. Links still require environment pairing and network reachability.

Overview Adds Copy → Link to the shared thread action menu (sidebar and chat header) so desktop users can copy a thread URL without an address bar.

resolveThreadLink uses the browser origin when it is http(s); otherwise it falls back to the environment’s HTTP base (localhost or tunnel). The menu item is hidden when neither is a web origin. Links are not public shares—the recipient still needs reachability and pairing.

User docs in thread-sidebar.md describe the behavior. Mobile copy actions are unchanged.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a0657a62fdb813ede2801b0a6528a70b54090905. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

  • Adds buildThreadRoutePath in threadRoutes.ts to build a thread pathname as /{environmentId}/{threadId} with URL-encoded segments.
  • Adds resolveThreadLink and readThreadLink in threadLink.ts to compose a full HTTP(S) URL, preferring window.location.origin and falling back to the environment httpBaseUrl; returns null when no valid origin exists.
  • Registers a new 'copy-link' action with a canCopyLink state flag in buildThreadActionMenuItems (threadActionMenu.logic.ts), wired up in both Sidebar.tsx and useThreadActionMenu.ts using useCopyToClipboard with success/error toasts.
  • Adds a 'link' icon entry in contextMenuFallback.ts and documents the feature in thread-sidebar.md.
  • Risk: the link is only shown when an HTTP(S) origin is resolvable; on non-web runtimes without a valid httpBaseUrl, readThreadLink returns null and the menu item is hidden.
Macroscope summarized a0657a6.
    1. Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: f94e5e75-3e93-4f14-ab3c-05ec60d4131c

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. Approvability

      Verdict: Skipped

      Macroscope did not run approvability analysis for this PR. Macroscope could not determine whether this PR modifies its approvability configuration, so the PR was not approved automatically. A PR that may change the rules that govern approval is never approved automatically.

    4. Note

      This comment is posted by Julius' dot

      This adds a new Copy Link action to the sidebar and chat header, with new URL selection behavior for desktop and remote environments. The PR and discussion contain no explicit maintainer approval for that direction and scope, which the contribution guide requires for new product behavior. The desktop's missing address bar is a useful problem report, and the before/after screenshots show the menu addition. Please discuss the proposed link workflow with maintainers and link their approval before requesting reconsideration.

    5. juliusmarminge closed this

    6. can this be revived? having a way to copy deeplink to a thread is very useful

Sign in to join this conversation.