Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ projectionSnapshotLayer("ProjectionSnapshotQuery", (it) => {
project_id,
title,
workspace_root,
workspace_file,
default_model_selection_json,
scripts_json,
created_at,
Expand All @@ -64,6 +65,7 @@ projectionSnapshotLayer("ProjectionSnapshotQuery", (it) => {
'project-1',
'Project 1',
'/tmp/project-1',
'/tmp/project-1/project-1.code-workspace',
'{"provider":"codex","model":"gpt-5-codex"}',
'[{"id":"script-1","name":"Build","command":"bun run build","icon":"build","runOnWorktreeCreate":false}]',
'2026-02-24T00:00:00.000Z',
Expand Down Expand Up @@ -272,6 +274,7 @@ projectionSnapshotLayer("ProjectionSnapshotQuery", (it) => {
id: asProjectId("project-1"),
title: "Project 1",
workspaceRoot: "/tmp/project-1",
workspaceFile: "/tmp/project-1/project-1.code-workspace",
repoRoots: ["/tmp/project-1"],
repositoryIdentity: null,
repositoryIdentities: [],
Expand Down Expand Up @@ -402,6 +405,7 @@ projectionSnapshotLayer("ProjectionSnapshotQuery", (it) => {
id: asProjectId("project-1"),
title: "Project 1",
workspaceRoot: "/tmp/project-1",
workspaceFile: "/tmp/project-1/project-1.code-workspace",
repoRoots: ["/tmp/project-1"],
repositoryIdentity: null,
repositoryIdentities: [],
Expand Down Expand Up @@ -738,6 +742,7 @@ projectionSnapshotLayer("ProjectionSnapshotQuery", (it) => {
project_id,
title,
workspace_root,
workspace_file,
default_model_selection_json,
scripts_json,
created_at,
Expand All @@ -749,6 +754,7 @@ projectionSnapshotLayer("ProjectionSnapshotQuery", (it) => {
'project-active',
'Active Project',
'/tmp/workspace',
'/tmp/workspace/active.code-workspace',
'{"provider":"codex","model":"gpt-5-codex"}',
'[]',
'2026-03-01T00:00:00.000Z',
Expand All @@ -760,6 +766,7 @@ projectionSnapshotLayer("ProjectionSnapshotQuery", (it) => {
'Deleted Project',
'/tmp/deleted',
NULL,
NULL,
'[]',
'2026-03-01T00:00:02.000Z',
'2026-03-01T00:00:03.000Z',
Expand Down Expand Up @@ -841,6 +848,15 @@ projectionSnapshotLayer("ProjectionSnapshotQuery", (it) => {
assert.equal(project._tag, "Some");
if (project._tag === "Some") {
assert.equal(project.value.id, asProjectId("project-active"));
assert.equal(project.value.workspaceFile, "/tmp/workspace/active.code-workspace");
}

const projectShell = yield* snapshotQuery.getProjectShellById(
asProjectId("project-active"),
);
assert.equal(projectShell._tag, "Some");
if (projectShell._tag === "Some") {
assert.equal(projectShell.value.workspaceFile, "/tmp/workspace/active.code-workspace");
}

const missingProject = yield* snapshotQuery.getActiveProjectByWorkspaceRoot("/tmp/missing");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ function mapProjectShellRow(
id: row.projectId,
title: row.title,
workspaceRoot: row.workspaceRoot,
...(row.workspaceFile ? { workspaceFile: row.workspaceFile } : {}),
repoRoots: normalizeRepoRoots(row),
repositoryIdentity: repositoryIdentities[0] ?? null,
repositoryIdentities,
Expand Down Expand Up @@ -422,6 +423,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
project_id AS "projectId",
title,
workspace_root AS "workspaceRoot",
workspace_file AS "workspaceFile",
repo_roots AS "repoRoots",
default_model_selection_json AS "defaultModelSelection",
default_thread_env_mode AS "defaultThreadEnvMode",
Expand Down Expand Up @@ -887,6 +889,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
project_id AS "projectId",
title,
workspace_root AS "workspaceRoot",
workspace_file AS "workspaceFile",
repo_roots AS "repoRoots",
default_model_selection_json AS "defaultModelSelection",
default_thread_env_mode AS "defaultThreadEnvMode",
Expand All @@ -912,6 +915,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
project_id AS "projectId",
title,
workspace_root AS "workspaceRoot",
workspace_file AS "workspaceFile",
repo_roots AS "repoRoots",
default_model_selection_json AS "defaultModelSelection",
default_thread_env_mode AS "defaultThreadEnvMode",
Expand Down Expand Up @@ -1722,6 +1726,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
id: row.projectId,
title: row.title,
workspaceRoot: row.workspaceRoot,
...(row.workspaceFile ? { workspaceFile: row.workspaceFile } : {}),
repoRoots: normalizeRepoRoots(row),
repositoryIdentity: projectIdentities[0] ?? null,
repositoryIdentities: projectIdentities,
Expand Down Expand Up @@ -1862,6 +1867,7 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
id: row.projectId,
title: row.title,
workspaceRoot: row.workspaceRoot,
...(row.workspaceFile ? { workspaceFile: row.workspaceFile } : {}),
repoRoots: normalizeRepoRoots(row),
repositoryIdentities: [],
defaultModelSelection: row.defaultModelSelection,
Expand Down Expand Up @@ -2371,6 +2377,9 @@ const makeProjectionSnapshotQuery = Effect.gen(function* () {
id: option.value.projectId,
title: option.value.title,
workspaceRoot: option.value.workspaceRoot,
...(option.value.workspaceFile
? { workspaceFile: option.value.workspaceFile }
: {}),
repoRoots: normalizeRepoRoots(option.value),
repositoryIdentity: projectIdentities[0] ?? null,
repositoryIdentities: projectIdentities,
Expand Down
Loading