Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): links to finished subagent threads show their title and open #29494

Closedjuliusmarmingewants to merge 5 commits intomain fromfix/issue-29458opened View on GitHub

Showing 4 changed files with 209 additions and 0 deletions (loading 3).

x
0 of 4 viewed, 4 left
209 additions and 0 deletionsapps/mobile/src/state/entities.test.tsxAdded
View file
@@ -0,0 +1,209 @@
+import { RegistryContext } from "@effect/atom-react";
+import {
+ EnvironmentId,
+ ThreadId,
+ type OrchestrationV2ThreadFamily,
+ type OrchestrationV2ThreadShell,
+ type ScopedThreadRef,
+} from "@t3tools/contracts";
+import { formatThreadLink, type ThreadLink } from "@t3tools/shared/threadLinks";
+import { act, type ReactNode } from "react";
+import { createRoot } from "react-dom/client";
+import { expect, it, vi } from "vite-plus/test";
+​
+const ENV = EnvironmentId.make("environment-links");
+const row = (id: string, title: string) =>
+ ({ id: ThreadId.make(id), title }) as OrchestrationV2ThreadShell;
+const PARENT = row("parent", "Ship the release");
+const CHILD = row("thread:delegated-task:01JCHILD", "Check the changelog");
+​
+// The shell omits idle subagents (`omitIdleSubagents`); the family read still returns them.
+const server = await vi.hoisted(async () => {
+ const { Atom, AsyncResult } = await import("effect/reactivity");
+ const key = (environmentId: string, threadId: string) =>
+ JSON.stringify([environmentId, threadId]);
+ const shellRows = Atom.make<ReadonlyArray<OrchestrationV2ThreadShell>>([]).pipe(Atom.keepAlive);
+ const mounted = Atom.make<ReadonlyMap<string, ReadonlyArray<OrchestrationV2ThreadShell>>>(
+ new Map(),
+ ).pipe(Atom.keepAlive);
+ const merged = Atom.make((get) => {
+ const rows = new Map<string, OrchestrationV2ThreadShell>(