@devries-cameron20 / t3code Mirror · read-only / commits / e5c6083c25
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 22, 22:00 UTC

fix(mobile): thread links long-press to Open thread or Copy link (#22153)

oliver committed Oct 20, 2026 at 00:44 UTC e5c6083c25a1ddd22ceff3fd24507d3da4baa278
1 file changed +27 -6
apps/mobile/src/features/threads/ThreadFeed.tsx
+27 -6
@@ -1788,13 +1788,18 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
1788 const iconSubtleColor = theme["--color-icon-subtle"];
1789 const screenColor = theme["--color-screen"];
1790 const userBubbleColor = theme["--color-user-bubble"];
1791 - const onMarkdownLinkPress = (href: string, imageEmbed = false) => {
1791 + const resolveLinkedThread = (href: string) => {
1792 const linkedThreadId = parseThreadLinkHref(href);
1793 - if (linkedThreadId) {
1794 - const source = scopeThreadRef(props.environmentId, linkedThreadId);
1795 - const target =
1796 - resolveThreadLinkRef(source, appAtomRegistry.get(environmentThreadShells.threadRefsAtom)) ??
1797 - source;
1793 + if (!linkedThreadId) return null;
1794 + const source = scopeThreadRef(props.environmentId, linkedThreadId);
1795 + return (
1796 + resolveThreadLinkRef(source, appAtomRegistry.get(environmentThreadShells.threadRefsAtom)) ??
1797 + source
1798 + );
1799 + };
1800 + const onMarkdownLinkPress = (href: string, imageEmbed = false) => {
1801 + const target = resolveLinkedThread(href);
1802 + if (target) {
1803 navigation.navigate("Thread", {
1804 environmentId: String(target.environmentId),
1805 threadId: String(target.threadId),
@@ -1863,10 +1868,26 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
1868 onImagePress: (href) => onMarkdownLinkPress(href, true),
1869 resolveImageSource,
1870 fileContextMenu: (href) => {
1871 + const thread = resolveLinkedThread(href);
1872 + if (thread) {
1873 + return {
1874 + title:
1875 + appAtomRegistry.get(environmentThreadShells.threadShellAtom(thread))?.title ?? "Thread",
1876 + actions: [
1877 + { id: "open-thread", title: "Open thread" },
1878 + { id: "copy-thread-link", title: "Copy link" },
1879 + ],
1880 + };
1881 + }
1882 const target = resolveFileChipTarget(href, props.workspaceRoot);
1883 return target ? fileChipMenu(target) : undefined;
1884 },
1885 onFileContextMenuAction: (href, actionId) => {
1886 + if (resolveLinkedThread(href)) {
1887 + if (actionId === "open-thread") onMarkdownLinkPress(href);
1888 + else if (actionId === "copy-thread-link") copyTextWithHaptic(href);
1889 + return;
1890 + }
1891 const target = resolveFileChipTarget(href, props.workspaceRoot);
1892 if (!target) return;
1893 switch (actionId) {