From 1dad25a98dd2c0eb9578e12643f04d338905f97f Mon Sep 17 00:00:00 2001 From: nenrin Date: Sun, 22 Feb 2026 04:54:17 +0900 Subject: [PATCH 01/16] move root page to task-decomp route --- frontend/src/app/{ => task-decomp}/page.tsx | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/src/app/{ => task-decomp}/page.tsx (100%) diff --git a/frontend/src/app/page.tsx b/frontend/src/app/task-decomp/page.tsx similarity index 100% rename from frontend/src/app/page.tsx rename to frontend/src/app/task-decomp/page.tsx From f4201a297f3da3c8b0be75b286d744aa8b93faf9 Mon Sep 17 00:00:00 2001 From: nenrin Date: Sun, 22 Feb 2026 04:59:46 +0900 Subject: [PATCH 02/16] split task-decomp page into helpers and step components --- .../components/task-decomp-steps.tsx | 487 ++++++++++++ frontend/src/app/task-decomp/constants.ts | 13 + frontend/src/app/task-decomp/helpers.ts | 231 ++++++ frontend/src/app/task-decomp/page.tsx | 716 ++---------------- frontend/src/app/task-decomp/types.ts | 5 + 5 files changed, 808 insertions(+), 644 deletions(-) create mode 100644 frontend/src/app/task-decomp/components/task-decomp-steps.tsx create mode 100644 frontend/src/app/task-decomp/constants.ts create mode 100644 frontend/src/app/task-decomp/helpers.ts create mode 100644 frontend/src/app/task-decomp/types.ts diff --git a/frontend/src/app/task-decomp/components/task-decomp-steps.tsx b/frontend/src/app/task-decomp/components/task-decomp-steps.tsx new file mode 100644 index 0000000..0443f79 --- /dev/null +++ b/frontend/src/app/task-decomp/components/task-decomp-steps.tsx @@ -0,0 +1,487 @@ +"use client"; + +import { + Badge, + Button, + Card, + Field, + Heading, + HStack, + Input, + List, + ProgressCircle, + Stack, + Tabs, + Text, + Textarea, +} from "@chakra-ui/react"; +import type { FormEvent } from "react"; +import { AuthPanel } from "@/components/auth/auth-panel"; +import type { SessionResponse } from "@/lib/auth-api"; +import type { WorkflowRecord } from "@/lib/task-workflow-api"; +import { + formatDateTime, + toHistoryTitle, + toStatusLabelFromRecord, +} from "../helpers"; +import type { ResultTab, RunPhase } from "../types"; + +type AuthStepProps = { + onSessionChanged: (nextSession: SessionResponse) => void; +}; + +type ComposeStepProps = { + task: string; + context: string; + deadline: string; + maxSteps: string; + onTaskChange: (value: string) => void; + onContextChange: (value: string) => void; + onDeadlineChange: (value: string) => void; + onMaxStepsChange: (value: string) => void; + onSubmit: (event: FormEvent) => void; + displayErrorMessage: string | null; + requiresCalendarReauth: boolean; + onCalendarReauth: () => void; + isReauthRunning: boolean; + phase: RunPhase; + isSessionLoading: boolean; + history: WorkflowRecord[]; + onSelectHistory: (item: WorkflowRecord) => void; +}; + +type RunningStepProps = { + workflowProgress: number; + phase: RunPhase; + waitingDots: string; + statusLabel: string; + displayErrorMessage: string | null; + requiresCalendarReauth: boolean; + onCalendarReauth: () => void; + isReauthRunning: boolean; +}; + +type ResultStepProps = { + phase: RunPhase; + statusLabel: string; + resultTab: ResultTab; + onResultTabChange: (tab: ResultTab) => void; + record: WorkflowRecord | null; + history: WorkflowRecord[]; + displayErrorMessage: string | null; + onStartNewTask: () => void; + onSelectHistory: (item: WorkflowRecord) => void; +}; + +export function AuthStep({ onSessionChanged }: AuthStepProps) { + return ( + + + まずGoogleでログインし、カレンダー連携権限を許可してください。 + 認証後はタスク入力画面に進みます。 + + + + ); +} + +export function ComposeStep({ + task, + context, + deadline, + maxSteps, + onTaskChange, + onContextChange, + onDeadlineChange, + onMaxStepsChange, + onSubmit, + displayErrorMessage, + requiresCalendarReauth, + onCalendarReauth, + isReauthRunning, + phase, + isSessionLoading, + history, + onSelectHistory, +}: ComposeStepProps) { + return ( + +
+ + + 細分化したいタスク +