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 21, 07:15 UTC
feat(mobile): share a thread with a guest from the mobile app (#29391)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: maria-rcks <maria@kuuro.net> Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com>
Jake Leventhal committed
Nov 18, 2026 at 19:24 UTC
b4239c4b231a90866b98bb49af1eb4e140462868
24 files changed
+753
-4
apps/mobile/src/Stack.tsx
+5
@@ -68,6 +68,7 @@ import { GitConfirmSheet } from "./features/threads/git/GitConfirmSheet";
68
import { GitOverviewSheet } from "./features/threads/git/GitOverviewSheet";
69
import { ThreadPullRequestsSheet } from "./features/threads/ThreadPullRequestsSheet";
70
import { ThreadAgentsSheet } from "./features/threads/ThreadAgentsSheet";
71
+import { ThreadGuestShareSheet } from "./features/threads/ThreadGuestShareSheet";
72
import { ThreadBackgroundWorkSheet } from "./features/threads/ThreadBackgroundWorkSheet";
73
import { ThreadQueueSheet } from "./features/threads/ThreadQueueControl";
74
import {
@@ -777,6 +778,10 @@ const RootStackConfig = createWorkspaceStackNavigator({
778
screen: ThreadAgentsSheet,
779
options: sheetRoute({ detent: 0.5, androidMaxDetent: 0.9 }),
780
}),
781
+ ThreadGuestShare: createNativeStackScreen({
782
+ screen: ThreadGuestShareSheet,
783
+ options: sheetRoute({ detent: 0.5 }),
784
+ }),
785
GitOverview: createNativeStackScreen({
786
screen: GitOverviewSheet,
787
linking: `${THREAD_LINKING_PREFIX}/git`,
apps/mobile/src/features/keyboard/CommandPalette.tsx
+12
@@ -54,6 +54,7 @@ import {
54
} from "../../state/entities";
55
import { useThreadSearch } from "../../state/queries";
56
import { requestThreadMessageJump } from "../threads/threadMessageJump";
57
+import { useCanShareWithGuest } from "../threads/useCanShareWithGuest";
58
import { threadEnvironment } from "../../state/threads";
59
import { useAtomCommand } from "../../state/use-atom-command";
60
import { serverEnvironment } from "../../state/server";
@@ -290,6 +291,7 @@ export function CommandPalette(props: {
291
useAtomValue(serverEnvironment.prepareTriage.permissionAtom(triageEnvironmentId)) &&
292
triageEnvironmentId !== null &&
293
serverConfigs.get(triageEnvironmentId)?.environment.capabilities.triage === true;
294
+ const canShareWithGuest = useCanShareWithGuest(activeThreadRef?.environmentId ?? null);
295
const contentMatchByKey = new Map(
296
search.matches
297
.filter((match) => match.source === "user" || match.source === "assistant")
@@ -411,6 +413,15 @@ export function CommandPalette(props: {
413
run: () => runCommand(command),
414
})),
415
);
416
+ if (canShareWithGuest) {
417
+ actions.push({
418
+ key: "shareWithGuest",
419
+ kind: "action",
420
+ title: gt("Share with guest"),
421
+ searchTerms: ["share", "guest", "invite", "link", "teammate"],
422
+ run: () => navigation.navigate("ThreadGuestShare", activeThreadRef),
423
+ });
424
+ }
425
}
426
const openProjects = projects.filter((project) => project.archivedAt == null);
427
const projectItems: CommandPaletteItem[] = [
@@ -488,6 +499,7 @@ export function CommandPalette(props: {
499
activeThreadRef,
500
environments.length,
501
canTriage,
502
+ canShareWithGuest,
503
navigation,
504
projects,
505
runCommand,
apps/mobile/src/features/layout/workspace-overlay-routes.ts
+1
@@ -29,6 +29,7 @@ const LISTED_OVERLAY_ROUTES: ReadonlySet<string> = new Set([
29
"SettingsWaitlist",
30
"ThreadAgents",
31
"ThreadBackgroundWork",
32
+ "ThreadGuestShare",
33
"ThreadPullRequests",
34
"ThreadQueue",
35
"ThreadReviewComment",
apps/mobile/src/features/threads/ThreadGuestShareBar.tsx
+2
-2
@@ -57,8 +57,8 @@ function alertOnFailure(failureTitle: string, result: AtomCommandResult<unknown,
57
58
/**
59
* Owner controls for a guest link, above the composer: who the link is for and a way to stop
60
- * sharing. Links are created on web. Waiting messages show in the feed, see
61
- * `ThreadGuestPendingMessage`.
60
+ * sharing. Links are created from the thread's menu, see `ThreadGuestShareSheet`. Waiting
61
+ * messages show in the feed, see `ThreadGuestPendingMessage`.
62
*/
63
export function ThreadGuestShareBar(props: {
64
readonly threadRef: ScopedThreadRef | null;
apps/mobile/src/features/threads/ThreadGuestShareSheet.test.tsx
new
+190
@@ -0,0 +1,190 @@
1
+import { EnvironmentId, GuestShareId, ThreadId, type ThreadGuestShare } from "@t3tools/contracts";
2
+import * as DateTime from "effect/DateTime";
3
+import { act, type ReactNode } from "react";
4
+import { createRoot } from "react-dom/client";
5
+import { expect, it, vi } from "vite-plus/test";
6
+
7
+const { Slot, sharing, created } = vi.hoisted(() => ({
8
+ Slot: ({ children }: { children?: ReactNode }) => children,
9
+ created: {
10
+ share: undefined as ThreadGuestShare | null | undefined,
11
+ updatedAt: "1970-01-01T00:00:00.000Z",
12
+ command: vi.fn(),
13
+ },
14
+ sharing: { messages: [] as Array<{ status: "pending" | "dismissed" }> },
15
+}));
16
+
17
+vi.mock("react-native", () => ({
18
+ Platform: { OS: "ios" },
19
+ ScrollView: Slot,
20
+ View: Slot,
21
+ Share: {},
22
+}));
23
+vi.mock("@react-navigation/native", () => ({
24
+ useNavigation: () => ({ goBack: () => {} }),
25
+ usePreventRemove: () => {},
26
+}));
27
+vi.mock("react-native-safe-area-context", () => ({ useSafeAreaInsets: () => ({ bottom: 0 }) }));
28
+vi.mock("@effect/atom-react", () => ({
29
+ useAtomValue: (atom: { value: unknown }, select?: (value: unknown) => unknown) =>
30
+ select
31
+ ? select(atom.value)
32
+ : atom.value === "thread"
33
+ ? { projection: { thread: { updatedAt: DateTime.makeUnsafe(created.updatedAt) } } }
34
+ : atom.value,
35
+}));
36
+vi.mock("../../state/server", () => ({
37
+ serverEnvironment: { createGuestShare: { permissionAtom: () => ({ value: true }) } },
38
+ environmentServerConfigsAtom: {},
39
+}));
40
+vi.mock("../../state/threads", () => ({
41
+ environmentThreadDetails: {
42
+ threadAtom: () => ({ value: "thread" }),
43
+ statusAtom: () => ({ value: "ready" }),
44
+ errorAtom: () => ({ value: null }),
45
+ },
46
+}));
47
+vi.mock("../../state/use-atom-command", () => ({ useAtomCommand: () => created.command }));
48
+vi.mock("./ThreadGuestShareBar", () => ({
49
+ useThreadGuestShare: () =>
50
+ created.share !== undefined
51
+ ? created.share
52
+ : {
53
+ guestName: null,
54
+ expiresAt: "1970-01-01T00:00:01.000Z",
55
+ messages: sharing.messages,
56
+ },
57
+}));
58
+vi.mock("../../components/ui/AppText", () => ({ AppText: Slot }));
59
+vi.mock("../../components/ui/Button", () => ({
60
+ Button: ({
61
+ label,
62
+ disabled,
63
+ onPress,
64
+ }: {
65
+ label: string;
66
+ disabled?: boolean;
67
+ onPress?: () => void;
68
+ }) => (
69
+ <button disabled={disabled} onClick={onPress}>
70
+ {label}
71
+ </button>
72
+ ),
73
+}));
74
+vi.mock("../../components/ui/AppSymbol", () => ({ SymbolView: () => null }));
75
+vi.mock("../../components/ui/AppBar", () => ({ AppBar: () => null }));
76
+vi.mock("../../components/ui/SheetHeader", () => ({ SheetHeader: () => null }));
77
+vi.mock("../../components/ui/ScreenContent", () => ({ ScreenContent: Slot }));
78
+vi.mock("../../components/ui/Dialog", () => ({}));
79
+vi.mock("../../native/StackHeader", () => ({ NativeStackScreenOptions: () => null }));
80
+vi.mock("../../lib/copyTextWithHaptic", () => ({ tryCopyTextWithHaptic: () => true }));
81
+
82
+import { ThreadGuestShareSheet } from "./ThreadGuestShareSheet";
83
+
84
+it("stops treating a retained guest link as active when it expires", async () => {
85
+ sharing.messages = [];
86
+ created.share = undefined;
87
+ vi.useFakeTimers();
88
+ vi.setSystemTime(0);
89
+ vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);
90
+ const container = document.createElement("div");
91
+ const root = createRoot(container);
92
+ const renderSheet = () =>
93
+ root.render(
94
+ <ThreadGuestShareSheet
95
+ route={{
96
+ params: {
97
+ environmentId: EnvironmentId.make("test"),
98
+ threadId: ThreadId.make("thread"),
99
+ },
100
+ }}
101
+ />,
102
+ );
103
+ try {
104
+ await act(renderSheet);
105
+ expect(container.textContent).toContain("A guest link is active.");
106
+ expect(container.querySelector("button")?.textContent).toBe("Create new link");
107
+
108
+ await act(() => vi.advanceTimersByTimeAsync(1000));
109
+
110
+ expect(container.textContent).not.toContain("A guest link is active.");
111
+ expect(container.querySelector("button")?.textContent).toBe("Create link");
112
+ sharing.messages = [{ status: "pending" }];
113
+ await act(renderSheet);
114
+ expect(container.querySelector("button")?.disabled).toBe(true);
115
+ expect(container.textContent).toContain("Send or dismiss pending guest messages");
116
+
117
+ sharing.messages = [{ status: "dismissed" }];
118
+ await act(renderSheet);
119
+ expect(container.querySelector("button")?.disabled).toBe(false);
120
+ } finally {
121
+ act(() => root.unmount());
122
+ vi.useRealTimers();
123
+ vi.unstubAllGlobals();
124
+ }
125
+});
126
+
127
+it.each(["expired", "stopped", "replaced", "redeemed"] as const)(
128
+ "hides a created link after it is %s, while keeping it through projection catch-up",
129
+ async (change) => {
130
+ created.share = undefined;
131
+ created.updatedAt = "1970-01-01T00:00:00.000Z";
132
+ sharing.messages = [];
133
+ const share: ThreadGuestShare = {
134
+ id: GuestShareId.make("created"),
135
+ host: "env.t3.test",
136
+ createdAt: "1970-01-01T00:00:00.100Z",
137
+ expiresAt: "1970-01-01T00:00:01.000Z",
138
+ guestName: null,
139
+ messages: [],
140
+ };
141
+ const url = "https://env.t3.test/guest#invite";
142
+ created.command.mockResolvedValue({ _tag: "Success", value: { url, share } });
143
+ vi.useFakeTimers();
144
+ vi.setSystemTime(0);
145
+ vi.stubGlobal("IS_REACT_ACT_ENVIRONMENT", true);
146
+ const container = document.createElement("div");
147
+ const root = createRoot(container);
148
+ const renderSheet = () =>
149
+ root.render(
150
+ <ThreadGuestShareSheet
151
+ route={{
152
+ params: {
153
+ environmentId: EnvironmentId.make("test"),
154
+ threadId: ThreadId.make("thread"),
155
+ },
156
+ }}
157
+ />,
158
+ );
159
+ try {
160
+ await act(renderSheet);
161
+ await act(async () => container.querySelector("button")!.click());
162
+ expect(container.textContent).toContain(url);
163
+ created.share = share;
164
+ created.updatedAt = share.createdAt;
165
+ await act(renderSheet);
166
+ expect(container.textContent).toContain(url);
167
+ expect(container.textContent).toContain("Copy");
168
+ if (change === "expired") {
169
+ await act(() => vi.advanceTimersByTimeAsync(1000));
170
+ } else {
171
+ created.updatedAt = "1970-01-01T00:00:00.200Z";
172
+ created.share =
173
+ change === "redeemed"
174
+ ? { ...share, guestName: "Sam" }
175
+ : { ...share, id: GuestShareId.make("other") };
176
+ if (change === "stopped") created.share = null;
177
+ await act(renderSheet);
178
+ }
179
+ expect(container.textContent).not.toContain(url);
180
+ expect(container.textContent).not.toContain("Copy");
181
+ expect(container.textContent).not.toContain("Share");
182
+ } finally {
183
+ act(() => root.unmount());
184
+ vi.useRealTimers();
185
+ vi.unstubAllGlobals();
186
+ created.command.mockReset();
187
+ created.share = undefined;
188
+ }
189
+ },
190
+);
apps/mobile/src/features/threads/ThreadGuestShareSheet.tsx
new
+265
@@ -0,0 +1,265 @@
1
+import { useAtomValue } from "@effect/atom-react";
2
+import { useNavigation, usePreventRemove, type StaticScreenProps } from "@react-navigation/native";
3
+import { scopeThreadRef } from "@t3tools/client-runtime/environment";
4
+import {
5
+ isAtomCommandInterrupted,
6
+ squashAtomCommandFailure,
7
+} from "@t3tools/client-runtime/state/runtime";
8
+import type { EnvironmentId, ThreadGuestShare, ThreadId } from "@t3tools/contracts";
9
+import { msg, T, useGT, useMessages } from "gt-react-native";
10
+import * as DateTime from "effect/DateTime";
11
+import { useMemo, useState } from "react";
12
+import { Platform, ScrollView, Share, View } from "react-native";
13
+import { useSafeAreaInsets } from "react-native-safe-area-context";
14
+
15
+import { AppBar } from "../../components/ui/AppBar";
16
+import { SymbolView } from "../../components/ui/AppSymbol";
17
+import { AppText as Text } from "../../components/ui/AppText";
18
+import { Button } from "../../components/ui/Button";
19
+import * as Dialog from "../../components/ui/Dialog";
20
+import { ScreenContent } from "../../components/ui/ScreenContent";
21
+import { SheetHeader } from "../../components/ui/SheetHeader";
22
+import { useDeadlinePassed } from "../../lib/clock";
23
+import { tryCopyTextWithHaptic } from "../../lib/copyTextWithHaptic";
24
+import { NativeStackScreenOptions } from "../../native/StackHeader";
25
+import { serverEnvironment } from "../../state/server";
26
+import { environmentThreadDetails } from "../../state/threads";
27
+import { useAtomCommand } from "../../state/use-atom-command";
28
+import { useThreadGuestShare } from "./ThreadGuestShareBar";
29
+
30
+const TITLE = msg("Share with guest");
31
+const COPY_FEEDBACK_DURATION_MS = 1200;
32
+const PENDING_MESSAGES_NOTICE = msg(
33
+ "Send or dismiss pending guest messages in the thread before creating a new link.",
34
+);
35
+
36
+type CreateState =
37
+ | { readonly status: "idle" }
38
+ | { readonly status: "creating" }
39
+ | { readonly status: "created"; readonly url: string; readonly share: ThreadGuestShare }
40
+ | { readonly status: "failed"; readonly message: string };
41
+
42
+type GuestShareTarget = { readonly environmentId: EnvironmentId; readonly threadId: ThreadId };
43
+
44
+export function ThreadGuestShareSheet({ route }: StaticScreenProps<GuestShareTarget>) {
45
+ const gt = useGT();
46
+ const m = useMessages();
47
+ const navigation = useNavigation();
48
+ const insets = useSafeAreaInsets();
49
+ const { environmentId, threadId } = route.params;
50
+ const threadRef = useMemo(
51
+ () => scopeThreadRef(environmentId, threadId),
52
+ [environmentId, threadId],
53
+ );
54
+ const guestShare = useThreadGuestShare(threadRef);
55
+ const shareExpired = useDeadlinePassed(
56
+ guestShare === null ? null : Date.parse(guestShare.expiresAt),
57
+ );
58
+ const activeShare = shareExpired ? null : guestShare;
59
+ const hasPendingMessages =
60
+ guestShare?.messages.some((message) => message.status === "pending") ?? false;
61
+ // From the thread list the detail loads only now; until it does, an active link is unknown and a
62
+ // new link would end it without the warning.
63
+ const thread = useAtomValue(environmentThreadDetails.threadAtom(threadRef));
64
+ const threadLoaded = thread !== null;
65
+ const threadDeleted = useAtomValue(
66
+ environmentThreadDetails.statusAtom(threadRef),
67
+ (status) => status === "deleted",
68
+ );
69
+ const threadLoadError = useAtomValue(environmentThreadDetails.errorAtom(threadRef));
70
+ const canCreate = useAtomValue(serverEnvironment.createGuestShare.permissionAtom(environmentId));
71
+ const createGuestShare = useAtomCommand(serverEnvironment.createGuestShare, {
72
+ reportFailure: false,
73
+ });
74
+ const [state, setState] = useState<CreateState>({ status: "idle" });
75
+ const [copiedAtMs, setCopiedAtMs] = useState<number | null>(null);
76
+ const copyFeedbackEnded = useDeadlinePassed(
77
+ copiedAtMs === null ? null : copiedAtMs + COPY_FEEDBACK_DURATION_MS,
78
+ );
79
+ const copied = copiedAtMs !== null && !copyFeedbackEnded;
80
+ const creating = state.status === "creating";
81
+ const close = () => navigation.goBack();
82
+ // The link is shown only once, so any dismiss mid-request (swipe, header, Android back) would lose it.
83
+ usePreventRemove(creating, () => {});
84
+
85
+ const create = async () => {
86
+ if (hasPendingMessages) {
87
+ Dialog.alert(gt("Guest messages are waiting"), m(PENDING_MESSAGES_NOTICE));
88
+ return;
89
+ }
90
+ setState({ status: "creating" });
91
+ const result = await createGuestShare({ environmentId, input: { threadId } });
92
+ if (result._tag === "Success") {
93
+ setState({ status: "created", url: result.value.url, share: result.value.share });
94
+ return;
95
+ }
96
+ if (isAtomCommandInterrupted(result)) {
97
+ setState({ status: "idle" });
98
+ return;
99
+ }
100
+ const error = squashAtomCommandFailure(result);
101
+ setState({
102
+ status: "failed",
103
+ message: error instanceof Error ? error.message : gt("Could not create a guest link."),
104
+ });
105
+ };
106
+
107
+ const copy = async (url: string) => {
108
+ if (!(await tryCopyTextWithHaptic(url, { target: "guest link" }))) {
109
+ Dialog.alert(gt("Could not copy"), gt("Try again."));
110
+ return;
111
+ }
112
+ setCopiedAtMs(Date.now());
113
+ };
114
+
115
+ const share = (url: string) => {
116
+ // Android ignores `url`; iOS turns a `message` URL into plain text instead of a link preview.
117
+ Share.share(Platform.OS === "ios" ? { url } : { message: url }).catch((cause: unknown) => {
118
+ console.error("Failed to share guest link.", cause);
119
+ Dialog.alert(gt("Could not share the link"), gt("Copy it instead."));
120
+ });
121
+ };
122
+
123
+ const createdShareExpired = useDeadlinePassed(
124
+ state.status === "created" ? Date.parse(state.share.expiresAt) : null,
125
+ );
126
+ const createdLink =
127
+ state.status === "created" &&
128
+ !createdShareExpired &&
129
+ !threadDeleted &&
130
+ (thread === null ||
131
+ DateTime.toEpochMillis(thread.projection.thread.updatedAt) <
132
+ Date.parse(state.share.createdAt) ||
133
+ (activeShare?.id === state.share.id && activeShare.guestName === null))
134
+ ? state
135
+ : null;
136
+
137
+ const content = (
138
+ <ScrollView
139
+ nestedScrollEnabled
140
+ className="flex-1"
141
+ contentInsetAdjustmentBehavior={Platform.OS === "ios" ? "automatic" : "never"}
142
+ contentContainerClassName="gap-5 px-5 pt-4"
143
+ contentContainerStyle={{ paddingBottom: Math.max(insets.bottom, 16) + 8 }}
144
+ >
145
+ {createdLink !== null ? (
146
+ <>
147
+ <View className="gap-2">
148
+ <View className="rounded-2xl border border-input-border bg-input px-3.5 py-3">
149
+ <Text selectable numberOfLines={3} className="text-sm text-foreground">
150
+ {createdLink.url}
151
+ </Text>
152
+ </View>
153
+ <Text className="px-1 text-xs text-foreground-muted">
154
+ <T>Send it to one person. It works once and expires in 24 hours.</T>
155
+ </Text>
156
+ </View>
157
+ <View className="flex-row gap-3">
158
+ <View className="flex-1">
159
+ <Button
160
+ label={copied ? gt("Copied") : gt("Copy")}
161
+ icon={copied ? "checkmark" : "doc.on.doc"}
162
+ fullWidth
163
+ onPress={() => void copy(createdLink.url)}
164
+ />
165
+ </View>
166
+ <View className="flex-1">
167
+ <Button
168
+ label={gt("Share")}
169
+ icon="square.and.arrow.up"
170
+ tone="primary"
171
+ fullWidth
172
+ onPress={() => share(createdLink.url)}
173
+ />
174
+ </View>
175
+ </View>
176
+ </>
177
+ ) : (
178
+ <>
179
+ <View className="flex-row gap-3">
180
+ <View className="size-10 items-center justify-center rounded-full border border-border bg-card">
181
+ <SymbolView
182
+ name="person.badge.plus"
183
+ size={18}
184
+ tintColorClassName="accent-foreground"
185
+ />
186
+ </View>
187
+ <Text className="min-w-0 flex-1 text-sm leading-normal text-foreground-secondary">
188
+ <T>
189
+ The guest sees the thread as you do, including command output and the agent's
190
+ reasoning. Each message they send waits for you.
191
+ </T>
192
+ </Text>
193
+ </View>
194
+ <View className="gap-1.5">
195
+ {!threadLoaded ? (
196
+ <Text className="text-sm text-foreground-muted">
197
+ {threadDeleted
198
+ ? gt("This thread was deleted.")
199
+ : (threadLoadError ?? gt("Checking for an active link…"))}
200
+ </Text>
201
+ ) : activeShare !== null ? (
202
+ <Text className="text-sm text-foreground">
203
+ {activeShare.guestName !== null
204
+ ? gt("{name} is a guest. A new link ends their access.", {
205
+ name: activeShare.guestName,
206
+ })
207
+ : gt("A guest link is active. A new link ends the current one.")}
208
+ </Text>
209
+ ) : (
210
+ <Text className="text-sm text-foreground">
211
+ <T>The link works once and expires in 24 hours.</T>
212
+ </Text>
213
+ )}
214
+ {hasPendingMessages ? (
215
+ <Text className="text-sm text-foreground-muted">{m(PENDING_MESSAGES_NOTICE)}</Text>
216
+ ) : null}
217
+ {state.status === "failed" ? (
218
+ <Text accessibilityRole="alert" className="text-sm text-danger-foreground">
219
+ {state.message}
220
+ </Text>
221
+ ) : null}
222
+ </View>
223
+ <Button
224
+ label={
225
+ creating
226
+ ? gt("Creating link…")
227
+ : state.status === "failed"
228
+ ? gt("Try again")
229
+ : activeShare !== null
230
+ ? gt("Create new link")
231
+ : gt("Create link")
232
+ }
233
+ tone="primary"
234
+ fullWidth
235
+ loading={creating}
236
+ disabled={!canCreate || !threadLoaded || hasPendingMessages}
237
+ onPress={() => void create()}
238
+ />
239
+ </>
240
+ )}
241
+ </ScrollView>
242
+ );
243
+
244
+ if (Platform.OS === "ios") {
245
+ return (
246
+ <View collapsable={false} className="flex-1 bg-sheet">
247
+ <SheetHeader
248
+ presentation="native"
249
+ title={m(TITLE)}
250
+ onClose={close}
251
+ dismissDisabled={creating}
252
+ />
253
+ {content}
254
+ </View>
255
+ );
256
+ }
257
+
258
+ return (
259
+ <View collapsable={false} className="flex-1 bg-header">
260
+ <NativeStackScreenOptions options={{ sheetCornerRadius: 28 }} />
261
+ <AppBar sheet title={m(TITLE)} hideBottomBorder onBack={close} />
262
+ <ScreenContent>{content}</ScreenContent>
263
+ </View>
264
+ );
265
+}
apps/mobile/src/features/threads/guestShareAvailability.test.ts
new
+29
@@ -0,0 +1,29 @@
1
+import { describe, expect, it } from "vite-plus/test";
2
+
3
+import { canShareWithGuest } from "./guestShareAvailability";
4
+
5
+describe("mobile guest sharing availability", () => {
6
+ it("requires permission and the beta, and respects the environment's Connect policy", () => {
7
+ const enabled = { settings: { guestSharingEnabled: true } };
8
+ expect(canShareWithGuest(true, enabled)).toBe(true);
9
+ expect(canShareWithGuest(false, enabled)).toBe(false);
10
+ expect(canShareWithGuest(true, undefined)).toBe(false);
11
+ expect(canShareWithGuest(true, { settings: { guestSharingEnabled: false } })).toBe(false);
12
+ expect(
13
+ canShareWithGuest(true, {
14
+ ...enabled,
15
+ managedPolicy: {
16
+ organization: "Example",
17
+ lockedSettings: [],
18
+ limits: { connect: false },
19
+ },
20
+ }),
21
+ ).toBe(false);
22
+ expect(
23
+ canShareWithGuest(true, {
24
+ ...enabled,
25
+ managedPolicy: { organization: "Example", lockedSettings: [] },
26
+ }),
27
+ ).toBe(true);
28
+ });
29
+});
apps/mobile/src/features/threads/guestShareAvailability.ts
new
+17
@@ -0,0 +1,17 @@
1
+import { managedCapabilityDenial, type ServerConfig } from "@t3tools/contracts";
2
+
3
+export function canShareWithGuest(
4
+ permitted: boolean,
5
+ config:
6
+ | {
7
+ readonly settings: Pick<ServerConfig["settings"], "guestSharingEnabled">;
8
+ readonly managedPolicy?: ServerConfig["managedPolicy"];
9
+ }
10
+ | undefined,
11
+) {
12
+ return (
13
+ permitted &&
14
+ config?.settings.guestSharingEnabled === true &&
15
+ managedCapabilityDenial(config.managedPolicy, "connect") === undefined
16
+ );
17
+}
apps/mobile/src/features/threads/thread-list-v2-items.tsx
+15
@@ -35,6 +35,7 @@ import type { SnoozePresetSetting } from "@t3tools/contracts/settings";
35
import { canSnooze } from "@t3tools/client-runtime/state/thread-settled";
36
import { threadChipCopyTarget } from "@t3tools/client-runtime/thread-reference";
37
import type { MenuAction } from "@react-native-menu/menu";
38
+import { useNavigation } from "@react-navigation/native";
39
import { msg, T, useGT, useMessages } from "gt-react-native";
40
import { memo, useCallback, useMemo, useState, type ComponentProps } from "react";
41
import { Platform, Pressable, Text as RNText, useWindowDimensions, View } from "react-native";
@@ -74,6 +75,7 @@ import { ThreadSwipeable } from "../home/thread-swipe-actions";
75
import { buildThreadTitleRegenerationMenuItems } from "./thread-title-regeneration-menu";
76
import { canTurnThreadIntoProject, turnThreadIntoProject } from "./turnThreadIntoProject";
77
import { threadCanArchive } from "../home/threadArchive";
78
+import { useCanShareWithGuest } from "./useCanShareWithGuest";
79
import {
80
THREAD_LIST_V2_SETTLED_PAGE_COUNT,
81
resolveThreadListV2SnoozeGateExpiryMs,
@@ -929,6 +931,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
931
const handleDelete = useCallback(() => onDeleteThread(thread), [onDeleteThread, thread]);
932
const handleRename = useCallback(() => onRenameThread(thread), [onRenameThread, thread]);
933
const canOperateThread = useEnvironmentScope(thread.environmentId, AuthOrchestrationOperateScope);
934
+ const canShareWithGuest = useCanShareWithGuest(thread.environmentId);
935
+ const navigation = useNavigation();
936
const handleRegenerateTitle = useCallback(
937
() => onRegenerateThreadTitle(thread),
938
[onRegenerateThreadTitle, thread],
@@ -1106,6 +1110,9 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
1110
: []),
1111
{ id: "copy-thread", title: gt("Copy thread"), image: "text.bubble" },
1112
{ id: "copy-thread-id", title: gt("Copy thread ID"), image: "doc.on.doc" },
1113
+ ...(canShareWithGuest
1114
+ ? [{ id: "share-guest", title: gt("Share with guest"), image: "person.badge.plus" }]
1115
+ : []),
1116
];
1117
if (snoozedRow) {
1118
return layoutThreadListV2RowMenuActions(
@@ -1185,6 +1192,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
1192
);
1193
}, [
1194
autoSettleMenuItems,
1195
+ canShareWithGuest,
1196
canUnsettle,
1197
pinMenuItems,
1198
props.settlementSupported,
@@ -1234,6 +1242,12 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
1242
if (nativeEvent.event === "copy-thread-id") {
1243
copyTextWithHaptic(thread.id, { target: "thread-id" });
1244
}
1245
+ if (nativeEvent.event === "share-guest") {
1246
+ navigation.navigate("ThreadGuestShare", {
1247
+ environmentId: thread.environmentId,
1248
+ threadId: thread.id,
1249
+ });
1250
+ }
1251
if (nativeEvent.event === "delete") handleDelete();
1252
if (nativeEvent.event === "snooze:custom") {
1253
setCustomSnoozeOpen(true);
@@ -1259,6 +1273,7 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
1273
m,
1274
onNewThreadOnBranch,
1275
thread,
1276
+ navigation,
1277
handleArchive,
1278
handleDelete,
1279
handleRegenerateTitle,
apps/mobile/src/features/threads/useCanShareWithGuest.ts
new
+17
@@ -0,0 +1,17 @@
1
+import { useAtomValue } from "@effect/atom-react";
2
+import type { EnvironmentId } from "@t3tools/contracts";
3
+
4
+import { environmentServerConfigsAtom, serverEnvironment } from "../../state/server";
5
+import { canShareWithGuest } from "./guestShareAvailability";
6
+
7
+/**
8
+ * Whether this environment offers "Share with guest": the user may create links there, and its
9
+ * Guest links beta is on (Settings > Labs). The server refuses links while the beta is off.
10
+ * Guests arrive through T3 Connect, so a policy that turns Connect off hides sharing too.
11
+ */
12
+export function useCanShareWithGuest(environmentId: EnvironmentId | null): boolean {
13
+ const permitted = useAtomValue(serverEnvironment.createGuestShare.permissionAtom(environmentId));
14
+ return useAtomValue(environmentServerConfigsAtom, (configs) =>
15
+ canShareWithGuest(permitted, environmentId === null ? undefined : configs.get(environmentId)),
16
+ );
17
+}
apps/mobile/src/i18n/translations/de.json
+18
@@ -2373,6 +2373,7 @@
2373
"4e18c52d87681416": "Terminal öffnen",
2374
"e880959d9520231a": "Änderungen prüfen",
2375
"9e25940062052a95": "PR-Link oder Thread kopieren",
2376
+ "67f5b13c3c7bcd40": "Mit Gast teilen",
2377
"6a433e2e6d1cfd88": "Neuer Thread · {environment}",
2378
"fb49961cfffa5467": "Befehlspalette schließen",
2379
"6fdd3baa7bafa38b": "Befehle, Projekte und Threads durchsuchen",
@@ -4413,6 +4414,23 @@
4414
"ed5eb75060e6513f": "Nachricht von {guestName} verwerfen",
4415
"ff6dc3d7fe9f15af": "Senden",
4416
"438efc8205a48969": "Nachricht von {guestName} senden",
4417
+ "1420d99bb8a413c3": "Sende oder verwirf ausstehende Gastnachrichten im Thread, bevor du einen neuen Link erstellst.",
4418
+ "8ed7a1b5a77327f4": "Gastnachrichten warten",
4419
+ "cf3490a604e44d31": "Gastlink konnte nicht erstellt werden.",
4420
+ "b4355e3c1976d58f": "Link konnte nicht geteilt werden",
4421
+ "3fb38cec92ef27c7": "Kopiere ihn stattdessen.",
4422
+ "4d9a7f5bf6e64c38": "Kopieren",
4423
+ "15d8ad64ebd578a1": "Teilen",
4424
+ "c5e7d02039f8e59a": "Dieser Thread wurde gelöscht.",
4425
+ "b2b5ba6e64bdb0ba": "Aktiver Link wird gesucht…",
4426
+ "4808602cebf262e3": "{name} ist Gast. Ein neuer Link beendet den Zugriff.",
4427
+ "edff0d5d1fe015bc": "Ein Gastlink ist aktiv. Ein neuer Link ersetzt den aktuellen.",
4428
+ "94b453aecc86c320": "Link wird erstellt…",
4429
+ "70fa09bcb72a19bb": "Neuen Link erstellen",
4430
+ "adb486dabb4bfe2c": "Link erstellen",
4431
+ "c0a91279ab9b7a3e": "Sende ihn an eine Person. Er kann einmal verwendet werden und läuft nach 24 Stunden ab.",
4432
+ "356ec2ce33231586": "Der Gast sieht den Thread genauso wie du, einschließlich Befehlsausgaben und der Überlegungen des Agenten. Jede Nachricht, die der Gast sendet, wartet auf dich.",
4433
+ "11bb30071c8d00e4": "Der Link kann einmal verwendet werden und läuft nach 24 Stunden ab.",
4434
"05ba3b5f06a7acfe": "Dateien schließen",
4435
"c7e4f052c3d6c066": "Dateien öffnen",
4436
"740ee1b96278f02f": "Audio · {size}",
apps/mobile/src/i18n/translations/en.json
+18
@@ -2373,6 +2373,7 @@
2373
"4e18c52d87681416": "Open terminal",
2374
"e880959d9520231a": "Review changes",
2375
"9e25940062052a95": "Copy PR link or thread",
2376
+ "67f5b13c3c7bcd40": "Share with guest",
2377
"6a433e2e6d1cfd88": "New thread · {environment}",
2378
"fb49961cfffa5467": "Close command palette",
2379
"6fdd3baa7bafa38b": "Search commands, projects, and threads",
@@ -4414,6 +4415,23 @@
4415
"ed5eb75060e6513f": "Dismiss message from {guestName}",
4416
"ff6dc3d7fe9f15af": "Send",
4417
"438efc8205a48969": "Send message from {guestName}",
4418
+ "1420d99bb8a413c3": "Send or dismiss pending guest messages in the thread before creating a new link.",
4419
+ "8ed7a1b5a77327f4": "Guest messages are waiting",
4420
+ "cf3490a604e44d31": "Could not create a guest link.",
4421
+ "b4355e3c1976d58f": "Could not share the link",
4422
+ "3fb38cec92ef27c7": "Copy it instead.",
4423
+ "4d9a7f5bf6e64c38": "Copy",
4424
+ "15d8ad64ebd578a1": "Share",
4425
+ "c5e7d02039f8e59a": "This thread was deleted.",
4426
+ "b2b5ba6e64bdb0ba": "Checking for an active link…",
4427
+ "4808602cebf262e3": "{name} is a guest. A new link ends their access.",
4428
+ "edff0d5d1fe015bc": "A guest link is active. A new link ends the current one.",
4429
+ "94b453aecc86c320": "Creating link…",
4430
+ "70fa09bcb72a19bb": "Create new link",
4431
+ "adb486dabb4bfe2c": "Create link",
4432
+ "c0a91279ab9b7a3e": "Send it to one person. It works once and expires in 24 hours.",
4433
+ "356ec2ce33231586": "The guest sees the thread as you do, including command output and the agent's reasoning. Each message they send waits for you.",
4434
+ "11bb30071c8d00e4": "The link works once and expires in 24 hours.",
4435
"05ba3b5f06a7acfe": "Close files",
4436
"c7e4f052c3d6c066": "Open files",
4437
"740ee1b96278f02f": "Audio · {size}",
apps/mobile/src/i18n/translations/es.json
+18
@@ -2369,6 +2369,7 @@
2369
"4e18c52d87681416": "Abrir terminal",
2370
"e880959d9520231a": "Revisar cambios",
2371
"9e25940062052a95": "Copiar enlace de la PR o hilo",
2372
+ "67f5b13c3c7bcd40": "Compartir con un invitado",
2373
"6a433e2e6d1cfd88": "Nuevo hilo · {environment}",
2374
"fb49961cfffa5467": "Cerrar paleta de comandos",
2375
"6fdd3baa7bafa38b": "Buscar comandos, proyectos e hilos",
@@ -4406,6 +4407,23 @@
4407
"ed5eb75060e6513f": "Descartar el mensaje de {guestName}",
4408
"ff6dc3d7fe9f15af": "Enviar",
4409
"438efc8205a48969": "Enviar el mensaje de {guestName}",
4410
+ "1420d99bb8a413c3": "Envía o descarta los mensajes pendientes del invitado en el hilo antes de crear un enlace nuevo.",
4411
+ "8ed7a1b5a77327f4": "Hay mensajes del invitado en espera",
4412
+ "cf3490a604e44d31": "No se pudo crear un enlace de invitado.",
4413
+ "b4355e3c1976d58f": "No se pudo compartir el enlace",
4414
+ "3fb38cec92ef27c7": "Cópialo en su lugar.",
4415
+ "4d9a7f5bf6e64c38": "Copiar",
4416
+ "15d8ad64ebd578a1": "Compartir",
4417
+ "c5e7d02039f8e59a": "Este hilo se eliminó.",
4418
+ "b2b5ba6e64bdb0ba": "Comprobando si hay un enlace activo…",
4419
+ "4808602cebf262e3": "{name} es un invitado. Un enlace nuevo revoca su acceso.",
4420
+ "edff0d5d1fe015bc": "Hay un enlace de invitado activo. Un enlace nuevo desactiva el actual.",
4421
+ "94b453aecc86c320": "Creando enlace…",
4422
+ "70fa09bcb72a19bb": "Crear enlace nuevo",
4423
+ "adb486dabb4bfe2c": "Crear enlace",
4424
+ "c0a91279ab9b7a3e": "Envíalo a una persona. Solo se puede usar una vez y caduca en 24 horas.",
4425
+ "356ec2ce33231586": "El invitado ve el hilo tal como lo ves tú, incluidas la salida de los comandos y el razonamiento del agente. Cada mensaje que envía queda en espera hasta que lo revises.",
4426
+ "11bb30071c8d00e4": "El enlace solo se puede usar una vez y caduca en 24 horas.",
4427
"05ba3b5f06a7acfe": "Cerrar archivos",
4428
"c7e4f052c3d6c066": "Abrir archivos",
4429
"740ee1b96278f02f": "Audio · {size}",
apps/mobile/src/i18n/translations/fr.json
+18
@@ -2369,6 +2369,7 @@
2369
"4e18c52d87681416": "Ouvrir le terminal",
2370
"e880959d9520231a": "Vérifier les modifications",
2371
"9e25940062052a95": "Copier le lien de la PR ou le fil",
2372
+ "67f5b13c3c7bcd40": "Partager avec un invité",
2373
"6a433e2e6d1cfd88": "Nouveau fil · {environment}",
2374
"fb49961cfffa5467": "Fermer la palette de commandes",
2375
"6fdd3baa7bafa38b": "Rechercher des commandes, des projets et des fils",
@@ -4407,6 +4408,23 @@
4408
"ed5eb75060e6513f": "Ignorer le message de {guestName}",
4409
"ff6dc3d7fe9f15af": "Envoyer",
4410
"438efc8205a48969": "Envoyer le message de {guestName}",
4411
+ "1420d99bb8a413c3": "Envoyez ou ignorez les messages de l'invité en attente dans le fil avant de créer un nouveau lien.",
4412
+ "8ed7a1b5a77327f4": "Des messages de l'invité sont en attente",
4413
+ "cf3490a604e44d31": "Impossible de créer un lien invité.",
4414
+ "b4355e3c1976d58f": "Impossible de partager le lien",
4415
+ "3fb38cec92ef27c7": "Copiez-le à la place.",
4416
+ "4d9a7f5bf6e64c38": "Copier",
4417
+ "15d8ad64ebd578a1": "Partager",
4418
+ "c5e7d02039f8e59a": "Ce fil a été supprimé.",
4419
+ "b2b5ba6e64bdb0ba": "Recherche d'un lien actif…",
4420
+ "4808602cebf262e3": "{name} est invité. Un nouveau lien met fin à son accès.",
4421
+ "edff0d5d1fe015bc": "Un lien invité est actif. Un nouveau lien désactive le lien actuel.",
4422
+ "94b453aecc86c320": "Création du lien…",
4423
+ "70fa09bcb72a19bb": "Créer un nouveau lien",
4424
+ "adb486dabb4bfe2c": "Créer un lien",
4425
+ "c0a91279ab9b7a3e": "Envoyez-le à une personne. Il est à usage unique et expire dans 24 heures.",
4426
+ "356ec2ce33231586": "L'invité voit le fil comme vous, y compris les sorties des commandes et le raisonnement de l'agent. Chaque message qu'il envoie attend votre intervention.",
4427
+ "11bb30071c8d00e4": "Le lien est à usage unique et expire dans 24 heures.",
4428
"05ba3b5f06a7acfe": "Fermer les fichiers",
4429
"c7e4f052c3d6c066": "Ouvrir les fichiers",
4430
"740ee1b96278f02f": "Audio · {size}",
apps/mobile/src/i18n/translations/ja.json
+18
@@ -2366,6 +2366,7 @@
2366
"4e18c52d87681416": "ターミナルを開く",
2367
"e880959d9520231a": "変更を確認",
2368
"9e25940062052a95": "PR のリンクまたはスレッドをコピー",
2369
+ "67f5b13c3c7bcd40": "ゲストと共有",
2370
"6a433e2e6d1cfd88": "新しいスレッド · {environment}",
2371
"fb49961cfffa5467": "コマンドパレットを閉じる",
2372
"6fdd3baa7bafa38b": "コマンド、プロジェクト、スレッドを検索",
@@ -4388,6 +4389,23 @@
4389
"ed5eb75060e6513f": "{guestName} からのメッセージを破棄",
4390
"ff6dc3d7fe9f15af": "送信",
4391
"438efc8205a48969": "{guestName} からのメッセージを送信",
4392
+ "1420d99bb8a413c3": "新しいリンクを作成する前に、スレッド内の保留中のゲストメッセージを送信または破棄してください。",
4393
+ "8ed7a1b5a77327f4": "ゲストのメッセージが保留中です",
4394
+ "cf3490a604e44d31": "ゲストリンクを作成できませんでした。",
4395
+ "b4355e3c1976d58f": "リンクを共有できませんでした",
4396
+ "3fb38cec92ef27c7": "代わりにコピーしてください。",
4397
+ "4d9a7f5bf6e64c38": "コピー",
4398
+ "15d8ad64ebd578a1": "共有",
4399
+ "c5e7d02039f8e59a": "このスレッドは削除されました。",
4400
+ "b2b5ba6e64bdb0ba": "有効なリンクを確認中…",
4401
+ "4808602cebf262e3": "{name} はゲストです。新しいリンクを作成すると、このゲストのアクセスは終了します。",
4402
+ "edff0d5d1fe015bc": "ゲストリンクが有効です。新しいリンクを作成すると、現在のリンクは無効になります。",
4403
+ "94b453aecc86c320": "リンクを作成中…",
4404
+ "70fa09bcb72a19bb": "新しいリンクを作成",
4405
+ "adb486dabb4bfe2c": "リンクを作成",
4406
+ "c0a91279ab9b7a3e": "1 人に送信してください。リンクは 1 回だけ使用でき、24 時間後に期限が切れます。",
4407
+ "356ec2ce33231586": "ゲストには、コマンドの出力やエージェントの推論を含め、あなたと同じようにスレッドが表示されます。ゲストが送ったメッセージは、あなたが対応するまで保留されます。",
4408
+ "11bb30071c8d00e4": "リンクは 1 回だけ使用でき、24 時間後に期限が切れます。",
4409
"05ba3b5f06a7acfe": "ファイルを閉じる",
4410
"c7e4f052c3d6c066": "ファイルを開く",
4411
"740ee1b96278f02f": "音声 · {size}",
apps/mobile/src/i18n/translations/ko.json
+18
@@ -2370,6 +2370,7 @@
2370
"4e18c52d87681416": "터미널 열기",
2371
"e880959d9520231a": "변경 사항 검토",
2372
"9e25940062052a95": "PR 링크 또는 스레드 복사",
2373
+ "67f5b13c3c7bcd40": "게스트와 공유",
2374
"6a433e2e6d1cfd88": "새 스레드 · {environment}",
2375
"fb49961cfffa5467": "명령 팔레트 닫기",
2376
"6fdd3baa7bafa38b": "명령, 프로젝트, 스레드 검색",
@@ -4393,6 +4394,23 @@
4394
"ed5eb75060e6513f": "{guestName}님의 메시지 닫기",
4395
"ff6dc3d7fe9f15af": "보내기",
4396
"438efc8205a48969": "{guestName}님의 메시지 보내기",
4397
+ "1420d99bb8a413c3": "새 링크를 만들기 전에 스레드에서 대기 중인 게스트 메시지를 보내거나 닫으세요.",
4398
+ "8ed7a1b5a77327f4": "게스트 메시지가 대기 중입니다",
4399
+ "cf3490a604e44d31": "게스트 링크를 만들 수 없습니다.",
4400
+ "b4355e3c1976d58f": "링크를 공유할 수 없습니다",
4401
+ "3fb38cec92ef27c7": "대신 복사하세요.",
4402
+ "4d9a7f5bf6e64c38": "복사",
4403
+ "15d8ad64ebd578a1": "공유",
4404
+ "c5e7d02039f8e59a": "이 스레드는 삭제되었습니다.",
4405
+ "b2b5ba6e64bdb0ba": "활성 링크 확인 중…",
4406
+ "4808602cebf262e3": "{name}님은 게스트입니다. 새 링크를 만들면 이 게스트의 액세스 권한이 종료됩니다.",
4407
+ "edff0d5d1fe015bc": "게스트 링크가 활성화되어 있습니다. 새 링크를 만들면 현재 링크가 비활성화됩니다.",
4408
+ "94b453aecc86c320": "링크 만드는 중…",
4409
+ "70fa09bcb72a19bb": "새 링크 만들기",
4410
+ "adb486dabb4bfe2c": "링크 만들기",
4411
+ "c0a91279ab9b7a3e": "한 사람에게 보내세요. 링크는 한 번만 사용할 수 있으며 24시간 후 만료됩니다.",
4412
+ "356ec2ce33231586": "게스트는 명령 출력과 에이전트의 추론을 포함하여 나와 동일한 스레드를 볼 수 있습니다. 게스트가 보내는 각 메시지는 내가 처리할 때까지 대기합니다.",
4413
+ "11bb30071c8d00e4": "링크는 한 번만 사용할 수 있으며 24시간 후 만료됩니다.",
4414
"05ba3b5f06a7acfe": "파일 닫기",
4415
"c7e4f052c3d6c066": "파일 열기",
4416
"740ee1b96278f02f": "오디오 · {size}",
apps/mobile/src/i18n/translations/pt-BR.json
+18
@@ -2369,6 +2369,7 @@
2369
"4e18c52d87681416": "Abrir terminal",
2370
"e880959d9520231a": "Revisar alterações",
2371
"9e25940062052a95": "Copiar link do PR ou thread",
2372
+ "67f5b13c3c7bcd40": "Compartilhar com convidado",
2373
"6a433e2e6d1cfd88": "Nova thread · {environment}",
2374
"fb49961cfffa5467": "Fechar paleta de comandos",
2375
"6fdd3baa7bafa38b": "Pesquisar comandos, projetos e threads",
@@ -4407,6 +4408,23 @@
4408
"ed5eb75060e6513f": "Dispensar a mensagem de {guestName}",
4409
"ff6dc3d7fe9f15af": "Enviar",
4410
"438efc8205a48969": "Enviar a mensagem de {guestName}",
4411
+ "1420d99bb8a413c3": "Envie ou dispense as mensagens pendentes do convidado na thread antes de criar um novo link.",
4412
+ "8ed7a1b5a77327f4": "Há mensagens do convidado aguardando",
4413
+ "cf3490a604e44d31": "Não foi possível criar um link de convidado.",
4414
+ "b4355e3c1976d58f": "Não foi possível compartilhar o link",
4415
+ "3fb38cec92ef27c7": "Copie o link em vez disso.",
4416
+ "4d9a7f5bf6e64c38": "Copiar",
4417
+ "15d8ad64ebd578a1": "Compartilhar",
4418
+ "c5e7d02039f8e59a": "Esta thread foi excluída.",
4419
+ "b2b5ba6e64bdb0ba": "Verificando se há um link ativo…",
4420
+ "4808602cebf262e3": "{name} é convidado. Um novo link encerra o acesso dessa pessoa.",
4421
+ "edff0d5d1fe015bc": "Há um link de convidado ativo. Um novo link desativa o atual.",
4422
+ "94b453aecc86c320": "Criando link…",
4423
+ "70fa09bcb72a19bb": "Criar novo link",
4424
+ "adb486dabb4bfe2c": "Criar link",
4425
+ "c0a91279ab9b7a3e": "Envie para uma pessoa. O link só pode ser usado uma vez e expira em 24 horas.",
4426
+ "356ec2ce33231586": "O convidado vê a thread como você, incluindo a saída dos comandos e o raciocínio do agente. Cada mensagem enviada por ele aguarda sua ação.",
4427
+ "11bb30071c8d00e4": "O link só pode ser usado uma vez e expira em 24 horas.",
4428
"05ba3b5f06a7acfe": "Fechar arquivos",
4429
"c7e4f052c3d6c066": "Abrir arquivos",
4430
"740ee1b96278f02f": "Áudio · {size}",
apps/mobile/src/i18n/translations/ru.json
+18
@@ -2421,6 +2421,7 @@
2421
"4e18c52d87681416": "Открыть терминал",
2422
"e880959d9520231a": "Проверить изменения",
2423
"9e25940062052a95": "Копировать ссылку на PR или тред",
2424
+ "67f5b13c3c7bcd40": "Поделиться с гостем",
2425
"6a433e2e6d1cfd88": "Новый тред · {environment}",
2426
"fb49961cfffa5467": "Закрыть палитру команд",
2427
"6fdd3baa7bafa38b": "Поиск команд, проектов и тредов",
@@ -4485,6 +4486,23 @@
4486
"ed5eb75060e6513f": "Отклонить сообщение от {guestName}",
4487
"ff6dc3d7fe9f15af": "Отправить",
4488
"438efc8205a48969": "Отправить сообщение от {guestName}",
4489
+ "1420d99bb8a413c3": "Перед созданием новой ссылки отправьте или отклоните ожидающие сообщения гостя в треде.",
4490
+ "8ed7a1b5a77327f4": "Сообщения гостя ожидают решения",
4491
+ "cf3490a604e44d31": "Не удалось создать гостевую ссылку.",
4492
+ "b4355e3c1976d58f": "Не удалось поделиться ссылкой",
4493
+ "3fb38cec92ef27c7": "Вместо этого скопируйте её.",
4494
+ "4d9a7f5bf6e64c38": "Копировать",
4495
+ "15d8ad64ebd578a1": "Поделиться",
4496
+ "c5e7d02039f8e59a": "Этот тред был удалён.",
4497
+ "b2b5ba6e64bdb0ba": "Проверка активной ссылки…",
4498
+ "4808602cebf262e3": "{name} имеет гостевой доступ. Новая ссылка закроет этот доступ.",
4499
+ "edff0d5d1fe015bc": "Гостевая ссылка активна. Новая ссылка отключит текущую.",
4500
+ "94b453aecc86c320": "Создание ссылки…",
4501
+ "70fa09bcb72a19bb": "Создать новую ссылку",
4502
+ "adb486dabb4bfe2c": "Создать ссылку",
4503
+ "c0a91279ab9b7a3e": "Отправьте её одному человеку. Ссылкой можно воспользоваться один раз, срок её действия истекает через 24 часа.",
4504
+ "356ec2ce33231586": "Гость видит тред так же, как и вы, включая вывод команд и рассуждения агента. Каждое отправленное им сообщение ожидает вашего решения.",
4505
+ "11bb30071c8d00e4": "Ссылкой можно воспользоваться один раз, срок её действия истекает через 24 часа.",
4506
"05ba3b5f06a7acfe": "Закрыть файлы",
4507
"c7e4f052c3d6c066": "Открыть файлы",
4508
"740ee1b96278f02f": "Аудио · {size}",
apps/mobile/src/i18n/translations/sv.json
+18
@@ -2373,6 +2373,7 @@
2373
"4e18c52d87681416": "Öppna terminal",
2374
"e880959d9520231a": "Granska ändringar",
2375
"9e25940062052a95": "Kopiera PR-länk eller tråd",
2376
+ "67f5b13c3c7bcd40": "Dela med en gäst",
2377
"6a433e2e6d1cfd88": "Ny tråd · {environment}",
2378
"fb49961cfffa5467": "Stäng kommandopaletten",
2379
"6fdd3baa7bafa38b": "Sök kommandon, projekt och trådar",
@@ -4413,6 +4414,23 @@
4414
"ed5eb75060e6513f": "Avvisa meddelande från {guestName}",
4415
"ff6dc3d7fe9f15af": "Skicka",
4416
"438efc8205a48969": "Skicka meddelande från {guestName}",
4417
+ "1420d99bb8a413c3": "Skicka eller avvisa väntande gästmeddelanden i tråden innan du skapar en ny länk.",
4418
+ "8ed7a1b5a77327f4": "Gästmeddelanden väntar",
4419
+ "cf3490a604e44d31": "Kunde inte skapa en gästlänk.",
4420
+ "b4355e3c1976d58f": "Kunde inte dela länken",
4421
+ "3fb38cec92ef27c7": "Kopiera den i stället.",
4422
+ "4d9a7f5bf6e64c38": "Kopiera",
4423
+ "15d8ad64ebd578a1": "Dela",
4424
+ "c5e7d02039f8e59a": "Den här tråden har tagits bort.",
4425
+ "b2b5ba6e64bdb0ba": "Söker efter en aktiv länk…",
4426
+ "4808602cebf262e3": "{name} är gäst. En ny länk avslutar gästens åtkomst.",
4427
+ "edff0d5d1fe015bc": "En gästlänk är aktiv. En ny länk inaktiverar den nuvarande.",
4428
+ "94b453aecc86c320": "Skapar länk…",
4429
+ "70fa09bcb72a19bb": "Skapa ny länk",
4430
+ "adb486dabb4bfe2c": "Skapa länk",
4431
+ "c0a91279ab9b7a3e": "Skicka den till en person. Länken kan användas en gång och går ut om 24 timmar.",
4432
+ "356ec2ce33231586": "Gästen ser tråden på samma sätt som du, inklusive kommandoutdata och agentens resonemang. Varje meddelande som gästen skickar väntar på att du hanterar det.",
4433
+ "11bb30071c8d00e4": "Länken kan användas en gång och går ut om 24 timmar.",
4434
"05ba3b5f06a7acfe": "Stäng filer",
4435
"c7e4f052c3d6c066": "Öppna filer",
4436
"740ee1b96278f02f": "Ljud · {size}",
apps/mobile/src/i18n/translations/zh.json
+18
@@ -2370,6 +2370,7 @@
2370
"4e18c52d87681416": "打开终端",
2371
"e880959d9520231a": "查看更改",
2372
"9e25940062052a95": "复制 PR 链接或会话",
2373
+ "67f5b13c3c7bcd40": "与访客分享",
2374
"6a433e2e6d1cfd88": "新建会话 · {environment}",
2375
"fb49961cfffa5467": "关闭命令面板",
2376
"6fdd3baa7bafa38b": "搜索命令、项目和会话",
@@ -4396,6 +4397,23 @@
4397
"ed5eb75060e6513f": "关闭来自 {guestName} 的消息",
4398
"ff6dc3d7fe9f15af": "发送",
4399
"438efc8205a48969": "发送来自 {guestName} 的消息",
4400
+ "1420d99bb8a413c3": "创建新链接前,请先发送或关闭会话中待处理的访客消息。",
4401
+ "8ed7a1b5a77327f4": "有访客消息待处理",
4402
+ "cf3490a604e44d31": "无法创建访客链接。",
4403
+ "b4355e3c1976d58f": "无法分享链接",
4404
+ "3fb38cec92ef27c7": "请改为复制链接。",
4405
+ "4d9a7f5bf6e64c38": "复制",
4406
+ "15d8ad64ebd578a1": "分享",
4407
+ "c5e7d02039f8e59a": "此会话已被删除。",
4408
+ "b2b5ba6e64bdb0ba": "正在检查有效链接…",
4409
+ "4808602cebf262e3": "{name} 是访客。创建新链接会终止其访问权限。",
4410
+ "edff0d5d1fe015bc": "有一个有效的访客链接。创建新链接会使当前链接失效。",
4411
+ "94b453aecc86c320": "正在创建链接…",
4412
+ "70fa09bcb72a19bb": "创建新链接",
4413
+ "adb486dabb4bfe2c": "创建链接",
4414
+ "c0a91279ab9b7a3e": "请发送给一个人。链接仅限使用一次,并在 24 小时后过期。",
4415
+ "356ec2ce33231586": "访客看到的会话与你看到的相同,包括命令输出和代理的推理过程。他们发送的每条消息都会等待你处理。",
4416
+ "11bb30071c8d00e4": "链接仅限使用一次,并在 24 小时后过期。",
4417
"05ba3b5f06a7acfe": "关闭文件",
4418
"c7e4f052c3d6c066": "打开文件",
4419
"740ee1b96278f02f": "音频 · {size}",
apps/mobile/vite.config.ts
+1
@@ -4,6 +4,7 @@ import { defineConfig, normalizePath } from "vite-plus";
4
import "vite-plus/test/config";
5
6
const reactTests = [
7
+ "src/features/threads/ThreadGuestShareSheet.test.tsx",
8
"src/features/threads/useSubmitAfterNativeImages.test.tsx",
9
"src/features/threads/git/GitBranchesSheet.test.tsx",
10
"src/features/threads/new-task-flow-provider.test.tsx",
apps/server/src/orchestration-v2/GuestShare.test.ts
+13
@@ -113,6 +113,19 @@ it.effect("redeems a guest link once and sends each guest message once, with its
113
});
114
assert.equal((yield* projections.getThreadShell(threadId))?.pendingGuestMessageCount, 1);
115
116
+ const now = yield* DateTime.now;
117
+ const replacement = orchestrator.dispatch({
118
+ type: "thread.guest-share.open",
119
+ commandId: CommandId.make("replace-pending-share"),
120
+ threadId,
121
+ shareId: GuestShareId.make("share:replacement"),
122
+ host: "env.t3.test",
123
+ expiresAt: DateTime.formatIso(DateTime.add(now, { hours: 24 })),
124
+ });
125
+ assert.isTrue(Exit.isFailure(yield* Effect.exit(replacement)));
126
+ assert.equal((yield* projections.getThread(threadId)).guestShare?.id, shareId);
127
+ assert.equal((yield* projections.getThreadShell(threadId))?.pendingGuestMessageCount, 1);
128
+
129
yield* sendGuestMessage(orchestrator, "send-1");
130
const projection = yield* projections.getThreadProjection(threadId);
131
assert.deepEqual(
apps/server/src/orchestration-v2/GuestShareDecider.ts
+3
@@ -113,6 +113,9 @@ export function decideGuestShareCommand(input: {
113
switch (command.type) {
114
case "thread.guest-share.open": {
115
if (thread.archivedAt !== null) return Result.fail("Archived threads cannot be shared.");
116
+ if (share?.messages.some((message) => message.status === "pending")) {
117
+ return Result.fail("Answer or dismiss waiting guest messages before replacing this link.");
118
+ }
119
return withShare({
120
id: command.shareId,
121
host: command.host,
docs/user/guest-links.md
+3
-2
@@ -13,7 +13,7 @@ While the setting is off, every guest link on that machine stops working; links
13
expired work again when you turn it back on.
14
15
1. Right-click the thread in the sidebar and choose **Share with guest**. It is also in the thread
16
- menu and the command palette.
16
+ menu and the command palette. In the mobile app, long-press the thread in the list.
17
2. Copy the link and send it to one person. It works in one browser and expires after 24 hours.
18
Opening it again in that browser takes them back to the thread.
19
3. When they send a message, it appears at the end of the thread and the sidebar shows **Request**.
@@ -21,7 +21,8 @@ expired work again when you turn it back on.
21
message, and **Send** includes them.
22
23
Choose **Stop sharing** to end the link at once. Archiving the thread, creating a new link, or
24
-unlinking the machine from T3 Connect also ends it. You can send or dismiss guest messages from the mobile app.
24
+unlinking the machine from T3 Connect also ends it. The mobile app can send, dismiss, and stop
25
+sharing too.
26
27
## What the guest sees
28