Skip to content

Commit 54f905c

Browse files
juliusmarmingecodex
andcommitted
Adapt multi-environment store to atomic refactor base
Co-authored-by: codex <codex@users.noreply.github.com>
1 parent babe73c commit 54f905c

6 files changed

Lines changed: 158 additions & 405 deletions

File tree

apps/server/src/project/Layers/RepositoryIdentityResolver.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ it.layer(NodeServices.layer)("RepositoryIdentityResolverLive", (it) => {
4141

4242
expect(identity).not.toBeNull();
4343
expect(identity?.canonicalKey).toBe("github.com/t3tools/t3code");
44-
expect(identity?.displayName).toBe("T3Tools/t3code");
44+
expect(identity?.displayName).toBe("t3tools/t3code");
4545
expect(identity?.provider).toBe("github");
46-
expect(identity?.owner).toBe("T3Tools");
46+
expect(identity?.owner).toBe("t3tools");
4747
expect(identity?.name).toBe("t3code");
4848
}).pipe(Effect.provide(RepositoryIdentityResolverLive)),
4949
);
@@ -86,7 +86,7 @@ it.layer(NodeServices.layer)("RepositoryIdentityResolverLive", (it) => {
8686
expect(identity).not.toBeNull();
8787
expect(identity?.locator.remoteName).toBe("upstream");
8888
expect(identity?.canonicalKey).toBe("github.com/t3tools/t3code");
89-
expect(identity?.displayName).toBe("T3Tools/t3code");
89+
expect(identity?.displayName).toBe("t3tools/t3code");
9090
}).pipe(Effect.provide(RepositoryIdentityResolverLive)),
9191
);
9292

apps/web/src/components/ChatView.logic.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,12 @@ const makeThread = (input?: {
212212
function setStoreThreads(threads: ReadonlyArray<ReturnType<typeof makeThread>>) {
213213
const projectId = ProjectId.makeUnsafe("project-1");
214214
useStore.setState({
215+
activeEnvironmentId: localEnvironmentId,
215216
projectIds: [projectId],
216217
projectById: {
217218
[projectId]: {
218219
id: projectId,
220+
environmentId: localEnvironmentId,
219221
name: "Project",
220222
cwd: "/tmp/project",
221223
defaultModelSelection: {
@@ -236,6 +238,7 @@ function setStoreThreads(threads: ReadonlyArray<ReturnType<typeof makeThread>>)
236238
thread.id,
237239
{
238240
id: thread.id,
241+
environmentId: thread.environmentId,
239242
codexThreadId: thread.codexThreadId,
240243
projectId: thread.projectId,
241244
title: thread.title,
@@ -304,6 +307,7 @@ function setStoreThreads(threads: ReadonlyArray<ReturnType<typeof makeThread>>)
304307
),
305308
sidebarThreadSummaryById: {},
306309
bootstrapComplete: true,
310+
environmentStateById: {},
307311
});
308312
}
309313

apps/web/src/routes/__root.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -611,11 +611,7 @@ function EventRouter() {
611611
return;
612612
}
613613
const thread = selectThreadById(ThreadId.makeUnsafe(event.threadId))(useStore.getState());
614-
if (
615-
thread &&
616-
thread.environmentId === currentEnvironmentId &&
617-
thread.archivedAt !== null
618-
) {
614+
if (thread && thread.environmentId === currentEnvironmentId && thread.archivedAt !== null) {
619615
return;
620616
}
621617
applyTerminalEvent(event);

0 commit comments

Comments
 (0)