feat(web): copy a link to a thread #7902
main fromrefs/pull/7902/head·opened View on GitHubProblem#
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.
| Before | After |
|---|---|
![]() | ![]() |
Verification#
vp test run apps/web/src/threadLink.test.ts apps/web/src/components/threadActionMenu.logic.test.ts— 14 passedtsgo --noEmitinapps/web— clean- Lint on the touched files — clean
- Screenshots above are from a real client:
vp run devagainst an isolated.t3home 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.
Note
Add "Copy → Link" thread action in web sidebar and chat header menu#
- Adds
buildThreadRoutePathin threadRoutes.ts to build a thread pathname as/{environmentId}/{threadId}with URL-encoded segments. - Adds
resolveThreadLinkandreadThreadLinkin threadLink.ts to compose a full HTTP(S) URL, preferringwindow.location.originand falling back to the environmenthttpBaseUrl; returnsnullwhen no valid origin exists. - Registers a new
'copy-link'action with acanCopyLinkstate flag inbuildThreadActionMenuItems(threadActionMenu.logic.ts), wired up in both Sidebar.tsx and useThreadActionMenu.ts usinguseCopyToClipboardwith 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,readThreadLinkreturnsnulland the menu item is hidden.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
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.
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.
juliusmarminge closed this
can this be revived? having a way to copy deeplink to a thread is very useful
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
f94e5e75-3e93-4f14-ab3c-05ec60d4131cYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
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