feat(e2e): add sidechain task modal interactions to session detail capture

- Implemented a new capture case for the "sidechain-task-modal" in the session detail E2E tests.
- Added data-testid attributes to the SidechainConversationModal for improved test targeting.
- Enhanced the GitController to handle errors gracefully when fetching branches and commits, returning an empty response on failure.
This commit is contained in:
d-kimsuon
2025-10-18 17:33:58 +09:00
parent 1d49361bca
commit 90e260f11e
3 changed files with 45 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
import { Context, Effect, Layer } from "effect";
import { Context, Effect, Either, Layer } from "effect";
import type { ControllerResponse } from "../../../lib/effect/toEffectResponse";
import type { InferEffect } from "../../../lib/effect/types";
import { ProjectRepository } from "../../project/infrastructure/ProjectRepository";
@@ -23,9 +23,19 @@ const LayerImpl = Effect.gen(function* () {
}
const projectPath = project.meta.projectPath;
const branches = yield* gitService.getBranches(projectPath);
const branches = yield* Effect.either(
gitService.getBranches(projectPath),
);
if (Either.isLeft(branches)) {
return {
response: [],
status: 200,
} as const satisfies ControllerResponse;
}
return {
response: branches,
response: branches.right,
status: 200,
} as const satisfies ControllerResponse;
});
@@ -45,9 +55,17 @@ const LayerImpl = Effect.gen(function* () {
const projectPath = project.meta.projectPath;
const commits = yield* gitService.getCommits(projectPath);
const commits = yield* Effect.either(gitService.getCommits(projectPath));
if (Either.isLeft(commits)) {
return {
response: [],
status: 200,
} as const satisfies ControllerResponse;
}
return {
response: commits,
response: commits.right,
status: 200,
} as const satisfies ControllerResponse;
});