Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f7267f3
refactor(web): container 구조 분리 (#186)
yumin-kim2 Jul 14, 2026
08e3104
Merge remote-tracking branch 'origin/develop' into feat/web/186-todo-…
yumin-kim2 Jul 14, 2026
874f2ba
feat(web): todo 상세 조회 api 연결 (#186)
yumin-kim2 Jul 14, 2026
b0924f5
fix(web): 투두 상세 모달 날짜 요일 표시 수정 (#186)
yumin-kim2 Jul 14, 2026
e11cf4f
feat(web): todo 삭제 api 연결 (#186)
yumin-kim2 Jul 14, 2026
6920a54
fix(web): 플레이 버튼 클릭 시 상세 모달 열림 방지 (#186)
yumin-kim2 Jul 14, 2026
d6779d5
fix(web): 상세 모달 태그 목록 및 다국어 표시 수정 (#186)
yumin-kim2 Jul 14, 2026
9a82258
feat(web): 상세 모달 저장 기능 및 수정 API 연결
yumin-kim2 Jul 14, 2026
f81b863
refactor(web): 투두 모달 훅 구조 정리 (#186)
yumin-kim2 Jul 14, 2026
f33e51b
Merge remote-tracking branch 'origin/develop' into feat/web/186-todo-…
yumin-kim2 Jul 14, 2026
628637d
fix(web): check-types 에러 해결 (#186)
yumin-kim2 Jul 14, 2026
58953fa
Merge remote-tracking branch 'origin/develop' into feat/web/186-todo-…
yumin-kim2 Jul 14, 2026
dfbfb55
fix(web): 메모 typo, 글자 색 수정 (#186)
yumin-kim2 Jul 14, 2026
62d9c39
refactor(web): 상세 모달 구조 리뷰 반영 (#186)
yumin-kim2 Jul 14, 2026
b59931a
fix(web): 모달 레이아웃 수정 (#186)
yumin-kim2 Jul 14, 2026
d8ee8dc
refactor(web): 상세 모달 수정 요청 생성 로직 정리 (#186)
yumin-kim2 Jul 14, 2026
6d97ff4
feat(web): 상세 모달 즉시 수정 저장 연결 (#186)
yumin-kim2 Jul 14, 2026
2bc8ac4
feat(web): 상세 모달 텍스트 수정 디바운스 저장 연결 (#186)
yumin-kim2 Jul 14, 2026
fff3ab7
fix(web): 타이머 진행 중 상세 모달 수정 방지 (#186)
yumin-kim2 Jul 14, 2026
e2f7eea
Merge remote-tracking branch 'origin/develop' into feat/web/186-todo-…
yumin-kim2 Jul 14, 2026
2e73a47
fix(web): 수정 실패 토스트 서버 메시지 표시 (#186)
yumin-kim2 Jul 14, 2026
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 @@ -22,7 +22,7 @@ import type {
TodoPriorityTypes,
TodoTimerStatusTypes,
} from "@/app/[locale]/(main)/(with-time-sidebar)/home/_types/todo-type";
import type { KeyboardEvent, MouseEvent } from "react";
import type { KeyboardEvent, MouseEvent, PointerEvent } from "react";

import { convertDurationToTimeText } from "@/utils/todo/todo-time";

Expand Down Expand Up @@ -103,6 +103,17 @@ export const HomeTodoCard = ({
onClickTodo();
};

const stopInteractiveEvent = (
event: MouseEvent<HTMLButtonElement> | PointerEvent<HTMLButtonElement>,
) => {
event.stopPropagation();
};

const handlePlayClick = (event: MouseEvent<HTMLButtonElement>) => {
stopInteractiveEvent(event);
onTogglePlay();
};

const titleRow = (
<div className="flex w-full items-center justify-between gap-2">
<div className="flex min-w-0 flex-1 items-center gap-1">
Expand All @@ -120,7 +131,8 @@ export const HomeTodoCard = ({
variant={isRunning ? "stop" : "play"}
size="sm"
disabled={isCompleted}
onClick={onTogglePlay}
onClick={handlePlayClick}
onPointerDown={stopInteractiveEvent}
>
{isCompleted ? (
<PlayDisabledIcon />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import {
import { useHomeTodosByDate } from "@/app/[locale]/(main)/(with-time-sidebar)/home/_hooks/use-home-todos-by-date";
import { useHomeViewMode } from "@/app/[locale]/(main)/(with-time-sidebar)/home/_hooks/use-home-view-mode";
import { useHomeView } from "@/app/[locale]/(main)/(with-time-sidebar)/home/_queries/use-home-view";
import { DetailTodoModalContainer } from "@/components/todo-modal/detail/DetailTodoModalContainer";
import { DetailTodoModalContainer } from "@/containers/todo-modal/detail/DetailTodoModalContainer";
import { DndSortableListProvider } from "@/providers/dnd/DndSortableListProvider";
import { formatDateKey } from "@/utils/date/date";
import { isTagLabelKey } from "@/utils/todo/tag-label";
import { getTagLabelKey } from "@/utils/todo/tag-label";

export const HomeTodoContainer = () => {
const tCommon = useTranslations("Common");
Expand Down Expand Up @@ -88,11 +88,15 @@ export const HomeTodoContainer = () => {
<div className="flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pr-1">
{todos.map((todo) => {
const [firstSubtask] = todo.subtasks;
const tagLabelKey = todo.tag
? getTagLabelKey(todo.tag.name)
: undefined;

return (
<DetailTodoModalContainer
key={todo.todoId}
todo={todo}
todoId={todo.todoId}
date={dateKey}
onTogglePlay={() =>
handleTogglePlay(dateKey, todo.todoId)
}
Expand All @@ -107,8 +111,8 @@ export const HomeTodoContainer = () => {
priority={todo.priority}
tagName={
todo.tag &&
(isTagLabelKey(todo.tag.name)
? tCommon(`tag.${todo.tag.name}`)
(tagLabelKey
? tCommon(`tag.${tagLabelKey}`)
: todo.tag.name)
}
hasMemo={todo.hasMemo}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { ApiDayOfWeek } from "@/app/[locale]/(main)/(with-time-sidebar)/hom

import { DateInformation } from "@/app/[locale]/(main)/(with-time-sidebar)/_components/DateInformation";
import { convertDateToDateText } from "@/app/[locale]/(main)/(with-time-sidebar)/home/_utils/date";
import { CreateTodoModalContainer } from "@/components/todo-modal/create/CreateTodoModalContainer";
import { CreateTodoModalContainer } from "@/containers/todo-modal/create/CreateTodoModalContainer";
import { getToday, parseDateKey } from "@/utils/date/date";

export interface HomeDayHeaderContainerProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { DateInformation } from "@/app/[locale]/(main)/(with-time-sidebar)/_comp
import { convertDateToDateText } from "@/app/[locale]/(main)/(with-time-sidebar)/home/_utils/date";
import { useCreateTodoSubmit } from "@/app/[locale]/(main)/(with-time-sidebar)/today/_hooks/todo-modal/use-create-todo-submit";
import { AnimatedToast } from "@/components/toast/AnimatedToast";
import { CreateTodoModalContainer } from "@/components/todo-modal/create/CreateTodoModalContainer";
import { CreateTodoModalContainer } from "@/containers/todo-modal/create/CreateTodoModalContainer";
import { getToday } from "@/utils/date/date";
import { getDayOfWeekKey } from "@/utils/date/get-day-of-week-key";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TodayDateHeaderContainer } from "@/app/[locale]/(main)/(with-time-sideb
import { TodayTodoCardContainer } from "@/app/[locale]/(main)/(with-time-sidebar)/today/_containers/TodayTodoCardContainer";
import { useTodayTodoList } from "@/app/[locale]/(main)/(with-time-sidebar)/today/_hooks/useTodayTodoList";
import { useToday } from "@/app/[locale]/(main)/(with-time-sidebar)/today/_queries/use-today";
import { DetailTodoModalContainer } from "@/components/todo-modal/detail/DetailTodoModalContainer";
import { DetailTodoModalContainer } from "@/containers/todo-modal/detail/DetailTodoModalContainer";
import { formatDate } from "@/utils/date/date";
import { convertDurationToTimeText } from "@/utils/duration/convert-duration-to-time-text";

Expand Down Expand Up @@ -46,7 +46,8 @@ export const TodayTodoListContainer = () => {
{todos.map((todo) => (
<DetailTodoModalContainer
key={todo.todoId}
todo={todo}
todoId={todo.todoId}
date={todo.date.slice(0, 10)}
onTogglePlay={() => handlePlay(todo.todoId)}
onDelete={() => handleDelete(todo.todoId)}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import { AnimatedToast } from "@/components/toast/AnimatedToast";
import { TodoIconField } from "@/components/todo-modal/common/TodoIconField";
import { CreateTodoMemoField } from "@/components/todo-modal/create/CreateTodoMemoField";
import { CreateTodoTaskFields } from "@/components/todo-modal/create/CreateTodoTaskFields";
import { useIconField } from "@/hooks/todo-modal/use-icon-field";
import { useRepeatField } from "@/hooks/todo-modal/use-repeat-field";
import { useSubtaskField } from "@/hooks/todo-modal/use-subtask-field";
import { useTagField } from "@/hooks/todo-modal/use-tag-field";
import { useTimeField } from "@/hooks/todo-modal/use-time-field";
import { useTitleField } from "@/hooks/todo-modal/use-title-field";
import { useTagField } from "@/hooks/todo-modal/common/use-tag-field";
import { useIconField } from "@/hooks/todo-modal/create/use-icon-field";
import { useRepeatField } from "@/hooks/todo-modal/create/use-repeat-field";
import { useSubtaskField } from "@/hooks/todo-modal/create/use-subtask-field";
import { useTimeField } from "@/hooks/todo-modal/create/use-time-field";
import { useTitleField } from "@/hooks/todo-modal/create/use-title-field";
import { formatDateKey } from "@/utils/date/date";

const createDefaultValues = (defaultDate?: Date): CreateTodoRequest => ({
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"use client";

import { DeleteIcon, TrashOnIcon } from "@repo/timo-design-system/icons";
import { TodoToolbar } from "@repo/timo-design-system/ui";
import { CreateButton, TodoToolbar } from "@repo/timo-design-system/ui";
import { useTranslations } from "next-intl";
import { useState } from "react";

import type { Todo } from "@/app/[locale]/(main)/(with-time-sidebar)/home/_types/todo-type";
import type {
TodoDetailResponse,
TodoUpdateRequest,
} from "@/api/generated/models";
import type { TimeSelection } from "@repo/timo-design-system/ui";

import { OverlayModal } from "@/components/modal/OverlayModal";
Expand All @@ -16,18 +17,25 @@ import {
DETAIL_TODO_TIME_OPTIONS,
DETAIL_TODO_WEEKDAY_IDS,
useDetailTodoForm,
} from "@/hooks/todo-modal/use-detail-todo-form";
} from "@/hooks/todo-modal/detail/use-detail-todo-form";
import { formatShortDateLabel } from "@/utils/date/date";

const DETAIL_TODO_MEMO_MAX_LENGTH = 300;
type DetailTodoWeekdayId = (typeof DETAIL_TODO_WEEKDAY_IDS)[number];

const isDetailTodoWeekdayId = (
dayOfWeek: string,
): dayOfWeek is DetailTodoWeekdayId =>
(DETAIL_TODO_WEEKDAY_IDS as readonly string[]).includes(dayOfWeek);

export interface DetailTodoModalContentProps {
isOpen: boolean;
onClose: () => void;
onExited: () => void;
todo: Todo;
todo: TodoDetailResponse;
onTogglePlay: () => void;
onDelete: () => void;
onSubmit: (data: TodoUpdateRequest) => void;
}

export const DetailTodoModalContent = ({
Expand All @@ -37,13 +45,18 @@ export const DetailTodoModalContent = ({
todo,
onTogglePlay,
onDelete,
onSubmit,
}: DetailTodoModalContentProps) => {
const t = useTranslations("Home.detailModal");
const tCreateModal = useTranslations("Home.createModal");
const tCommon = useTranslations("Common");
const detailTodoForm = useDetailTodoForm({ todo });
const [selectedTime, setSelectedTime] = useState<TimeSelection>();
const [isIconPanelOpen, setIsIconPanelOpen] = useState(false);
const dateNumber = detailTodoForm.date.getDate();
const dayOfWeek = isDetailTodoWeekdayId(todo.dayOfWeek)
? todo.dayOfWeek
: "MON";
const weekdays = DETAIL_TODO_WEEKDAY_IDS.map((weekdayId) => ({
id: weekdayId,
label: tCommon(`weekday.${weekdayId}`),
Expand All @@ -56,14 +69,17 @@ export const DetailTodoModalContent = ({

const handleDelete = () => {
onDelete();
onClose();
};
Comment thread
yumin-kim2 marked this conversation as resolved.
Resolved

const handleSelectTime = (nextTime: TimeSelection) => {
setSelectedTime(nextTime);
detailTodoForm.selectTime(nextTime);
};

const handleSubmit = () => {
onSubmit(detailTodoForm.buildUpdateRequest());
};
Comment thread
yumin-kim2 marked this conversation as resolved.
Resolved

return (
<OverlayModal
isOpen={isOpen}
Expand All @@ -72,7 +88,12 @@ export const DetailTodoModalContent = ({
ariaLabel={t("ariaLabel")}
className="w-124 items-start px-7.5 py-5"
>
<div className="flex w-full justify-end">
<div className="flex w-full justify-between">
<CreateButton
label={t("save")}
disabled={!detailTodoForm.title.trim()}
onClick={handleSubmit}
/>
<button type="button" aria-label={tCommon("close")} onClick={onClose}>
<DeleteIcon />
</button>
Expand All @@ -81,9 +102,9 @@ export const DetailTodoModalContent = ({
<div className="flex w-full flex-col gap-3">
<div className="flex w-full flex-col gap-2">
<div className="flex flex-col">
<p className="typo-headline-b-30 text-timo-black">22</p>
<p className="typo-headline-b-30 text-timo-black">{dateNumber}</p>
<p className="typo-body-m-12 text-timo-gray-700">
{tCommon("weekday.MON")}
{tCommon(`weekday.${dayOfWeek}`)}
</p>
</div>

Expand Down Expand Up @@ -135,13 +156,15 @@ export const DetailTodoModalContent = ({
LOW: tCommon("priority.low"),
}}
onSelectPriority={detailTodoForm.setPriority}
tagLabel={detailTodoForm.selectedTag}
tags={[detailTodoForm.tagLabel]}
selectedTag={detailTodoForm.selectedTag}
tagLabel={
detailTodoForm.selectedTagLabel ?? tCreateModal("tagLabel")
}
tags={detailTodoForm.tagLabels}
selectedTag={detailTodoForm.selectedTagLabel}
addTagLabel={tCreateModal("addTag")}
onSelectTag={detailTodoForm.setSelectedTag}
onSelectTag={detailTodoForm.handleSelectTag}
onAddTagClick={() => {}}
hasMemo={todo.hasMemo}
hasMemo={Boolean(todo.memo?.trim())}
isRepeatActive={detailTodoForm.isRepeatActive}
repeat={{
frequencyHeading: t("repeatFrequencyHeading"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
} from "@repo/timo-design-system/icons";
import { Checkbox, PlayButton } from "@repo/timo-design-system/ui";

import type { TodoTimerStatusTypes } from "@/app/[locale]/(main)/(with-time-sidebar)/home/_types/todo-type";
import type { DetailTodoSubtaskInput } from "@/hooks/todo-modal/use-detail-subtask-field";
import type { TodoDetailResponseTimerStatus } from "@/api/generated/models";
import type { DetailTodoSubtaskInput } from "@/hooks/todo-modal/detail/use-detail-subtask-field";
import type { KeyboardEvent } from "react";

const resizeTextarea = (element: HTMLTextAreaElement | null) => {
Expand All @@ -18,7 +18,7 @@ const resizeTextarea = (element: HTMLTextAreaElement | null) => {
export interface DetailTodoTaskFieldsProps {
titleValue: string;
isCompleted: boolean;
timerStatus: TodoTimerStatusTypes;
timerStatus: TodoDetailResponseTimerStatus;
subtaskInputs: DetailTodoSubtaskInput[];
onTitleChange: (value: string) => void;
onToggleCompleted: (completed: boolean) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { CreateTodoRequest } from "@/api/common/todo-schema";

import { AnimatedToast } from "@/components/toast/AnimatedToast";
import { CreateTodoModalContent } from "@/components/todo-modal/create/CreateTodoModalContent";
import { useCreateTodoSubmit } from "@/hooks/todo-modal/use-create-todo-submit";
import { useCreateTodoSubmit } from "@/hooks/todo-modal/create/use-create-todo-submit";

export interface CreateTodoModalContainerProps {
defaultDate?: Date;
Expand Down
Loading
Loading