Skip to content

Commit ff6fe5c

Browse files
nenrinyearikotome
authored andcommitted
address PR feedback on task-decomp review comments
1 parent 8f0126d commit ff6fe5c

3 files changed

Lines changed: 31 additions & 5 deletions

File tree

backend/src/features/task-decompose/task-decompose.types.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ export type TaskDecomposeRequest = {
77
maxSteps?: number;
88
};
99

10+
export type ValidatedTaskDecomposeRequest = Omit<
11+
TaskDecomposeRequest,
12+
"timezone"
13+
> & {
14+
timezone: string;
15+
};
16+
1017
export type TaskSubtask = {
1118
title: string;
1219
description: string;

backend/src/features/task-decompose/task-decompose.validation.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TaskDecomposeRequest } from "./task-decompose.types";
1+
import type { ValidatedTaskDecomposeRequest } from "./task-decompose.types";
22
import { normalizeTaskTimezone } from "./task-timezone";
33

44
const MAX_STEPS_LIMIT = 12;
@@ -42,7 +42,9 @@ function parseMaxSteps(value: unknown): number | undefined {
4242
return Math.min(rounded, MAX_STEPS_LIMIT);
4343
}
4444

45-
export function toRequestPayload(input: unknown): TaskDecomposeRequest | null {
45+
export function toRequestPayload(
46+
input: unknown,
47+
): ValidatedTaskDecomposeRequest | null {
4648
if (!input || typeof input !== "object") {
4749
return null;
4850
}

frontend/src/app/task-decomp/components/task-decomp-steps.tsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,31 +69,44 @@ type StatusCardProps = {
6969
};
7070

7171
function toStatusCardTone(phase: RunPhase): {
72+
symbol: string;
7273
caption: string;
7374
dotColor: string;
7475
} {
7576
if (phase === "failed") {
7677
return {
78+
symbol: "!",
7779
caption: "実行エラー",
7880
dotColor: "red.400",
7981
};
8082
}
8183

8284
if (phase === "completed") {
8385
return {
86+
symbol: "✓",
8487
caption: "実行完了",
8588
dotColor: "green.400",
8689
};
8790
}
8891

89-
if (phase === "starting" || phase === "waiting") {
92+
if (phase === "starting") {
9093
return {
94+
symbol: "◔",
95+
caption: "開始中",
96+
dotColor: "teal.400",
97+
};
98+
}
99+
100+
if (phase === "waiting") {
101+
return {
102+
symbol: "◕",
91103
caption: "実行中",
92104
dotColor: "teal.400",
93105
};
94106
}
95107

96108
return {
109+
symbol: "•",
97110
caption: "待機中",
98111
dotColor: "gray.400",
99112
};
@@ -113,9 +126,13 @@ function StatusCard({ phase, statusLabel }: StatusCardProps) {
113126
w="fit-content"
114127
maxW="100%"
115128
title={statusLabel}
129+
aria-label={`${tone.caption} (${statusLabel})`}
116130
>
117131
<HStack gap={1.5}>
118132
<Box w={2} h={2} borderRadius="full" bg={tone.dotColor} />
133+
<Text fontSize="xs" color="fg.muted">
134+
{tone.symbol}
135+
</Text>
119136
<Text fontSize="xs" color="fg.muted">
120137
{tone.caption}
121138
</Text>
@@ -461,8 +478,8 @@ export function ResultStep({
461478
<Stack gap={2}>
462479
<Text fontWeight="semibold">前提 / メモ</Text>
463480
<List.Root gap={1}>
464-
{breakdown.assumptions.map((item) => (
465-
<List.Item key={item}>{item}</List.Item>
481+
{breakdown.assumptions.map((item, index) => (
482+
<List.Item key={`${index}-${item}`}>{item}</List.Item>
466483
))}
467484
</List.Root>
468485
</Stack>

0 commit comments

Comments
 (0)