Repository: llddang/todayeat
Pull request #192: Refactor/#183 식단기록페이지 디자인qa 코드리팩토링
Author: login: woohyuckk
Labels: name: 🎨 Design
description: 마크업 & CSS 스타일링
name: 🔨 Refactor
description: 코드 리팩토링
name: ✅ 리뷰 완료
description: 나는 마지막 리뷰어다. 나까지 하면 리뷰 끝!
Created: 2025-04-21T08:16:26Z | Merged: 2025-04-23T01:05:05Z

## #️⃣ 연관된 이슈

- close #183

<br>

## 📝 작업 내용

- [x] 이미지 추가 버튼 크기 화면에 꽉차도록 수정
- [x] 로딩 이미지와 텍스트를 화면 가운데로 정렬
- [x] 이미지 캐러셀 페이지네이션 추가 필요
- [x] 식사 시간 카테고리 간격 수정
- [x] 시간이 현재 시간으로 자동 적용되지 않음
- [x] 무게와 칼로리입력시 3자리 이상에 , 표시 추가  


### 기능추가
- [x] : 텍스트기반 메뉴 수정이 추가되었습니다. 
<br>

## 🖼 스크린샷

### 카테고리 간격 슬라이드 형식으로 수정 및 바텀시트 꺼지는 현상 수정
https://github.com/user-attachments/assets/8a60d9d2-3ecc-458e-90d5-915ea966ba38

### 메뉴 재분석 기능 추가 
https://github.com/user-attachments/assets/7e7562df-140c-46cd-a885-d781b4abf415

<br>

## 💬 리뷰 요구사항

> 리뷰시간 `20분`

프롬프트에 소숫점을 제외하고 응답해주세요.를 추가했지만 소숫점을 결과로 보여주는 경우가 있습니다. 임시로 수정한거라 라우트핸들러가 수정될 때 점검해보겠습니다!

카드의 재분석 로딩에는 고정 `height`가 있지만, 기존 메뉴에는 고정 높이가 없어서 로딩 UI가 로드되고나서 레이아웃 쉬프트 현상이 발생됩니다. 처음 시도에만 발생하며 두번째 시도부터는 발생하지 않는데, 카드의 크기도 고정 크기로 변경해도 괜찮을까요?!

`pagenation`이 제 build 환경에서는 보이는데 혹시모르니 한번씩 체크 부탁드립니다!!
![image](https://github.com/user-attachments/assets/e03fbb0b-2b9f-43a0-8349-28086fb4dbc8)



<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **신규 기능**
    - 식사 시간 선택을 위한 TimePicker 컴포넌트와 식사 결과 편집을 위한 EditResultSection 컴포넌트가 추가되었습니다.
    - 배경 없는 AI 로더 컴포넌트가 추가되었습니다.
    - 크로스 브라우저 스크롤바 숨김 유틸리티 클래스(.scrollbar-hidden)가 추가되었습니다.

- **버그 수정**
    - 이미지 업로드 섹션의 레이아웃 및 스타일이 개선되어 전체 너비 적용 및 최소 높이 계산이 수정되었습니다.
    - 이미지 캐러셀에서 브라우저 환경에서만 페이지네이션이 활성화되도록 조건이 추가되었습니다.

- **리팩터링**
    - 식사 편집 페이지가 클라이언트 컴포넌트에서 서버 사이드 렌더링 방식으로 변경되어, 데이터 조회 및 렌더링 구조가 간소화되었습니다.
    - EditCard 컴포넌트의 입력 및 삭제 방식이 개선되고, 숫자 입력 포맷팅 및 분석 버튼 활성화 조건이 명확해졌습니다.
    - formatTimestamp 함수가 입력 파라미터 구조 변경 및 ISO 8601 형식 반환으로 개선되었습니다.

- **스타일**
    - 일부 컴포넌트의 레이아웃 및 스타일 클래스가 개선되었습니다.
    - RestoreAnalysisModal 컴포넌트의 버튼 영역 레이아웃이 수직 정렬 및 간격 적용으로 변경되었습니다.
    - MacronutrientBox 컴포넌트 내 텍스트 간격이 축소되었습니다.

- **문서화**
    - formatTimestamp 함수의 입력 파라미터와 반환값에 대한 설명이 명확히 업데이트되었습니다.

- **기타**
    - AI 프롬프트 내 영양소 값 표기 방식이 정수로 명확하게 변경되었습니다.
    - 여러 컴포넌트 및 유틸리티 함수의 내보내기(export) 및 타입 선언이 추가 또는 변경되었습니다.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Linked issue #183: [Rafactor] 식단 기록페이지 QA 반영 및 코드리팩토링
# ✨ Feature

### 1. 어떤 기능인가요?

- 현재 개발하고자 하는 기능의 배경 및 주 기능 간략 설명

<br>

### 2. 작업 상세 내용

- [x] 이미지 추가 버튼 크기 화면에 꽉차도록 수정
- [x] 로딩 이미지와 텍스트를 화면 가운데로 정렬
- [x] 이미지 캐러셀 페이지네이션 추가 필요
- [x] 식사 시간 카테고리 간격 수정
- [x] 시간이 현재 시간으로 자동 적용되지 않음
- [x] 무게와 칼로리입력시 3자리 이상에 , 표시 추가  

<br>

### 3. 참고할만한 자료 (선택)


Diff:
diff --git a/src/apis/gemini.api.ts b/src/apis/gemini.api.ts
index c2df9578..83d25e09 100644
--- a/src/apis/gemini.api.ts
+++ b/src/apis/gemini.api.ts
@@ -40,7 +40,7 @@ const FOOD_IMAGE_ANALYSIS_PROMPT = `
   2. 1인분 기준의 대략적인 예상 중량(g, "weight")
   3. 2번의 예상 중량 기준의 대략적인 예상 칼로리(kcal, "calories")
   4. 주요 영양성분 : 탄수화물(g, "carbohydrate"), 단백질(g, "protein"), 지방(g, "fat")
-  
+  5. 영양 성분은 소수점을 제외하고 정수로 응답해주세요.
   예시와 같은 형식으로 응답하세요.
   ⚠️ 절대 마크다운 코드 블록(예: \`\`\`json)을 포함하지 마세요.
   반드시 예시 형식을 그대로 따라하세요. 형식을 지키지 않으면 응답이 무효 처리됩니다.
diff --git a/src/app/(client)/meal/components/meal-images-carousel.tsx b/src/app/(client)/meal/components/meal-images-carousel.tsx
index 0d718902..78410995 100644
--- a/src/app/(client)/meal/components/meal-images-carousel.tsx
+++ b/src/app/(client)/meal/components/meal-images-carousel.tsx
@@ -3,6 +3,7 @@
 import { useEffect, useState } from 'react';
 import Image from 'next/image';
 import { Carousel, CarouselContent, CarouselItem, type CarouselApi } from '@/components/ui/carousel';
+import { isClient } from '@/utils/predicate.util';
 
 const MealImageCarousel = ({ imageList, pagination = true }: { imageList: string[]; pagination?: boolean }) => {
   const [api, setApi] = useState<CarouselApi>();
@@ -31,7 +32,7 @@ const MealImageCarousel = ({ imageList, pagination = true }: { imageList: string
     if (api) api.scrollTo(index);
   };
   // 페이지네이션이 사용 가능한 경우 - api 로드 완료 && 페이지네이션 사용 true && 이미지 1개 이상
-  const isPaginationOn = api && pagination && count > 1;
+  const isPaginationOn = isClient() && api && pagination && count > 1;
   return (
     <Carousel setApi={setApi} className="w-full overflow-hidden rounded-2xl">
       <CarouselContent className="ml-0 gap-4">
diff --git a/src/app/(client)/meal/post/components/restore-analysis-modal.tsx b/src/app/(client)/meal/post/components/restore-analysis-modal.tsx
index 9a79f2d0..83aff256 100644
--- a/src/app/(client)/meal/post/components/restore-analysis-modal.tsx
+++ b/src/app/(client)/meal/post/components/restore-analysis-modal.tsx
@@ -16,7 +16,12 @@ type RestoreAnalysisModalProps = {
   onApproveClickHandler: () => void;
   onCancelClickHandler: () => void;
 };
-const RestoreAnalysisModal = ({ open, onOpenChange, onApproveClickHandler, onCancelClickHandler }: RestoreAnalysisModalProps) => {
+const RestoreAnalysisModal = ({
+  open,
+  onOpenChange,
+  onApproveClickHandler,
+  onCancelClickHandler
+}: RestoreAnalysisModalProps) => {
   return (
     <AlertDialog open={open} onOpenChange={onOpenChange}>
       <AlertDialogContent>
@@ -25,7 +30,7 @@ const RestoreAnalysisModal = ({ open, onOpenChange, onApproveClickHandler, onCan
 
           <AlertDialogDescription>등록하던 정보가 있습니다. 사용하시겠습니까?</AlertDialogDescription>
         </AlertDialogHeader>
-        <AlertDialogFooter>
+        <AlertDialogFooter className="flex flex-col gap-2">
           <Button variant="primary" onClick={onApproveClickHandler}>
             예
           </Button>
diff --git a/src/app/(client)/meal/post/components/upload-image-section.tsx b/src/app/(client)/meal/post/components/upload-image-section.tsx
index dd72b97b..005d4d71 100644
--- a/src/app/(client)/meal/post/components/upload-image-section.tsx
+++ b/src/app/(client)/meal/post/components/upload-image-section.tsx
@@ -1,9 +1,9 @@
 'use client';
 import { Typography } from '@/components/ui/typography';
 import React, { useState } from 'react';
-import MealPostAddMealAiLoading from '@/app/(client)/meal/post/components/meal-post-add-meal-ai-loading';
-import MealPostAddImageForm from '@/app/(client)/meal/post/components/meal-post-add-image-form';
-import useRestoreAnalysisModal from '../hooks/use-restore-analys-modal';
+import MealPostAddMealAiLoading from './meal-post-add-meal-ai-loading';
+import MealPostAddImageForm from './meal-post-add-image-form';
+import useRestoreAnalysisModal from '../hooks/use-restore-analysis-modal';
 import RestoreAnalysisModal from './restore-analysis-modal';
 
 type UploadImageSectionProps = {
@@ -16,14 +16,14 @@ const UploadImageSection = ({ isRecorded }: UploadImageSectionProps): JSX.Elemen
 
   if (isLoading) {
     return (
-      <div className="flex min-h-[calc(100vh-60px)] items-center justify-center">
+      <div className="flex min-h-[calc(100vh-8.75rem)] items-center justify-center">
         <MealPostAddMealAiLoading />
       </div>
     );
   }
 
   return (
-    <div className="flex flex-col items-center gap-7 px-4 py-8">
+    <div className="flex w-full flex-col items-center gap-7 px-4 py-8">
       <div className="flex flex-col items-center justify-center gap-2">
         <Typography variant="title2" as="p">
           오늘의 식사를 간편하게 남겨보세요!
diff --git a/src/app/(client)/meal/post/edit/components/ai-loader-without-bg.tsx b/src/app/(client)/meal/post/edit/components/ai-loader-without-bg.tsx
new file mode 100644
index 00000000..d9a3454d
--- /dev/null
+++ b/src/app/(client)/meal/post/edit/components/ai-loader-without-bg.tsx
@@ -0,0 +1,17 @@
+import Lottie from 'react-lottie-player';
+import AiLoaderStar from '@/../public/lottie/ai-loader-star.json';
+
+const AiLoaderWithoutBg = () => {
+  return (
+    <div className="relative flex aspect-square w-20 items-center justify-center">
+      <Lottie
+        loop
+        play
+        animationData={AiLoaderStar}
+        className="absolute left-1/2 top-1/2 w-full -translate-x-1/2 -translate-y-1/2 object-contain"
+      />
+    </div>
+  );
+};
+
+export default AiLoaderWithoutBg;
diff --git a/src/app/(client)/meal/post/edit/components/edit-card.tsx b/src/app/(client)/meal/post/edit/components/edit-card.tsx
index b0a43032..1ac6d976 100644
--- a/src/app/(client)/meal/post/edit/components/edit-card.tsx
+++ b/src/app/(client)/meal/post/edit/components/edit-card.tsx
@@ -1,57 +1,55 @@
 'use client';
-import { useFieldArray, useFormContext } from 'react-hook-form';
-import { FormEvent, useState } from 'react';
+import { Controller, useFormContext } from 'react-hook-form';
+import { useMemo, useState } from 'react';
 import MacronutrientBox from '@/components/commons/macronutrient-box';
 import IconButton from '@/components/commons/icon-button';
 import { Button } from '@/components/ui/button';
 import { MacronutrientEnum } from '@/types/nutrition.type';
 import {} from '@/types/DTO/meal.dto';
-import { CreateAiFullResponseDTO } from '@/types/DTO/ai_analysis.dto';
+import { AiResponseDTO } from '@/types/DTO/ai_analysis.dto';
 import dynamic from 'next/dynamic';
 import { Input } from '@/components/ui/input';
+import { formatNumberWithComma } from '@/utils/format.util';
+import { parseGeminiResponse } from '@/lib/gemini';
+import { generateCaloriesAnalysisByText } from '@/apis/gemini.api';
+import { Typography } from '@/components/ui/typography';
 
-const AiLoaderLottie = dynamic(() => import('@/components/commons/ai-loader-lottie'), {
+const AiLoaderWithoutBg = dynamic(() => import('./ai-loader-without-bg'), {
   ssr: false
 });
 
 type EditCardProps = {
-  mealDetail: CreateAiFullResponseDTO;
+  mealDetail: AiResponseDTO;
   idx: number;
+  onRemove: (idx: number) => void;
 };
 
-const EditCard = ({ mealDetail, idx }: EditCardProps) => {
-  const { control, getValues, register } = useFormContext();
+const EditCard = ({ mealDetail, idx, onRemove }: EditCardProps) => {
+  const { control, register, watch, setValue, getValues } = useFormContext();
   const [isLoading, setIsLoading] = useState(false);
 
-  const { remove: mealListRemove } = useFieldArray({ control, name: 'mealList' });
-  const { remove: mealsRemove } = useFieldArray({ control, name: 'meals' });
-
-  // TODO: 카드에서API 분석요청
-  // const menuName = watch(`meals.${idx}.menuName`);
-  // const weight = watch(`meals.${idx}.weight`);
-
-  // const isChanged = useMemo(() => {
-  //   const isMenuChanged = menuName !== mealDetail.menuName;
-  //   const isWeightChanged = weight !== mealDetail.weight;
-
-  //   const isAnalyzed = isMenuChanged || isWeightChanged;
-  //   return isAnalyzed;
-  // }, [weight, menuName, mealDetail]);
+  const menuName = watch(`mealList.${idx}.menuName`);
+  const weight = watch(`mealList.${idx}.weight`);
+  const menuDetail = watch(`mealList.${idx}`);
+  const isChanged = useMemo(() => {
+    const isMenuChanged = menuName !== mealDetail.menuName;
+    const isWeightChanged = weight !== mealDetail.weight;
+    const isAnalyzed = isMenuChanged || isWeightChanged;
+    return isAnalyzed;
+  }, [weight, menuName, mealDetail]);
 
   const handleAnalyze = async () => {
     setIsLoading(true);
     try {
-      const input = getValues(`meals.${idx}`);
-      if (!input.menuName) {
-        alert('메뉴명은 필수항목 입니다.');
-        return;
-      }
-      if (!input.weight || !input.calories) {
-        alert('무게와 칼로리를 모르실 경우 0을 입력해주세요.');
-      }
+      const generatedTextResult = await generateCaloriesAnalysisByText(menuName, weight);
+      const parsedResult = parseGeminiResponse(generatedTextResult);
+      const aiResult = parsedResult[0];
+
+      const meal = getValues(`mealList.${idx}`);
+      const newDetail = { ...meal, ...aiResult };
+      setValue(`mealList.${idx}`, newDetail);
     } catch (error) {
       console.error('식단 분석요청에 실패하였습니다.', error);
-
       alert('분석에 실패했습니다. 다시 시도해주세요.');
     } finally {
       setIsLoading(false);
@@ -60,52 +58,66 @@ const EditCard = ({ mealDetail, idx }: EditCardProps) => {
   const handleDelete = async () => {
     const isConfirm = window.confirm('정말 삭제하시겠습니까?');
     if (isConfirm) {
-      mealListRemove(idx);
-      mealsRemove(idx);
+      onRemove(idx);
     }
   };
 
-  const onHandleMaxLengthInput = (e: FormEvent<HTMLInputElement>) => {
-    e.currentTarget.value = e.currentTarget.value.replace(/[^0-9]/g, '').slice(0, MAX_NUMERIC_LENGTH);
-  };
-
   return (
     <div className="flex w-full flex-col items-center justify-center gap-2 self-stretch rounded-2xl bg-white/50 p-2 backdrop-blur-[50px]">
       {isLoading ? (
-        <AiLoaderLottie />
+        <div className="flex h-[11.875rem] w-full flex-col items-center justify-center rounded-xl bg-white">
+          <AiLoaderWithoutBg />
+          <Typography as="span" variant="subTitle1" className="w-full text-center">
+            AI가 다시 분석하고 있어요!
+          </Typography>
+          <Typography as="span" variant="body3" className="w-full pt-2 text-center text-gray-700">
+            조금만 기다려 주세요. <br />
+            칼로리와 영양 정보를 분석 중이에요!
+          </Typography>
+        </div>
       ) : (
         <div className="flex flex-col items-start gap-2 self-stretch rounded-xl bg-white p-3">
-          <Input
-            onInput={onHandleMaxLengthInput}
-            {...register(`meals.${idx}.menuName`, { required: true })}
-            defaultValue={mealDetail.menuName}
-          />
+          <Input {...register(`mealList.${idx}.menuName`, { required: true })} maxLength={MAX_MENU_NAME_LENGTH} />
           <div className="flex items-start gap-2 self-stretch">
-            <Input
-              measure={MEASUREMENT_UNIT['GRAM'].unit}
-              type="number"
-              onInput={onHandleMaxLengthInput}
-              inputMode="numeric"
-              {...register(`meals.${idx}.weight`, {
-                valueAsNumber: true
-              })}
-              className="flex-1"
+            <Controller
+              control={control}
+              name={`mealList.${idx}.weight`}
               defaultValue={mealDetail.weight}
+              render={({ field: { value, onChange, ...rest } }) => (
+                <Input
+                  {...rest}
+                  type="text"
+                  inputMode="numeric"
+                  maxLength={MAX_NUMERIC_LENGTH}
+                  measure={MEASUREMENT_UNIT['GRAM'].unit}
+                  value={value !== undefined ? formatNumberWithComma(value) : ''}
+                  onChange={(e) => onChange(parseNumber(e.target.value))}
+                  className="flex-1"
+                />
+              )}
             />
-            <Input
-              measure={MEASUREMENT_UNIT['KCAL'].unit}
-              type="number"
-              className="flex-1"
-              {...register(`meals.${idx}.calories`, {
-                valueAsNumber: true
-              })}
+            <Controller
+              control={control}
+              name={`mealList.${idx}.calories`}
               defaultValue={mealDetail.calories}
+              render={({ field: { value, onChange, ...rest } }) => (
+                <Input
+                  {...rest}
+                  type="text"
+                  inputMode="numeric"
+                  measure={MEASUREMENT_UNIT['KCAL'].unit}
+                  maxLength={MAX_NUMERIC_LENGTH}
+                  value={value !== undefined ? formatNumberWithComma(value) : ''}
+                  onChange={(e) => onChange(parseNumber(e.target.value))}
+                  className="flex-1"
+                />
+              )}
             />
           </div>
           <div className="flex items-center gap-2 self-stretch pb-1 pl-1 pt-2">
-            <MacronutrientBox variety={MacronutrientEnum.CARBOHYDRATE} value={mealDetail.carbohydrate} />
-            <MacronutrientBox variety={MacronutrientEnum.PROTEIN} value={mealDetail.protein} />
-            <MacronutrientBox variety={MacronutrientEnum.FAT} value={mealDetail.fat} />
+            <MacronutrientBox variety={MacronutrientEnum.CARBOHYDRATE} value={menuDetail.carbohydrate} />
+            <MacronutrientBox variety={MacronutrientEnum.PROTEIN} value={menuDetail.protein} />
+            <MacronutrientBox variety={MacronutrientEnum.FAT} value={menuDetail.fat} />
           </div>
         </div>
       )}
@@ -114,11 +126,11 @@ const EditCard = ({ mealDetail, idx }: EditCardProps) => {
         <Button
           variant="primary"
           type="button"
-          disabled
+          disabled={!isChanged}
           onClick={handleAnalyze}
           className="flex flex-1 items-center justify-center"
         >
-          재분석 기능은 추후 개발 예정입니다.
+          다시 분석하기
         </Button>
       </div>
     </div>
@@ -128,7 +140,7 @@ const EditCard = ({ mealDetail, idx }: EditCardProps) => {
 export default EditCard;
 
 const MAX_NUMERIC_LENGTH = 4;
-
+const MAX_MENU_NAME_LENGTH = 16;
 const MEASUREMENT_UNIT: Record<MeasurementUnitType, MeasurementUnitValues> = {
   KCAL: {
     label: '칼로리',
@@ -149,3 +161,7 @@ type MeasurementUnitValues = {
 };
 
 type MeasurementUnitType = 'KCAL' | 'GRAM';
+
+const parseNumber = (value: string) => {
+  return Number(value.replace(/,/g, ''));
+};
diff --git a/src/app/(client)/meal/post/edit/components/edit-result-section.tsx b/src/app/(client)/meal/post/edit/components/edit-result-section.tsx
new file mode 100644
index 00000000..46153e1f
--- /dev/null
+++ b/src/app/(client)/meal/post/edit/components/edit-result-section.tsx
@@ -0,0 +1,251 @@
+'use client';
+
+import { AiResponseDTO } from '@/types/DTO/ai_analysis.dto';
+import { MealCategory } from '@/types/meal-category.type';
+import { createMealWithDetails, deleteMealAnalysisDetail } from '@/apis/meal.api';
+import { uploadImage } from '@/apis/storage.api';
+import SITE_MAP from '@/constants/site-map.constant';
+import { formatTimestamp } from '@/utils/format.util';
+import { urlToFile } from '../../../utils/file.util';
+import { zodResolver } from '@hookform/resolvers/zod';
+import { z } from 'zod';
+import { FormProvider, useFieldArray, useForm } from 'react-hook-form';
+import { useRouter } from 'next/navigation';
+import { useState } from 'react';
+import EditCard from './edit-card';
+import MealImageCarousel from '../../../components/meal-images-carousel';
+import { Typography } from '@/components/ui/typography';
+import GlassBackground from '@/components/commons/glass-background';
+import TagSelectItem from '@/components/commons/tag-select-item';
+import MealEditCalendar from './meal-edit-calendar';
+import Textarea from '@/components/commons/textarea';
+import { Button } from '@/components/ui/button';
+import TimePicker, { TimeFields } from './time-picker';
+
+type EditResultSectionProps = {
+  imageList: string[];
+  initialMealList: AiResponseDTO[];
+};
+
+const EditResultSection = ({ imageList, initialMealList }: EditResultSectionProps): JSX.Element => {
+  const router = useRouter();
+  const [isLoading, setIsLoading] = useState(false);
+  const { meridiem, hours, minutes } = getTimeFieldsFromDate();
+
+  const mealFormMethods = useForm({
+    resolver: zodResolver(mealEditFormSchema),
+    defaultValues: {
+      mealImages: imageList,
+        mealList: initialMealList,
+      date: {
+        day: new Date(),
+        meridiem,
+        hours,
+        minutes
+      },
+      mealCategory: MealCategory.BREAKFAST,
+      memo: ''
+    },
+    mode: 'onBlur'
+  });
+
+  const { fields: mealCardList, remove } = useFieldArray({ control: mealFormMethods.control, name: 'mealList' });
+
+  const day = mealFormMethods.getValues('date.day');
+  const date = mealFormMethods.watch('date');
+
+  const handleDayChange = (day: Date) => mealFormMethods.setValue('date.day', day);
+
+  const handleTimeChange = (time: TimeFields) => {
+    mealFormMethods.setValue('date.meridiem', time.meridiem);
+    mealFormMethods.setValue('date.hours', time.hours);
+    mealFormMethods.setValue('date.minutes', time.minutes);
+  };
+
+  const onSubmit = async (form: MealEditFormData) => {
+    const files = await Promise.all(form.mealImages.map((url, idx) => urlToFile(url, idx)));
+    setIsLoading(true);
+    try {
+      if (!form) {
+        return alert(' 데이터 형식이 올바르지 않습니다.');
+      }
+
+      const { date, memo, mealCategory, mealList } = form;
+      const ateAt = formatTimestamp(date);
+      const storedImageUrls: string[] = [];
+      for (const file of files) {
+        const formData = new FormData();
+        formData.append('file', file);
+        const { data: fileUrl } = await uploadImage('meal', formData);
+        if (fileUrl) {
+          storedImageUrls.push(fileUrl);
+        }
+      }
+
+      const newMeals = {
+        foodImages: storedImageUrls,
+        ateAt,
+        mealCategory,
+        memo
+      };
+      const { mealDetails } = await createMealWithDetails(
+        newMeals,
+        mealList.map((meal) => ({
+          menuName: meal.menuName,
+          weight: meal.weight,
+          calories: meal.calories,
+          carbohydrate: meal.carbohydrate,
+          protein: meal.protein,
+          fat: meal.fat
+        }))
+      );
+      if (mealDetails) {
+        await deleteMealAnalysisDetail();
+        router.push(SITE_MAP.HOME);
+      }
+    } catch (err) {
+      alert('식사 정보 등록에 실패했습니다. 잠시후 다시 시도해주세요');
+      console.error('식사 정보 등록에 실패했습니다.', err);
+      router.refresh();
+    } finally {
+      setIsLoading(false);
+    }
+  };
+
+  return (
+    <div className="px-4 pb-4 pt-2">
+      <MealImageCarousel imageList={imageList} />
+      <FormProvider {...mealFormMethods}>
+        <form onSubmit={mealFormMethods.handleSubmit(onSubmit)}>
+          <section className="mt-10 flex flex-col gap-3">
+            <Typography className="pl-1">
+              음식 정보
+              <Typography variant="subTitle2" as="span" className="ml-2">
+                {mealCardList.length}
+              </Typography>
+            </Typography>
+            {mealCardList.map((meal, idx) => (
+              <EditCard key={meal.id} idx={idx} mealDetail={meal} onRemove={remove} />
+            ))}
+          </section>
+
+          <section className="my-10 flex w-full flex-col items-start justify-center gap-3">
+            <Typography as="h3" variant="body1" className="pl-1">
+              식사 시간
+            </Typography>
+            <GlassBackground className="min-h-auto flex w-full flex-col items-start gap-3 rounded-2xl border-none p-4">
+              <div className="scrollbar-hidden flex w-full items-start justify-between gap-2 overflow-x-auto">
+                {MEAL_CATEGORY.map((option) => {
+                  const field = mealFormMethods.register('mealCategory');
+                  const selected = mealFormMethods.watch('mealCategory');
+                  return (
+                    <TagSelectItem
+                      key={option.value}
+                      id={option.value}
+                      groupName="MEAL_CATEGORY"
+                      icon={option.icon}
+                      label={option.label}
+                      value={option.value}
+                      checked={selected === option.value}
+                      {...field}
+                    />
+                  );
+                })}
+              </div>
+              <div className="flex w-full gap-2">
+                <MealEditCalendar date={day} onDateChange={handleDayChange} />
+                <TimePicker currentTime={date} onTimeChange={handleTimeChange} />
+              </div>
+            </GlassBackground>
+          </section>
+          <section className="space-y-3">
+            <Typography as="h3" variant="body1" className="pl-1">
+              식사 일기
+            </Typography>
+            <GlassBackground className="min-h-auto flex w-full flex-col gap-3 rounded-2xl border-none">
+              <div className="flex items-start justify-between gap-[0.38rem] before:mt-[0.13rem] before:block before:aspect-square before:w-[1.125rem] before:bg-edit-4-icon before:bg-contain before:content-['']">
+                <Typography as="span" variant="subTitle3" className="flex-1 !font-medium text-gray-600">
+                  음식을 먹을 때 어떤 기분이었는지 간단하게 적어주세요. 식습관을 돌아보는데 큰 도움이 돼요!
+                </Typography>
+              </div>
+              <Textarea
+                {...mealFormMethods.register('memo')}
+                className="min-h-60 text-gray-500"
+                maxLength={200}
+                placeholder="예시) 스트레스로 폭식했다, 기분 좋게 잘먹었다, 이 음식 먹고 속이 안 좋았다."
+              />
+            </GlassBackground>
+          </section>
+          <Button type="submit" className="mt-3 w-full" disabled={isLoading}>
+            제출하기
+          </Button>
+        </form>
+      </FormProvider>
+    </div>
+  );
+};
+
+export default EditResultSection;
+const mealListSchema = z.object({
+  id: z.string(),
+  userId: z.string(),
+  menuName: z.string(),
+  weight: z.coerce.number(),
+  calories: z.coerce.number(),
+  carbohydrate: z.coerce.number(),
+  protein: z.coerce.number(),
+  fat: z.coerce.number()
+});
+
+export const dateSchema = z.object({
+  day: z.date(),
+  meridiem: z.enum(['오전', '오후']),
+  hours: z.string(),
+  minutes: z.string()
+});
+
+const mealEditFormSchema = z.object({
+  mealImages: z.array(z.string()),
+  mealList: z.array(mealListSchema),
+  date: dateSchema,
+  mealCategory: z.nativeEnum(MealCategory),
+  memo: z.string()
+});
+
+type MealEditFormData = z.infer<typeof mealEditFormSchema>;
+export type MealEditFormDataType = z.infer<typeof mealEditFormSchema>;
+
+const getTimeFieldsFromDate = (): TimeFields => {
+  const now = new Date();
+  const hours = now.getHours();
+  const minutes = now.getMinutes();
+
+  return {
+    meridiem: hours < 12 ? '오전' : '오후',
+    hours: String(hours % 12 === 0 ? 12 : hours % 12).padStart(2, '0'),
+    minutes: String(minutes).padStart(2, '0')
+  };
+};
+
+const MEAL_CATEGORY = [
+  {
+    value: MealCategory.BREAKFAST,
+    label: '아침',
+    icon: 'before:bg-meal-category-breakfast'
+  },
+  {
+    value: MealCategory.LUNCH,
+    label: '점심',
+    icon: 'before:bg-meal-category-lunch'
+  },
+  {
+    value: MealCategory.DINNER,
+    label: '저녁',
+    icon: 'before:bg-meal-category-dinner'
+  },
+  {
+    value: MealCategory.SNACK,
+    label: '간식',
+    icon: 'before:bg-meal-category-snack'
+  }
+];
diff --git a/src/app/(client)/meal/post/edit/components/time-picker.tsx b/src/app/(client)/meal/post/edit/components/time-picker.tsx
new file mode 100644
index 00000000..98521059
--- /dev/null
+++ b/src/app/(client)/meal/post/edit/components/time-picker.tsx
@@ -0,0 +1,98 @@
+'use client';
+import IconButton from '@/components/commons/icon-button';
+import {
+  Drawer,
+  DrawerClose,
+  DrawerContent,
+  DrawerDescription,
+  DrawerFooter,
+  DrawerTitle,
+  DrawerTrigger
+} from '@/components/ui/drawer';
+import { Typography } from '@/components/ui/typography';
+import { useState } from 'react';
+import Picker from 'react-mobile-picker';
+import { dateSchema } from './edit-result-section';
+import { z } from 'zod';
+import { Button } from '@/components/ui/button';
+
+type TimePickerProps = {
+  currentTime: TimeFields;
+  onTimeChange: (currentTime: TimeFields) => void;
+};
+
+const TimePicker = ({ currentTime, onTimeChange }: TimePickerProps) => {
+  const [isOpen, setIsOpen] = useState<boolean>(false);
+  const [time, setTime] = useState<TimeFields>({
+    meridiem: currentTime.meridiem,
+    hours: currentTime.hours,
+    minutes: currentTime.minutes
+  });
+
+  const handleSelectedTime = () => {
+    onTimeChange(time);
+    setIsOpen(false);
+  };
+
+  return (
+    <Drawer open={isOpen} onOpenChange={setIsOpen} dismissible={true} handleOnly={true}>
+      <DrawerTrigger className="flex flex-1 items-center justify-between gap-2 rounded-lg border-[1px] border-gray-300 bg-white py-[0.81rem] pl-4 pr-3 after:block after:aspect-square after:w-[1.375rem] after:bg-down-line-gray-600-icon after:bg-center after:content-['']">
+        <Typography
+          as="span"
+          variant="body1"
+        >{`${currentTime.meridiem} ${currentTime.hours}:${currentTime.minutes}`}</Typography>
+      </DrawerTrigger>
+
+      <DrawerContent>
+        <DrawerTitle className="flex items-center gap-4 self-stretch pl-1">
+          <Typography as="span" className="flex-1" variant="subTitle2">
+            식사 시간 설정
+          </Typography>
+          <DrawerDescription className="sr-only">식사시간을 설정 할 수 있습니다.</DrawerDescription>
+          <DrawerClose asChild>
+            <IconButton icon="before:bg-close-line-icon" alt="닫기" />
+          </DrawerClose>
+        </DrawerTitle>
+
+        <Picker
+          itemHeight={48}
+          value={time}
+          onChange={(changedTime) => setTime(changedTime)}
+          wheelMode="natural"
+          className="w-full"
+        >
+          {(Object.keys(selections) as (keyof typeof selections)[]).map((name) => (
+            <Picker.Column key={name} name={name}>
+              {selections[name].map((option) => (
+                <Picker.Item key={option} value={option}>
+                  {option}
+                </Picker.Item>
+              ))}
+            </Picker.Column>
+          ))}
+        </Picker>
+
+        <DrawerFooter>
+          <DrawerClose asChild>
+            <Button type="button" onClick={handleSelectedTime}>
+              설정
+            </Button>
+          </DrawerClose>
+        </DrawerFooter>
+      </DrawerContent>
+    </Drawer>
+  );
+};
+
+export default TimePicker;
+
+export type TimeFields = Omit<z.infer<typeof dateSchema>, 'day'>;
+
+const hours = Array.from({ length: 13 }, (_, i) => String(i).padStart(2, '0'));
+const minutes = Array.from({ length: 60 }, (_, i) => String(i).padStart(2, '0'));
+
+const selections = {
+  meridiem: ['오전', '오후'],
+  hours: hours,
+  minutes: minutes
+};
diff --git a/src/app/(client)/meal/post/edit/page.tsx b/src/app/(client)/meal/post/edit/page.tsx
index 05160319..bc0667fe 100644
--- a/src/app/(client)/meal/post/edit/page.tsx
+++ b/src/app/(client)/meal/post/edit/page.tsx
@@ -1,347 +1,37 @@
-'use client';
-
-import MealImageCarousel from '@/app/(client)/meal/components/meal-images-carousel';
-import TagSelectItem from '@/components/commons/tag-select-item';
-import Textarea from '@/components/commons/textarea';
-import { Typography } from '@/components/ui/typography';
+import { redirect } from 'next/navigation';
+import { Metadata } from 'next';
 import { getAiResponses, getFoodImagesById } from '@/apis/analysis-request.api';
 import { getUser } from '@/apis/user.api';
-import { MealCategory } from '@/types/meal-category.type';
-import { zodResolver } from '@hookform/resolvers/zod';
-import { useEffect, useState } from 'react';
-import { FormProvider, useForm } from 'react-hook-form';
-import { z } from 'zod';
-import Picker from 'react-mobile-picker';
-import {
-  Drawer,
-  DrawerClose,
-  DrawerContent,
-  DrawerDescription,
-  DrawerFooter,
-  DrawerTitle,
-  DrawerTrigger
-} from '@/components/ui/drawer';
-import { Button } from '@/components/ui/button';
-import IconButton from '@/components/commons/icon-button';
-import { uploadImage } from '@/apis/storage.api';
-import { formatTimestamp } from '@/utils/format.util';
-import { createMealWithDetails, deleteMealAnalysisDetail } from '@/apis/meal.api';
-import { MealDTO } from '@/types/DTO/meal.dto';
-import MealEditCalendar from '@/app/(client)/meal/post/edit/components/meal-edit-calendar';
-import GlassBackground from '@/components/commons/glass-background';
-import { useRouter } from 'next/navigation';
-import SITE_MAP from '@/constants/site-map.constant';
-import dynamic from 'next/dynamic';
-import EditCard from './components/edit-card';
-import { urlToFile } from '../../utils/file.util';
-const AiLoaderLottie = dynamic(() => import('@/components/commons/ai-loader-lottie'), {
-  ssr: false
-});
-
-const MealPostEditPage = () => {
-  const mealFormMethods = useForm<MealEditFormDataType>({
-    resolver: zodResolver(mealEditFormSchema),
-    defaultValues: {
-      meals: [],
-      mealList: [],
-      mealCategory: MealCategory.BREAKFAST,
-      memo: '',
-      date: {
-        meridiem: '오전',
-        hours: '09',
-        minutes: '00'
-      },
-      day: new Date()
-    }
-  });
+import EditResultSection from './components/edit-result-section';
 
-  const day = mealFormMethods.getValues('day');
-  const handleDayChange = (day: Date) => mealFormMethods.setValue('day', day);
+export const generateMetadata = async (): Promise<Metadata> => {
+  const { id: userId } = await getUser();
+  const { data: imageList } = await getFoodImagesById(userId);
+  const aiResponses = await getAiResponses();
 
-  useEffect(() => {
-    const fetchFoodAnalysisRequests = async () => {
-      const { id: userId } = await getUser();
-      const { data: initialImages } = await getFoodImagesById(userId);
-      const mealList = await getAiResponses();
-
-      if (initialImages) {
-        setFoodImages(initialImages?.imageUrls);
-      }
-      if (mealList) {
-        mealFormMethods.setValue('mealList', mealList);
-        mealFormMethods.setValue(
-          'meals',
-          mealList.map((meal) => ({
-            menuName: meal.menuName,
-            weight: meal.weight,
-            calories: meal.calories
-          }))
-        );
-      }
+  if (!userId || !imageList || aiResponses.length === 0) {
+    return {
+      title: '등록된 식사정보가 없습니다 | 투데잇',
+      description: '식사 정보를 먼저 등록해주세요.'
     };
-    fetchFoodAnalysisRequests();
-  }, []);
-
-  const [foodImages, setFoodImages] = useState<string[]>([]);
-  const [tempTime, setTempTime] = useState<MealEditFormDataType['date']>({
-    meridiem: '오전',
-    hours: '12',
-    minutes: '00'
-  });
-  const [isLoading, setIsLoading] = useState<boolean>(false);
-  const router = useRouter();
-  const date = mealFormMethods.watch('date');
-  const mealList = mealFormMethods.watch('mealList');
-
-  const onSubmit = async (data: MealEditFormDataType) => {
-    const files = await Promise.all(foodImages.map((url, idx) => urlToFile(url, idx)));
-    const imagesFormData = new FormData();
-    setIsLoading(true);
-    try {
-      if (!data) {
-        return alert(' 데이터 형식이 올바르지 않습니다.');
-      }
-
-      const { date, day, memo, mealCategory } = data;
-      const ateAt = formatTimestamp(day, date);
-
-      for (const file of files) {
-        imagesFormData.append('file', file);
-        await uploadImage('meal', imagesFormData);
-      }
-
-      const newMeals = {
-        foodImages,
-        ateAt,
-        mealCategory,
-        memo
-      };
-
-      const newMealDetails = mealList.map((meal) => ({
-        menuName: meal.menuName,
-        weight: meal.weight,
-        calories: meal.calories,
-        carbohydrate: meal.carbohydrate,
-        protein: meal.protein,
-        fat: meal.fat
-      }));
-
-      console.log(newMealDetails);
+  }
 
-      const { mealDetails } = await createMealWithDetails(
-        newMeals as Pick<MealDTO, 'ateAt' | 'foodImages' | 'memo' | 'mealCategory'>,
-        newMealDetails
-      );
-      if (mealDetails) {
-        await deleteMealAnalysisDetail();
-        setIsLoading(false);
-        router.push(SITE_MAP.HOME);
-      }
-    } catch (err) {
-      alert('식사 정보 등록에 실패하였습니다. 잠시후 다시 시도해주세요');
-      console.error('등록에 실패 했습니다. ', err);
-    }
+  return {
+    title: '음식 등록 | 투데잇',
+    description: '오늘 먹은 음식을 등록하고 기록해보세요.'
   };
-
-  if (isLoading)
-    return (
-      <div className="flex min-h-[calc(100vh-60px)] items-center justify-center">
-        <AiLoaderLottie />
-      </div>
-    );
-
-  return (
-    <div className="px-4 pb-4 pt-2">
-      <FormProvider {...mealFormMethods}>
-        <form onSubmit={mealFormMethods.handleSubmit(onSubmit)} className="flex flex-col justify-center rounded-xl">
-          <MealImageCarousel imageList={foodImages} pagination={true} />
-
-          <div className="mt-10 flex flex-col gap-3">
-            <Typography className="pl-1">
-              음식 정보
-              <Typography variant="subTitle2" as="span" className="ml-2">
-                {mealList.length}
-              </Typography>
-            </Typography>
-            {mealList.map((meal, idx) => (
-              <EditCard key={idx} idx={idx} mealDetail={meal} />
-            ))}
-          </div>
-
-          <section className="my-10 flex w-full flex-col items-start justify-center gap-3">
-            <Typography as="h3" variant="body1" className="pl-1">
-              식사 시간
-            </Typography>
-            <GlassBackground className="min-h-auto flex w-full flex-col items-start gap-3 rounded-2xl border-none p-4">
-              <div className="flex w-full flex-wrap items-start justify-between gap-2">
-                {MEAL_CATEGORY.map((option) => {
-                  const field = mealFormMethods.register('mealCategory');
-                  const selected = mealFormMethods.watch('mealCategory');
-                  return (
-                    <TagSelectItem
-                      key={option.value}
-                      id={option.value}
-                      groupName="MEAL_CATEGORY"
-                      icon={option.icon}
-                      label={option.label}
-                      value={option.value}
-                      checked={selected === option.value}
-                      {...field}
-                    />
-                  );
-                })}
-              </div>
-              <div className="flex w-full gap-2">
-                <MealEditCalendar date={day} onDateChange={handleDayChange} />
-                <Drawer
-                  onOpenChange={(open) => {
-                    if (open) {
-                      const currenTime = mealFormMethods.getValues('date');
-                      setTempTime(currenTime);
-                    }
-                  }}
-                >
-                  <DrawerTrigger className="flex flex-1 items-center justify-between gap-2 rounded-lg border-[1px] border-gray-300 bg-white py-[0.81rem] pl-4 pr-3 after:block after:aspect-square after:w-[1.375rem] after:bg-down-line-gray-600-icon after:bg-center after:content-['']">
-                    <Typography
-                      as="span"
-                      variant="body1"
-                    >{`${date.meridiem} ${date.hours}:${date.minutes}`}</Typography>
-                  </DrawerTrigger>
-
-                  <DrawerContent>
-                    <DrawerTitle className="flex items-center gap-4 self-stretch pl-1">
-                      <Typography as="span" className="flex-1" variant="subTitle2">
-                        식사 시간 설정
-                      </Typography>
-                      <DrawerDescription className="sr-only">식사시간을 설정 할 수 있습니다.</DrawerDescription>
-                      <DrawerClose asChild>
-                        <IconButton icon="before:bg-close-line-icon" alt="닫기" />
-                      </DrawerClose>
-                    </DrawerTitle>
-
-                    <Picker
-                      data-test="test"
-                      itemHeight={48}
-                      value={tempTime}
-                      onChange={(changedTime) => setTempTime(changedTime)}
-                      wheelMode="natural"
-                      className="w-full"
-                    >
-                      {(Object.keys(selections) as (keyof typeof selections)[]).map((name) => (
-                        <Picker.Column key={name} name={name}>
-                          {selections[name].map((option) => (
-                            <Picker.Item key={option} value={option}>
-                              {option}
-                            </Picker.Item>
-                          ))}
-                        </Picker.Column>
-                      ))}
-                    </Picker>
-
-                    <DrawerFooter>
-                      <DrawerClose asChild>
-                        <Button
-                          type="button"
-                          onClick={() => {
-                            mealFormMethods.setValue('date', tempTime);
-                          }}
-                        >
-                          설정
-                        </Button>
-                      </DrawerClose>
-                    </DrawerFooter>
-                  </DrawerContent>
-                </Drawer>
-              </div>
-            </GlassBackground>
-          </section>
-
-          <section className="space-y-3">
-            <Typography as="h3" variant="body1" className="pl-1">
-              식사 일기
-            </Typography>
-            <GlassBackground className="min-h-auto flex w-full flex-col gap-3 rounded-2xl border-none">
-              <div className="flex items-start justify-between gap-[0.38rem] before:mt-[0.13rem] before:block before:aspect-square before:w-[1.125rem] before:bg-edit-4-icon before:bg-contain before:content-['']">
-                <Typography as="span" variant="subTitle3" className="flex-1 !font-medium text-gray-600">
-                  음식을 먹을 때 어떤 기분이었는지 간단하게 적어주세요. 식습관을 돌아보는데 큰 도움이 돼요!
-                </Typography>
-              </div>
-              <Textarea
-                {...mealFormMethods.register('memo')}
-                className="min-h-60 text-gray-500"
-                maxLength={200}
-                placeholder="예시) 스트레스로 폭식했다, 기분 좋게 잘먹었다, 이 음식 먹고 속이 안 좋았다."
-              />
-            </GlassBackground>
-          </section>
-          <Button type="submit" className="mt-3 w-full">
-            제출하기
-          </Button>
-        </form>
-      </FormProvider>
-    </div>
-  );
 };
 
-export default MealPostEditPage;
-
-const mealInputSchema = z.object({
-  menuName: z.string(),
-  weight: z.coerce.number(),
-  calories: z.coerce.number()
-});
-
-const mealListSchema = z.object({
-  userId: z.string(),
-  menuName: z.string(),
-  weight: z.coerce.number(),
-  calories: z.coerce.number(),
-  carbohydrate: z.coerce.number(),
-  protein: z.coerce.number(),
-  fat: z.number()
-});
+const MealPostEditPage = async (): Promise<JSX.Element> => {
+  const { id: userId } = await getUser();
+  const { data: imageList } = await getFoodImagesById(userId);
+  const aiResponses = await getAiResponses();
 
-const mealEditFormSchema = z.object({
-  meals: z.array(mealInputSchema),
-  mealList: z.array(mealListSchema),
-  mealCategory: z.nativeEnum(MealCategory),
-  date: z.object({
-    meridiem: z.enum(['오전', '오후']),
-    hours: z.string(),
-    minutes: z.string()
-  }),
-  day: z.date(),
-  memo: z.string().max(200, '').optional()
-});
-
-export type MealEditFormDataType = z.infer<typeof mealEditFormSchema>;
-const MEAL_CATEGORY = [
-  {
-    value: MealCategory.BREAKFAST,
-    label: '아침',
-    icon: 'before:bg-meal-category-breakfast'
-  },
-  {
-    value: MealCategory.LUNCH,
-    label: '점심',
-    icon: 'before:bg-meal-category-lunch'
-  },
-  {
-    value: MealCategory.DINNER,
-    label: '저녁',
-    icon: 'before:bg-meal-category-dinner'
-  },
-  {
-    value: MealCategory.SNACK,
-    label: '간식',
-    icon: 'before:bg-meal-category-snack'
+  if (!userId || !imageList || aiResponses.length === 0) {
+    redirect('/meal/post');
   }
-];
 
-const hours = Array.from({ length: 13 }, (_, i) => String(i).padStart(2, '0'));
-const minutes = Array.from({ length: 60 }, (_, i) => String(i).padStart(2, '0'));
-const selections = {
-  meridiem: ['오전', '오후'],
-  hours: hours,
-  minutes: minutes
+  return <EditResultSection imageList={imageList.imageUrls} initialMealList={aiResponses} />;
 };
+
+export default MealPostEditPage;
diff --git a/src/app/(client)/meal/post/hooks/use-restore-analys-modal.ts b/src/app/(client)/meal/post/hooks/use-restore-analysis-modal.ts
similarity index 100%
rename from src/app/(client)/meal/post/hooks/use-restore-analys-modal.ts
rename to src/app/(client)/meal/post/hooks/use-restore-analysis-modal.ts
diff --git a/src/app/(client)/meal/post/layout.tsx b/src/app/(client)/meal/post/layout.tsx
index 71e83412..31387075 100644
--- a/src/app/(client)/meal/post/layout.tsx
+++ b/src/app/(client)/meal/post/layout.tsx
@@ -8,7 +8,7 @@ const Layout = ({
   children: React.ReactNode;
 }>) => {
   return (
-    <div className="temp-layout">
+    <div className="layout-container">
       <Header variant="withProfile" />
       <div className="py-layout">
         <main>{children}</main>
diff --git a/src/app/(client)/meal/post/page.tsx b/src/app/(client)/meal/post/page.tsx
index 39e088f7..18f00c6e 100644
--- a/src/app/(client)/meal/post/page.tsx
+++ b/src/app/(client)/meal/post/page.tsx
@@ -1,10 +1,10 @@
-import Contents from '@/app/(client)/meal/post/components/upload-image-section';
 import { getAiResponses } from '@/apis/analysis-request.api';
+import UploadImageSection from './components/upload-image-section';
 
 const MealPostPage = async (): Promise<JSX.Element> => {
   const data = await getAiResponses();
   const isRecorded = !!data && data.length > 0;
-  return <Contents isRecorded={isRecorded} />;
+  return <UploadImageSection isRecorded={isRecorded} />;
 };
 
 export default MealPostPage;
diff --git a/src/app/globals.css b/src/app/globals.css
index f52e0807..ee9dd36a 100644
--- a/src/app/globals.css
+++ b/src/app/globals.css
@@ -86,3 +86,15 @@ input[type='number']::-webkit-outer-spin-button {
 input[type='number'] {
   -moz-appearance: textfield;
 }
+
+
+@layer utilities {
+  .scrollbar-hidden {
+    -ms-overflow-style: none;
+    scrollbar-width: none;
+  }
+
+  .scrollbar-hidden::-webkit-scrollbar {
+    display: none;
+  }
+}
diff --git a/src/components/commons/macronutrient-box.tsx b/src/components/commons/macronutrient-box.tsx
index 0ab8df20..3e272452 100644
--- a/src/components/commons/macronutrient-box.tsx
+++ b/src/components/commons/macronutrient-box.tsx
@@ -15,7 +15,7 @@ const MacronutrientBox = ({ variety, value }: { variety: MacronutrientEnumType;
           beforeBgColor
         )}
       />
-      <div className="flex flex-1 flex-col items-start gap-1.5">
+      <div className="flex flex-1 flex-col items-start gap-0.5">
         <Typography as="span" variant="body3" className="text-gray-700">
           {label}
         </Typography>
diff --git a/src/utils/format.util.ts b/src/utils/format.util.ts
index f4755915..c275c839 100644
--- a/src/utils/format.util.ts
+++ b/src/utils/format.util.ts
@@ -42,33 +42,34 @@ export const formatDateWithDash = (date: Date): string => {
 /**
  * 날짜와 시간 정보를 타임스탬프 문자열로 변환하는 함수입니다.
  *
- * @function formatTimestamp
- * @param {Date} baseDate - 기준 날짜 객체
- * @param {Object} time - 시간 정보 객체
- * @param {('오전'|'오후')} time.meridiem - 오전/오후 구분
- * @param {string} time.hours - 시간
- * @param {string} time.minutes - 분
- * @returns {string} 'YYYY-MM-DD HH:MM:00' 형식의 타임스탬프 문자열
+ * @param datetime - 날짜 및 시간 정보를 포함한 객체
+ * @param datetime.day - 기준 날짜 (Date 객체)
+ * @param datetime.meridiem - '오전' 또는 '오후'
+ * @param datetime.hours - 시(hour), 문자열 형태 ('01' ~ '12')
+ * @param datetime.minutes - 분(minute), 문자열 형태 ('00' ~ '59')
+ * @returns 포맷된 timestamp 문자열 ('YYYY-MM-DD HH:mm:ss')
+ *
+
  */
-export const formatTimestamp = (
-  baseDate: Date,
-  time: { meridiem: '오전' | '오후'; hours: string; minutes: string }
-): string => {
-  let hour = parseInt(time.hours, 10);
-  const minutes = time.minutes.padStart(2, '0');
+export const formatTimestamp = (datetime: {
+  day: Date;
+  meridiem: '오전' | '오후';
+  hours: string;
+  minutes: string;
+}): string => {
+  const { day, meridiem, hours, minutes } = datetime;
 
-  if (time.meridiem === '오전' && hour === 12) {
-    hour = 0;
-  } else if (time.meridiem === '오후' && hour !== 12) {
-    hour += 12;
-  }
+  let hour = parseInt(hours, 10);
+  if (meridiem === '오전' && hour === 12) hour = 0;
+  if (meridiem === '오후' && hour !== 12) hour += 12;
 
-  const yyyy = baseDate.getFullYear();
-  const mm = String(baseDate.getMonth() + 1).padStart(2, '0');
-  const dd = String(baseDate.getDate()).padStart(2, '0');
-  const hh = String(hour).padStart(2, '0');
+  const timestamp = new Date(day);
+  timestamp.setHours(hour);
+  timestamp.setMinutes(parseInt(minutes, 10));
+  timestamp.setSeconds(0);
+  timestamp.setMilliseconds(0);
 
-  return `${yyyy}-${mm}-${dd} ${hh}:${minutes}:00`;
+  return timestamp.toISOString();
 };
 
 /**


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 5**

<details>
<summary>🧹 Nitpick comments (2)</summary><blockquote>

<details>
<summary>src/app/(client)/meal/post/edit/components/time-picker.tsx (1)</summary><blockquote>

`1-98`: **키보드 접근성 향상을 위한 제안**

현재 구현은 모바일 환경에 최적화되어 있지만, 키보드 사용자를 위한 접근성이 제한적일 수 있습니다. 특히 `Picker` 컴포넌트가 키보드 탐색을 지원하는지 확인하고, 필요한 경우 키보드 이벤트 핸들러를 추가하는 것을 고려해보세요.


```diff
// 예시: 키보드 이벤트를 처리하는 핸들러 추가
+ const handleKeyDown = (e: React.KeyboardEvent) => {
+   // 화살표 키로 값 변경 등의 로직 구현
+   if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
+     // 값 변경 로직
+   }
+ };

// Picker 컴포넌트에 키보드 이벤트 핸들러 추가
<Picker
  itemHeight={48}
  value={time}
  onChange={(changedTime) => setTime(changedTime)}
  wheelMode="natural"
  className="w-full"
+ onKeyDown={handleKeyDown}
>
```

</blockquote></details>
<details>
<summary>src/app/(client)/meal/post/edit/components/edit-card.tsx (1)</summary><blockquote>

`126-131`: **중복 클릭 방지를 위해 로딩 중 버튼 비활성화 권장**  
`isLoading` 상태에서도 버튼이 활성화돼 있어 연속으로 “다시 분석하기”를 누르면 중복 요청이 발생할 수 있습니다.

```diff
- disabled={!isChanged}
+ disabled={!isChanged || isLoading}
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 5c4d152522de2999a648ede4999bfd28ac990235 and edfc2ff2c4808001212f54ac5840c8acd54b314f.

</details>

<details>
<summary>📒 Files selected for processing (11)</summary>

* `src/apis/gemini.api.ts` (1 hunks)
* `src/app/(client)/meal/components/meal-images-carousel.tsx` (1 hunks)
* `src/app/(client)/meal/post/components/upload-image-section.tsx` (2 hunks)
* `src/app/(client)/meal/post/edit/components/ai-loader-without-bg.tsx` (1 hunks)
* `src/app/(client)/meal/post/edit/components/edit-card.tsx` (5 hunks)
* `src/app/(client)/meal/post/edit/components/edit-result-section.tsx` (1 hunks)
* `src/app/(client)/meal/post/edit/components/time-picker.tsx` (1 hunks)
* `src/app/(client)/meal/post/edit/page.tsx` (1 hunks)
* `src/app/(client)/meal/post/page.tsx` (1 hunks)
* `src/app/globals.css` (1 hunks)
* `src/utils/format.util.ts` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Graph Analysis (3)</summary>

<details>
<summary>src/app/(client)/meal/post/page.tsx (1)</summary><blockquote>

<details>
<summary>src/apis/analysis-request.api.ts (1)</summary>

* `getAiResponses` (42-49)

</details>

</blockquote></details>
<details>
<summary>src/app/(client)/meal/post/edit/components/time-picker.tsx (4)</summary><blockquote>

<details>
<summary>src/components/ui/drawer.tsx (7)</summary>

* `Drawer` (8-13)
* `DrawerTrigger` (16-16)
* `DrawerContent` (30-47)
* `DrawerTitle` (60-69)
* `DrawerDescription` (72-77)
* `DrawerClose` (20-20)
* `DrawerFooter` (55-57)

</details>
<details>
<summary>src/components/ui/typography.tsx (1)</summary>

* `Typography` (38-51)

</details>
<details>
<summary>src/components/ui/button.tsx (1)</summary>

* `Button` (38-43)

</details>
<details>
<summary>src/app/(client)/meal/post/edit/components/edit-result-section.tsx (1)</summary>

* `dateSchema` (200-205)

</details>

</blockquote></details>
<details>
<summary>src/app/(client)/meal/post/edit/components/edit-card.tsx (6)</summary><blockquote>

<details>
<summary>src/types/DTO/ai_analysis.dto.ts (1)</summary>

* `AiResponseDTO` (8-17)

</details>
<details>
<summary>src/apis/gemini.api.ts (1)</summary>

* `generateCaloriesAnalysisByText` (13-29)

</details>
<details>
<summary>src/lib/gemini.ts (1)</summary>

* `parseGeminiResponse` (24-38)

</details>
<details>
<summary>src/components/ui/typography.tsx (1)</summary>

* `Typography` (38-51)

</details>
<details>
<summary>src/utils/format.util.ts (1)</summary>

* `formatNumberWithComma` (8-10)

</details>
<details>
<summary>src/types/nutrition.type.ts (1)</summary>

* `MacronutrientEnum` (14-18)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>🔇 Additional comments (24)</summary><blockquote>

<details>
<summary>src/apis/gemini.api.ts (1)</summary>

`43-43`: **Gemini 프롬프트 개선으로 일관된 형식의 응답 유도**

영양 성분 값을 소수점 없이 정수로 응답하도록 지시하는 항목을 추가하여 데이터 처리 일관성을 개선했습니다. 이는 클라이언트 측에서 영양 데이터를 처리할 때 발생할 수 있는 파싱 오류를 방지하는 좋은 접근 방식입니다.

</details>
<details>
<summary>src/app/(client)/meal/components/meal-images-carousel.tsx (1)</summary>

`34-34`: **서버 사이드 렌더링 시 하이드레이션 오류 방지**

`typeof window !== 'undefined'` 조건을 추가하여 서버 사이드 렌더링 중에 페이지네이션이 활성화되지 않도록 수정했습니다. 이는 서버와 클라이언트 간 렌더링 불일치로 인한 하이드레이션 오류를 방지하는 좋은 방법입니다.

</details>
<details>
<summary>src/app/globals.css (1)</summary>

`88-97`: **크로스 브라우저 스크롤바 숨김 유틸리티 클래스 추가**

여러 브라우저에서 스크롤바를 일관되게 숨기는 유틸리티 클래스를 추가했습니다. IE/Edge, Firefox, 웹킷 기반 브라우저 모두에 대응하는 속성을 적용하여 호환성을 보장했습니다. 스크롤 기능은 유지하면서 시각적으로만 스크롤바를 숨기는 효과적인 방법입니다.

</details>
<details>
<summary>src/app/(client)/meal/post/edit/components/ai-loader-without-bg.tsx (1)</summary>

`1-18`: **사용자 경험 개선을 위한 AI 로딩 컴포넌트 구현**

AI 분석 중 로딩 상태를 시각적으로 표시하는 Lottie 애니메이션 컴포넌트를 적절하게 구현했습니다. 애니메이션을 중앙에 배치하여 사용자에게 처리 중임을 명확하게 알려주는 좋은 UX 디자인입니다.

</details>
<details>
<summary>src/utils/format.util.ts (4)</summary>

`42-53`: **JSDoc 주석이 명확하게 개선되었습니다.**

매개변수 구조를 객체로 변경하면서 JSDoc 주석도 적절하게 업데이트되었습니다. 각 필드에 대한 설명이 명확히 제공되어 함수 사용자가 쉽게 이해할 수 있습니다.

---

`54-59`: **객체 매개변수로의 리팩토링이 잘 이루어졌습니다.**

함수 시그니처를 여러 개의 매개변수에서 단일 객체 매개변수로 변경한 것은 좋은 리팩토링 결정입니다. 이렇게 하면 함수 호출 시 매개변수의 순서를 기억할 필요가 없고, 필요한 경우 나중에 쉽게 매개변수를 추가할 수 있습니다.

---

`60-64`: **명시적인 변수명 사용이 좋습니다.**

객체 구조 분해를 사용하여, 코드 가독성이 향상되었습니다. 또한 `paddedMinutes` 변수명을 사용하여 이 값이 패딩된 문자열이라는 것을 명시적으로 나타내는 것이 좋습니다.

---

`71-76`: **날짜 컴포넌트 추출 로직이 명확합니다.**

`day` 객체에서 년, 월, 일을 추출하는 로직이 명확하게 구현되어 있습니다. 문자열 패딩도 적절히 적용되었습니다.

</details>
<details>
<summary>src/app/(client)/meal/post/page.tsx (2)</summary>

`2-2`: **컴포넌트 import 경로와 이름이 적절하게 변경되었습니다.**

`Contents`에서 `UploadImageSection`으로의 이름 변경은 컴포넌트의 역할을 더 명확하게 표현합니다. 또한 상대 경로를 사용하는 것이 이 컨텍스트에서 적절합니다.

---

`7-7`: **컴포넌트 사용이 import 변경사항과 일치하도록 업데이트되었습니다.**

`Contents` 대신 `UploadImageSection` 컴포넌트를 사용하도록 JSX가 업데이트되었습니다. 적절한 props 전달이 유지되고 있습니다.

</details>
<details>
<summary>src/app/(client)/meal/post/components/upload-image-section.tsx (3)</summary>

`4-6`: **import 경로가 올바르게 수정되었습니다.**

상대 경로로 변경된 import 문은 코드 유지보수성을 향상시킵니다. 특히 파일 구조 변경 시 상대 경로를 사용하면 리팩토링이 더 쉬워집니다.

---

`19-19`: **로딩 컨테이너의 높이 계산이 개선되었습니다.**

최소 높이 계산이 `calc(100vh - 64px - 76px)`으로 조정되어 더 정확한 레이아웃을 제공합니다. 이는 상단 및 하단 요소들의 높이를 고려한 것으로 보입니다.

---

`26-26`: **컨테이너 너비가 전체 화면으로 설정되었습니다.**

`w-full` 클래스를 추가하여 컨테이너가 사용 가능한 전체 너비를 차지하도록 했습니다. 이는 PR 목표 중 하나인 "이미지 추가 버튼 크기를 화면 너비에 맞게 조정"에 부합합니다.

</details>
<details>
<summary>src/app/(client)/meal/post/edit/components/time-picker.tsx (8)</summary>

`19-22`: **TimePicker 컴포넌트의 Props 타입이 명확합니다.**

`TimePickerProps` 타입 정의가 명확하게 되어 있습니다. `currentTime`과 시간 변경을 알리는 콜백 함수를 요구하는 인터페이스가 잘 구성되어 있습니다.

---

`24-36`: **상태 관리 로직이 깔끔하게 구현되었습니다.**

`isOpen` 상태와 `time` 상태를 분리하여 관리하고 있습니다. 특히 `handleSelectedTime` 함수에서 부모 컴포넌트에 시간 변경을 알리고 드로어를 닫는 작업을 순차적으로 처리하는 방식이 좋습니다.

---

`38-44`: **트리거 버튼 디자인이 UI 가이드라인에 맞게 구현되었습니다.**

Drawer 트리거 버튼이 시각적으로 구분되도록 스타일이 잘 적용되어 있습니다. 특히 시간 표시와 드롭다운 아이콘의 배치가 사용자에게 이것이 선택 가능한 컨트롤임을 명확히 알려줍니다.

---

`46-55`: **Drawer 헤더 구성이 접근성을 고려하여 구현되었습니다.**

제목과 설명이 적절히 구성되어 있으며, 특히 `sr-only` 클래스를 사용하여 스크린 리더 사용자를 위한 추가 설명을 제공한 점이 좋습니다. 닫기 버튼도 아이콘과 대체 텍스트를 함께 제공하여 접근성을 향상시켰습니다.

---

`57-73`: **Picker 컴포넌트 구현이 효율적입니다.**

`react-mobile-picker` 라이브러리를 활용하여 모바일 친화적인 시간 선택 UI를 제공하고 있습니다. 타입 안전성을 보장하면서 동적으로 컬럼과 옵션을 생성하는 방식이 효율적입니다.

---

`75-82`: **Drawer 푸터와 설정 버튼 구현이 명확합니다.**

"설정" 버튼이 눌리면 선택된 시간이 적용되고 드로어가 닫히는 로직이 명확합니다. `DrawerClose`를 `asChild`와 함께 사용하여 버튼 클릭 시 드로어도 함께 닫히도록 한 것이 좋은 UX 구현입니다.

---

`87-90`: **타입 재사용을 위한 내보내기가 잘 구현되었습니다.**

`TimeFields` 타입을 `dateSchema`에서 파생시켜 내보내는 것은 타입의 일관성을 유지하는 좋은 방법입니다. 불필요한 `day` 필드를 제외시키는 것도 적절합니다.

---

`91-98`: **선택 옵션 생성 로직이 효율적입니다.**

`Array.from`을 사용하여 시간과 분 옵션을 생성하고, 각 값에 적절한 패딩을 적용한 것이 효율적입니다. 선택 옵션을 객체로 구조화하여 Picker 컴포넌트에서 쉽게 사용할 수 있도록 한 점도 좋습니다.

</details>
<details>
<summary>src/app/(client)/meal/post/edit/page.tsx (1)</summary>

`26-34`: **API 응답 안전성 및 null‑체크 강화 제안**  
`aiResponses`가 `undefined`일 경우 `aiResponses.length` 접근에서 런타임 오류가 발생합니다. 또한 `imageList`가 `undefined`가 아닌데 내부 배열이 비어 있으면 그대로 진행됩니다. 아래처럼 기본값을 줘서 안전하게 처리하는 편이 좋습니다.

```diff
- const aiResponses = await getAiResponses();
+ const aiResponses = (await getAiResponses()) ?? [];

- if (!userId || !imageList || aiResponses.length === 0) {
+ if (!userId || !imageList || imageList.imageUrls.length === 0 || aiResponses.length === 0) {
     redirect('/meal/post');
   }
```
추가로, `imageList?.imageUrls`를 사용하면 `imageList`가 undefined일 때도 안전합니다.

</details>
<details>
<summary>src/app/(client)/meal/post/edit/components/edit-result-section.tsx (2)</summary>

`8-12`: **`urlToFile` 경로가 잘못될 가능성**  
`'../../../utils/file.util'` 경로는 현재 파일 위치 기준으로 `src/app/(client)/meal/utils` 를 가리키는데, 실제 유틸 경로가 `src/utils/file.util.ts` 라면 import가 실패합니다. 절대 경로나 `@/utils/file.util` 별칭 사용을 검토해 주세요.

---

`200-205`: **`hours`, `minutes`를 문자열로 저장하면 시간 계산 시 오류 위험**  
`dateSchema`에서 `hours`, `minutes`를 `string`으로 정의하였는데, `formatTimestamp` 내부에서 숫자 연산을 수행하면 문제가 발생할 수 있습니다. `z.coerce.number()`로 정의하거나 `formatTimestamp` 내에서 `Number()` 변환을 수행하는지 확인해 주세요.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-21T08:21:03Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>🧹 Nitpick comments (7)</summary><blockquote>

<details>
<summary>src/app/(client)/meal/post/edit/components/edit-result-section.tsx (7)</summary><blockquote>

`10-10`: **상대 경로를 절대 경로로 변경하는 것이 좋겠습니다.**

이 파일에서는 대부분 `@/` 접두사를 사용한 절대 경로를 사용하고 있는데, 이 줄에서만 `../../../utils/file.util`과 같은 상대 경로를 사용하고 있습니다. 코드 일관성을 위해 절대 경로로 변경하는 것이 좋겠습니다.

```diff
-import { urlToFile } from '../../../utils/file.util';
+import { urlToFile } from '@/utils/file.util';
```

---

`67-113`: **form 타입 체크 로직이 불필요합니다.**

71-73줄의 `if (!form)` 체크는 불필요합니다. 이 코드는 `onSubmit` 함수 내에서 실행되며, 이 시점에서 `form`은 이미 zod 스키마에 의해 검증되어 항상 유효한 값을 가지고 있습니다.

```diff
  const onSubmit = async (form: MealEditFormData) => {
    const files = await Promise.all(form.mealImages.map((url, idx) => urlToFile(url, idx)));
    setIsLoading(true);
    try {
-      if (!form) {
-        return alert(' 데이터 형식이 올바르지 않습니다.');
-      }

      const { mealImages, date, memo, mealCategory } = form;
```

---

`106-109`: **오류 처리를 개선해주세요.**

현재 오류 메시지는 일반적인 정보만 제공합니다. 사용자에게 더 명확한 피드백을 제공하고 디버깅을 용이하게 하기 위해 오류 유형에 따른 구체적인 메시지를 표시하는 것이 좋습니다.

```diff
    } catch (err) {
-      alert('식사 정보 등록에 실패하였습니다. 잠시후 다시 시도해주세요');
+      const errorMessage = err instanceof Error ? err.message : '알 수 없는 오류';
+      alert(`식사 정보 등록에 실패하였습니다: ${errorMessage}. 잠시후 다시 시도해주세요`);
      console.error('등록에 실패 했습니다. ', err);
      router.refresh();
```

---

`91-101`: **타입 캐스팅 대신 타입 호환성 확보가 좋습니다.**

92줄에서 `as` 키워드를 사용한 타입 캐스팅은 타입 에러를 숨길 수 있습니다. 가능하다면 타입 캐스팅 없이 타입이 자연스럽게 호환되도록 객체를 구성하는 것이 더 안전합니다.

```diff
  const { mealDetails } = await createMealWithDetails(
-    newMeals as Pick<MealDTO, 'ateAt' | 'foodImages' | 'memo' | 'mealCategory'>,
+    newMeals,
    mealList.map((meal) => ({
```

또는 명시적으로 타입을 지정할 수도 있습니다:

```typescript
const newMeals: Pick<MealDTO, 'ateAt' | 'foodImages' | 'memo' | 'mealCategory'> = {
  foodImages: mealImages,
  ateAt,
  mealCategory,
  memo
};
```

---

`169-169`: **문구 개선 제안**

현재 식사 일기 설명 문구가 다소 길고 복잡합니다. 더 간결하고 명확하게 수정하는 것이 사용자 경험 향상에 도움이 될 수 있습니다.

```diff
- 음식을 먹을 때 어떤 기분이었는지 간단하게 적어주세요. 식습관을 돌아보는데 큰 도움이 돼요!
+ 식사 중 기분과 상태를 기록하면 식습관 개선에 도움이 돼요!
```

---

`218-227`: **함수 정의 위치 개선 제안**

`getTimeFieldsFromDate` 함수는 35줄에서 사용되지만 218줄에서 정의되고 있습니다. 코드 가독성 향상을 위해 함수 정의를 컴포넌트 정의 전으로 옮기는 것이 좋습니다. 또는, 이 유틸리티 함수를 별도의 파일로 분리하여 임포트하는 방식으로 개선할 수도 있습니다.

---

`224-225`: **시간 포맷팅 로직 개선**

시간과 분을 2자리로 패딩하는 로직이 있습니다. 이 로직은 올바르게 작동하지만, 더 간결하게 표현할 수 있습니다.

```diff
  return {
    meridiem: hours < 12 ? '오전' : '오후',
-    hours: String(hours % 12 === 0 ? 12 : hours % 12).padStart(2, '0'),
-    minutes: String(minutes).padStart(2, '0')
+    hours: `${hours % 12 === 0 ? 12 : hours % 12}`.padStart(2, '0'),
+    minutes: `${minutes}`.padStart(2, '0')
  };
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between edfc2ff2c4808001212f54ac5840c8acd54b314f and f2d00eb47d237f02bd2e527b922cf6a88153dce0.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `src/app/(client)/meal/post/edit/components/edit-result-section.tsx` (1 hunks)

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (1)</summary>

* GitHub Check: build

</details>

<details>
<summary>🔇 Additional comments (4)</summary><blockquote>

<details>
<summary>src/app/(client)/meal/post/edit/components/edit-result-section.tsx (4)</summary>

`78-82`: **이미지 업로드 로직이 개선되었습니다.**

이전 리뷰에서 지적된 FormData 재사용 문제가 올바르게 수정되었습니다. 각 파일마다 새로운 FormData 객체를 생성하여 이미지가 중복 업로드되는 문제를 해결했습니다. 👍

---

`132-160`: **식사 시간 섹션 구현이 잘 되었습니다.**

식사 시간 섹션의 UI 구현이 잘 되었습니다. 특히 카테고리 선택 부분이 PR 목표에 맞게 슬라이드 형식으로 구현되었고, 달력과 시간 선택기가 나란히 배치되어 사용자 경험이 향상되었습니다. 👍

---

`161-178`: **식사 일기 섹션 구현이 잘 되었습니다.**

식사 일기 섹션의 UI가 잘 구현되었습니다. GlassBackground 컴포넌트를 사용하여 시각적으로 일관된 디자인을 유지하고, 플레이스홀더 텍스트를 통해 사용자에게 명확한 가이드를 제공합니다. 👍

---

`116-118`: **이미지 캐러셀 구현이 기존 이슈를 해결했습니다.**

이미지 캐러셀이 MealImageCarousel 컴포넌트를 사용하여 구현되었으며, PR 목표 중 하나인 페이지네이션 추가가 적용되었습니다. 이 컴포넌트는 사용자 요구사항인 이미지 캐러셀에 페이지네이션을 추가하는 목표를 달성했습니다. 👍

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-21T08:34:12Z
user: login: jiyxxn
body: 픽셀 들어간 부분 수정되면 좋을 것 같습니다! 우혁님 고생하셨습니다 처음 하셨던 것보다 확실히 정돈된 것 같아요!
state: CHANGES_REQUESTED
author_association: COLLABORATOR
submitted_at: 2025-04-21T08:44:39Z
user: login: llddang
body: 고생하셨습니다!
metadata 넣은 것도 좋습니당!!
저도 추가해야할 게 늘었네용!!
state: CHANGES_REQUESTED
author_association: OWNER
submitted_at: 2025-04-21T09:22:48Z
user: login: woohyuckk
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-21T09:38:25Z
user: login: woohyuckk
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-21T09:39:15Z
user: login: woohyuckk
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-21T09:53:16Z
user: login: woohyuckk
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-21T09:56:48Z
user: login: woohyuckk
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-21T09:57:30Z
user: login: woohyuckk
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-21T10:23:15Z
user: login: woohyuckk
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-21T10:28:36Z
user: login: woohyuckk
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-21T11:14:31Z
user: login: woohyuckk
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-21T11:25:12Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 1**

<details>
<summary>♻️ Duplicate comments (1)</summary><blockquote>

<details>
<summary>src/app/(client)/meal/post/edit/components/edit-result-section.tsx (1)</summary><blockquote>

`107-108`: **에러 메시지 일관성 유지**

에러 메시지와 콘솔 로그 메시지의 일관성을 유지하는 것이 좋습니다. 현재 코드는 알림에서는 마침표가 없지만 콘솔 로그에서는 마침표가 있습니다.

```diff
-  alert('식사 정보 등록에 실패했습니다. 잠시후 다시 시도해주세요');
-  console.error('식사 정보 등록에 실패했습니다.', err);
+  alert('식사 정보 등록에 실패했습니다. 잠시후 다시 시도해주세요.');
+  console.error('식사 정보 등록에 실패했습니다. 잠시후 다시 시도해주세요.', err);
```

이전 코멘트에서 jiyxxn님이 언급하신 것처럼 "실패했습니다."로 텍스트 통일하는 것도 고려해보세요.

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (3)</summary><blockquote>

<details>
<summary>src/app/(client)/meal/post/edit/components/edit-result-section.tsx (3)</summary><blockquote>

`30-34`: **초기 시간 설정 로직 최적화 제안**

`getTimeFieldsFromDate` 함수를 현재 기본값 없이 호출하고 있지만, 함수 자체가 항상 현재 시간을 반환합니다. 이 부분은 아래 form 기본값에서도 현재 시간을 사용하고 있어 중복된 로직입니다.

아래와 같이 개선할 수 있습니다:

```diff
-  const { meridiem, hours, minutes } = getTimeFieldsFromDate();
+  const timeFields = getTimeFieldsFromDate();
```

그리고 defaultValues에서:

```diff
  defaultValues: {
    mealImages: imageList,
    mealList: mealList,
    date: {
      day: new Date(),
-     meridiem,
-     hours,
-     minutes
+     ...timeFields
    },
```

---

`179-181`: **제출 버튼 상태 개선 제안**

현재 제출 버튼은 `isLoading` 상태에 따라 비활성화되지만, 사용자에게 로딩 중이라는 피드백이 없습니다.

로딩 상태를 사용자에게 시각적으로 표시하는 것이 좋습니다:

```diff
-          <Button type="submit" className="mt-3 w-full" disabled={isLoading}>
-            제출하기
-          </Button>
+          <Button type="submit" className="mt-3 w-full" disabled={isLoading}>
+            {isLoading ? '처리 중...' : '제출하기'}
+          </Button>
```

또는 로딩 스피너를 추가하는 방법도 있습니다:

```diff
-          <Button type="submit" className="mt-3 w-full" disabled={isLoading}>
-            제출하기
-          </Button>
+          <Button type="submit" className="mt-3 w-full" disabled={isLoading}>
+            {isLoading ? (
+              <>
+                <span className="mr-2 inline-block h-4 w-4 animate-spin rounded-full border-2 border-solid border-white border-t-transparent"></span>
+                처리 중...
+              </>
+            ) : (
+              '제출하기'
+            )}
+          </Button>
```

---

`218-228`: **getTimeFieldsFromDate 함수 개선 제안**

현재 `getTimeFieldsFromDate` 함수는 인자를 받지 않고 항상 현재 시간을 사용합니다. 필요에 따라 날짜를 받을 수 있도록 하면 더 유연하게 사용할 수 있습니다.

선택적 인자를 받도록 함수를 개선할 수 있습니다:

```diff
-const getTimeFieldsFromDate = (): TimeFields => {
-  const now = new Date();
+const getTimeFieldsFromDate = (date?: Date): TimeFields => {
+  const now = date || new Date();
   const hours = now.getHours();
   const minutes = now.getMinutes();

   return {
     meridiem: hours < 12 ? '오전' : '오후',
     hours: String(hours % 12 === 0 ? 12 : hours % 12).padStart(2, '0'),
     minutes: String(minutes).padStart(2, '0')
   };
 };
```

이렇게 하면 특정 날짜에 대한 시간 필드도 생성할 수 있으며, 기본적으로는 현재 시간을 사용합니다.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between cceaf94312e8f7d30f0762515300baf0fdbf111c and 65b5613142900d8d8617f7791e91226f9e62093f.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `src/app/(client)/meal/post/components/restore-analysis-modal.tsx` (2 hunks)
* `src/app/(client)/meal/post/edit/components/ai-loader-without-bg.tsx` (1 hunks)
* `src/app/(client)/meal/post/edit/components/edit-result-section.tsx` (1 hunks)

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (1)</summary>

* src/app/(client)/meal/post/components/restore-analysis-modal.tsx

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* src/app/(client)/meal/post/edit/components/ai-loader-without-bg.tsx

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Graph Analysis (1)</summary>

<details>
<summary>src/app/(client)/meal/post/edit/components/edit-result-section.tsx (7)</summary><blockquote>

<details>
<summary>src/types/DTO/ai_analysis.dto.ts (1)</summary>

* `AiResponseDTO` (8-17)

</details>
<details>
<summary>src/types/meal-category.type.ts (1)</summary>

* `MealCategory` (1-6)

</details>
<details>
<summary>src/app/(client)/meal/post/edit/components/time-picker.tsx (1)</summary>

* `TimeFields` (89-89)

</details>
<details>
<summary>src/app/(client)/meal/utils/file.util.ts (1)</summary>

* `urlToFile` (42-49)

</details>
<details>
<summary>src/utils/format.util.ts (1)</summary>

* `formatTimestamp` (54-73)

</details>
<details>
<summary>src/apis/storage.api.ts (1)</summary>

* `uploadImage` (18-32)

</details>
<details>
<summary>src/apis/meal.api.ts (2)</summary>

* `createMealWithDetails` (124-131)
* `deleteMealAnalysisDetail` (167-173)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>🔇 Additional comments (3)</summary><blockquote>

<details>
<summary>src/app/(client)/meal/post/edit/components/edit-result-section.tsx (3)</summary>

`85-90`: <details>
<summary>✅ Verification successful</summary>

**식사 이미지 저장 시 foodImages 사용에 주의**

이전 리뷰 코멘트에서 언급된 사항을 확인해 주세요. `newMeals`의 `foodImages`가 새로 업로드된 이미지 URL이 맞는지 확인이 필요합니다.

업로드된 이미지의 URL만 `foodImages`에 저장되는지 확인하세요. 이전 리뷰에서 언급된 것처럼 버려질 스토리지의 이미지를 테이블에서 참조하지 않도록 주의해야 합니다.

---

🏁 Script executed:

```shell
#!/bin/bash
# 코드에서 이미지 업로드 관련 로직 검색
rg -A 10 "const storedImageUrls" --type ts
rg -A 10 "foodImages:" --type ts
```

Length of output: 2872

---



</details>

**newMeals.foodImages 검증 완료: uploadImage로 반환된 URL만 저장됩니다**

- `storedImageUrls`는 빈 배열로 초기화된 뒤 `uploadImage('meal', formData)` 호출 시 반환된 `fileUrl`만 `.push()`  
- 따라서 `newMeals.foodImages`에는 오직 새로 업로드된 이미지의 URL만 포함되어 기존에 삭제되거나 버려질 이미지가 참조되지 않습니다

---

`173-173`: <details>
<summary>✅ Verification successful</summary>

**Textarea 색상 관련 코멘트에 대한 확인**

이전 리뷰에서 jiyxxn님이 "text 컬러 따로 주면 입력해도 이 글씨 그대로 반영되지 않나요?"라고 질문하셨고, 이에 대해 woohyuckk님이 `focus:text-gray-900` 속성이 있다고 응답하셨습니다. 현재 코드에서는 className에 `text-gray-500`이 포함되어 있는데, `focus:text-gray-900` 속성이 있는지 확인이 필요합니다.

Textarea 컴포넌트의 구현에서 `focus:text-gray-900` 속성이 제대로 적용되어 있는지 확인하세요. 현재 className에는 `text-gray-500`만 명시되어 있습니다.

---

🏁 Script executed:

```shell
#!/bin/bash
# Textarea 컴포넌트 구현 확인
cat src/components/commons/textarea.tsx
```

Length of output: 2208

---



</details>

**Textarea 포커스 시 색상 변경 확인됨**  
`src/components/commons/textarea.tsx`의 `<textarea>` 요소에 이미 `focus:text-gray-900` 클래스가 포함되어 있어, 포커스 시 글자 색상이 gray‑900으로 변경됩니다. 따라서 `text-gray-500`을 wrapper에 지정해도 포커스 시 색상 전환이 정상 작동합니다.

---

`117-117`: <details>
<summary>✅ Verification successful</summary>

**이미지 캐러셀에 페이지네이션 표시 확인 필요**

PR 목표에서 언급된 이미지 캐러셀 페이지네이션이 제대로 표시되는지 확인이 필요합니다.

이미지 캐러셀 컴포넌트가 정상적으로 페이지네이션을 표시하는지 확인하세요. PR 목표에 따르면 이 기능이 추가되었다고 언급되었지만, 빌드 환경에 따라 다르게 보일 수 있습니다.

---

🌐 Web query:

```web
Carousel pagination in React components best practices
```

💡 Result:

## Best Practices for Carousel Pagination in React Components

Carousel pagination is crucial for user navigation and accessibility in React applications. Below are the best practices and actionable recommendations, drawing from the latest web resources:

**Limit Number of Slides**
- Only include essential items in your carousel to prevent UI clutter and potential performance issues, especially on mobile. Too many slides can slow down the app and degrade user experience[3].

**Lazy Load Images and Content**
- Implement lazy loading for images to reduce initial load times and conserve bandwidth, which is particularly beneficial for carousels with heavy media content[3][5].

**Autoplay Considerations**
- Avoid setting autoplay as the default behavior. If you use autoplay, it should:
  - Be slow enough not to startle users,
  - Offer users clear, easy controls to pause or stop the autoplay, enhancing accessibility[3].

**Optimize Image Sizes**
- Use responsive images and compress them to minimize resource usage. Techniques such as `srcset` ensure images are tailored to the user's device, improving both performance and user experience[3].

**Provide Clear Navigation Controls**
- Include clear navigation aids, such as next/previous arrows and pagination dots.
- Ensure these controls are accessible via keyboard and screen readers, complying with accessibility standards[3][4].

**Responsive and Mobile Design**
- Your carousel should adapt to various screen sizes, support swipe gestures, and offer smooth transitions[5]. Many libraries, such as react-slick, swiper, and react-multi-carousel, provide built-in responsiveness[1][5].

**Performance Testing**
- Regularly test the carousel's performance under real-world conditions, especially with high-resolution images or on slow networks. Tools like Lighthouse are helpful for spotting bottlenecks[3].

**Customization and Animation**
- Use libraries or custom implementations that allow easy customization of pagination indicators. Animated dots that track the current slide enhance UX, as shown in React Native examples[4].

**Example: Implementing Pagination Dots in React**

You can use a state variable to track the active slide and render pagination dots accordingly. Here’s a simplified example:

```jsx
const [currentIndex, setCurrentIndex] = useState(0);
const data = [/* your carousel items */];

return (
  <div>
    <div className="carousel">
      {/* Carousel content here */}
    </div>
    <div className="pagination-dots">
      {data.map((_, idx) => (
        <button
          key={idx}
          className={idx === currentIndex ? 'active-dot' : ''}
          onClick={() => setCurrentIndex(idx)}
          aria-label={`Go to slide ${idx + 1}`}
        />
      ))}
    </div>
  </div>
);
```
This approach ensures clear, accessible pagination and state management for your carousel[2][4].

## Popular Libraries Supporting Pagination

| Library                  | Pagination Features        | Customization | Notes                                               |
|--------------------------|---------------------------|---------------|-----------------------------------------------------|
| react-slick              | Dots/arrows, swipe        | High          | Popular, performant, customizable                   |
| pure-react-carousel      | Dots/arrows, RTL          | Moderate      | Easy to use, accessible API                         |
| swiper                   | Dots/arrows, autoplay     | High          | Lightweight, mobile-friendly, supports touch/swipe  |
| react-multi-carousel     | Dots/arrows, breakpoints  | High          | Ideal for multi-item carousels, responsive          |
| Embla/Keen Slider        | Full control, high perf   | High          | Best for custom solutions and performance           |

**Tip:** For beginners, React Responsive Carousel offers easy setup, with built-in pagination and navigation[5].

## Summary

To implement carousel pagination in React, favor:
- Limiting content,
- Lazy loading,
- Clear navigation controls,
- Responsive/mobile design,
- Optimized media,
- And periodic performance testing.

Choose libraries that offer robust pagination features and tailor them for accessibility and branding. Avoid unnecessary autoplay and keep a user-centric focus for the best results[3][5].

Citations:

- 1: https://code-b.dev/blog/carousels-in-react
- 2: https://blog.bitsrc.io/simple-carousel-in-react-2aac73887243
- 3: https://wpwebinfotech.com/blog/how-to-setup-carousel-in-react/
- 4: https://dev.to/ajmal_hasan/building-a-customisable-carousel-with-auto-scroll-infinite-loop-pagination-in-react-native-using-reanimated-32f0
- 5: https://snappify.com/blog/react-carousel-component-libraries

---

캐러셀 컴포넌트의 페이지네이션 구현 여부를 확인하기 위해 해당 컴포넌트 파일을 찾아 내용을 출력합니다.

---

🏁 Script executed:

```shell
#!/bin/bash
# 1. MealImageCarousel 컴포넌트가 정의된 파일 찾기
fd -e tsx MealImageCarousel

# 2. 구현부 상위 200줄 출력하여 페이지네이션 관련 코드 확인
cat -n $(fd -e tsx MealImageCarousel) | sed -n '1,200p'
```

Length of output: 85

---

컴포넌트 정의 위치를 찾기 위해 리포지토리 전체에서 `MealImageCarousel` 참조와 파일명에 `carousel`이 포함된 tsx/jsx 파일을 검색합니다.

---

🏁 Script executed:

```shell
#!/bin/bash
# 1) MealImageCarousel 참조 검색
rg -n "MealImageCarousel" .

# 2) 파일명에 carousel이 포함된 tsx/jsx/js 파일 목록 확인
fd -e tsx -e jsx -e js carousel
```

Length of output: 691

---

추가로 페이지네이션 구현 여부를 확인하기 위해 코드 내용을 출력합니다.

---

🏁 Script executed:

```shell
#!/bin/bash
# meal-images-carousel.tsx에서 pagination 사용 부분 확인
rg -n -C 5 "pagination" "src/app/(client)/meal/components/meal-images-carousel.tsx"

# UI Carousel 컴포넌트에서 pagination prop 처리 확인
rg -n -C 5 "pagination" "src/components/ui/carousel.tsx"
```

Length of output: 1242

---

페이지네이션 렌더링 부분을 확인하기 위해 `meal-images-carousel.tsx` 전체 구현을 출력합니다.

---

🏁 Script executed:

```shell
#!/bin/bash
# meal-images-carousel.tsx에서 페이지네이션 UI 렌더링 코드 확인
sed -n '1,200p' src/app/\(client\)/meal/components/meal-images-carousel.tsx
```

Length of output: 2532

---

UI Carousel 구현부를 확인하여 `setApi`와 스크롤 API가 올바르게 동작하는지 출력합니다.

---

🏁 Script executed:

```shell
#!/bin/bash
# UI Carousel 컴포넌트 상위 200줄 출력
sed -n '1,200p' src/components/ui/carousel.tsx
```

Length of output: 5600

---



</details>

**페이지네이션 구현 확인 완료**

- `MealImageCarousel` 컴포넌트는 기본적으로 `pagination = true` 이며, 이미지가 2장 이상(`count > 1`)일 때만 하단에 `<Pagination>` 컴포넌트를 렌더링합니다.  
- `<Carousel>` 최상위 래퍼에 `relative` 클래스가 적용돼 있어, `Pagination`의 `absolute bottom-[0.6rem] left-1/2` 위치 지정이 올바르게 동작합니다.  
- `ui/carousel.tsx`의 `setApi` 및 이벤트 핸들러 등록 로직도 정상적으로 작동하여 `current` 인덱스 상태를 업데이트합니다.  

위 구현으로 코드상 페이지네이션이 올바르게 표시되므로 추가 검토는 불필요합니다.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-21T11:26:03Z
user: login: llddang
body: 디자인 수정 부탁드리겠습니다!
state: CHANGES_REQUESTED
author_association: OWNER
submitted_at: 2025-04-22T03:03:23Z
user: login: woohyuckk
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-22T06:26:21Z
user: login: jiyxxn
body: 확인했습니다! 고생하셨습니다!!
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-04-22T08:17:26Z
user: login: llddang
body: 고생하셨습니다!!
state: APPROVED
author_association: OWNER
submitted_at: 2025-04-22T08:25:35Z
user: login: woohyuckk
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-22T08:34:52Z
user: login: arendt9797
body: 리팩토링 고생하셨습니다
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-04-22T11:10:25Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>🧹 Nitpick comments (2)</summary><blockquote>

<details>
<summary>src/app/(client)/meal/post/edit/page.tsx (2)</summary><blockquote>

`7-23`: **메타데이터 생성 로직이 잘 구현되었습니다.**

`generateMetadata` 함수를 통해 페이지의 메타데이터를 동적으로 생성하는 로직이 적절하게 구현되었습니다. 사용자 정보, 이미지 목록, AI 응답 데이터가 있는지 확인하여 상황에 맞는 메타데이터를 반환하고 있습니다.

다만, 함수 내에서 `aiResponses.length === 0` 체크 전에 `aiResponses`가 undefined인 경우를 대비한 안전장치가 없습니다. API 호출 실패 시 방어 로직이 필요할 수 있습니다.

```diff
- const aiResponses = await getAiResponses();
+ const aiResponses = await getAiResponses() || [];

- if (!userId || !imageList || aiResponses.length === 0) {
+ if (!userId || !imageList || !aiResponses || aiResponses.length === 0) {
```

---

`25-35`: **서버 컴포넌트 로직이 간결하고 명확합니다.**

서버 컴포넌트로 구현된 `MealPostEditPage`가 필요한 데이터를 서버에서 가져와 적절히 처리하고 있습니다. 필요한 데이터가 없을 경우 리다이렉트 처리도 잘 되어있습니다.

위의 메타데이터 생성 함수와 마찬가지로 여기서도 `aiResponses`에 대한 추가 방어 로직이 필요할 수 있습니다. 또한 두 함수에서 동일한 API 호출이 중복되는데, 이는 Next.js의 서버 컴포넌트 특성상 캐싱이 되겠지만, 향후 리팩토링 시 공통 로직으로 분리하는 것도 고려해볼 수 있습니다.

```diff
- const aiResponses = await getAiResponses();
+ const aiResponses = await getAiResponses() || [];

- if (!userId || !imageList || aiResponses.length === 0) {
+ if (!userId || !imageList || !aiResponses || aiResponses.length === 0) {
```

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between cf1823bdef1f5dad38b13c7412135e4b705b6ad7 and 0c178233f0abf18404754a9fdb1ac7c7f4f9c3ef.

</details>

<details>
<summary>📒 Files selected for processing (3)</summary>

* `src/app/(client)/meal/post/edit/components/edit-result-section.tsx` (1 hunks)
* `src/app/(client)/meal/post/edit/page.tsx` (1 hunks)
* `src/app/globals.css` (1 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (2)</summary>

* src/app/globals.css
* src/app/(client)/meal/post/edit/components/edit-result-section.tsx

</details>

<details>
<summary>🔇 Additional comments (3)</summary><blockquote>

<details>
<summary>src/app/(client)/meal/post/edit/page.tsx (3)</summary>

`1-5`: **클라이언트 컴포넌트에서 서버 컴포넌트로의 전환이 잘 이루어졌습니다.**

클라이언트 사이드 렌더링에서 서버 사이드 렌더링으로 전환하여 데이터 페칭을 서버에서 처리하도록 변경한 점이 좋습니다. 필요한 import들을 적절히 가져오고 있습니다.

---

`34-34`: **클라이언트 컴포넌트와의 인터페이스가 명확합니다.**

서버에서 가져온 데이터(이미지 목록과 초기 식사 목록)를 클라이언트 컴포넌트인 `EditResultSection`에 props로 전달하는 방식이 명확합니다. Server Component에서 Client Component로의 데이터 흐름이 잘 구현되었습니다.

---

`1-38`: **전반적인 코드 구조 개선이 잘 이루어졌습니다.**

클라이언트 컴포넌트에서 서버 컴포넌트로의 전환을 통해 더 효율적인 데이터 페칭과 렌더링 구조를 갖추게 되었습니다. 다음과 같은 이점이 있습니다:

1. 서버에서 데이터를 미리 가져와 클라이언트로 전달함으로써 초기 로딩 속도 향상
2. SEO를 위한 메타데이터 동적 생성 지원
3. 필요한 데이터가 없을 경우 적절한 리다이렉트 처리
4. 관심사 분리가 잘 되어 있음 (서버 데이터 페칭 vs. 클라이언트 UI 렌더링)

PR 목표에 맞게 코드 리팩토링이 잘 이루어진 것으로 보입니다. 식단 기록 페이지의 디자인 QA를 위한 기반 구조가 잘 마련되었습니다.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-23T01:05:08Z

Review comments:
diff_hunk: @@ -149,3 +161,7 @@ type MeasurementUnitValues = {
 };
 
 type MeasurementUnitType = 'KCAL' | 'GRAM';
+
+const parseNumber = (value: string) => {
+  return Number(value.replace(/,/g, ''));
+};
path: src/app/(client)/meal/post/edit/components/edit-card.tsx
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**빈 문자열 입력 시 0으로 강제 변환되는 문제**  
`parseNumber('')`가 `0`을 반환하여 사용자가 모든 숫자를 삭제하면 값이 0으로 설정됩니다. 빈 문자열은 `undefined`나 `null`로 처리해 폼 검증에서 “필수 값” 경고를 띄우는 것이 자연스럽습니다.

```diff
- const parseNumber = (value: string) => {
-   return Number(value.replace(/,/g, ''));
- };
+const parseNumber = (value: string) => {
+  const cleaned = value.replace(/,/g, '');
+  return cleaned === '' ? undefined : Number(cleaned);
+};
```



<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
const parseNumber = (value: string) => {
  const cleaned = value.replace(/,/g, '');
  return cleaned === '' ? undefined : Number(cleaned);
};
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-21T08:21:02Z
author_association: NONE
diff_hunk: @@ -1,57 +1,55 @@
 'use client';
-import { useFieldArray, useFormContext } from 'react-hook-form';
-import { FormEvent, useState } from 'react';
+import { Controller, useFormContext } from 'react-hook-form';
+import { useMemo, useState } from 'react';
 import MacronutrientBox from '@/components/commons/macronutrient-box';
 import IconButton from '@/components/commons/icon-button';
 import { Button } from '@/components/ui/button';
 import { MacronutrientEnum } from '@/types/nutrition.type';
 import {} from '@/types/DTO/meal.dto';
-import { CreateAiFullResponseDTO } from '@/types/DTO/ai_analysis.dto';
+import { AiResponseDTO } from '@/types/DTO/ai_analysis.dto';
 import dynamic from 'next/dynamic';
 import { Input } from '@/components/ui/input';
+import { formatNumberWithComma } from '@/utils/format.util';
+import { parseGeminiResponse } from '@/lib/gemini';
+import { generateCaloriesAnalysisByText } from '@/apis/gemini.api';
+import { Typography } from '@/components/ui/typography';
 
-const AiLoaderLottie = dynamic(() => import('@/components/commons/ai-loader-lottie'), {
+const AiLoaderWithoutBg = dynamic(() => import('./ai-loader-without-bg'), {
   ssr: false
 });
 
 type EditCardProps = {
-  mealDetail: CreateAiFullResponseDTO;
+  mealDetail: AiResponseDTO;
   idx: number;
+  onRemove: (idx: number) => void;
 };
 
-const EditCard = ({ mealDetail, idx }: EditCardProps) => {
-  const { control, getValues, register } = useFormContext();
+const EditCard = ({ mealDetail, idx, onRemove }: EditCardProps) => {
+  const { control, register, watch, setValue, getValues } = useFormContext();
   const [isLoading, setIsLoading] = useState(false);
 
-  const { remove: mealListRemove } = useFieldArray({ control, name: 'mealList' });
-  const { remove: mealsRemove } = useFieldArray({ control, name: 'meals' });
-
-  // TODO: 카드에서API 분석요청
-  // const menuName = watch(`meals.${idx}.menuName`);
-  // const weight = watch(`meals.${idx}.weight`);
-
-  // const isChanged = useMemo(() => {
-  //   const isMenuChanged = menuName !== mealDetail.menuName;
-  //   const isWeightChanged = weight !== mealDetail.weight;
-
-  //   const isAnalyzed = isMenuChanged || isWeightChanged;
-  //   return isAnalyzed;
-  // }, [weight, menuName, mealDetail]);
+  const menuName = watch(`mealList.${idx}.menuName`);
+  const weight = watch(`mealList.${idx}.weight`);
+  const menuDetail = watch(`mealList.${idx}`);
+  const isChanged = useMemo(() => {
+    const isMenuChanged = menuName !== mealDetail.menuName;
+    const isWeightChanged = weight !== mealDetail.weight;
+    const isAnalyzed = isMenuChanged || isWeightChanged;
+    return isAnalyzed;
+  }, [weight, menuName, mealDetail]);
 
   const handleAnalyze = async () => {
     setIsLoading(true);
     try {
-      const input = getValues(`meals.${idx}`);
-      if (!input.menuName) {
-        alert('메뉴명은 필수항목 입니다.');
-        return;
-      }
-      if (!input.weight || !input.calories) {
-        alert('무게와 칼로리를 모르실 경우 0을 입력해주세요.');
-      }
+      const generatedTextResult = await generateCaloriesAnalysisByText(menuName, weight);
+      const parsedResult = parseGeminiResponse(generatedTextResult);
+      const aiResult = parsedResult[0];
+
+      const meal = getValues(`mealList.${idx}`);
+      const newDetail = { ...meal, ...aiResult };
+      setValue(`mealList.${idx}`, newDetail);
     } catch (error) {
path: src/app/(client)/meal/post/edit/components/edit-card.tsx
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**AI 분석 결과 미수신 시 방어 로직 필요**  
`parseGeminiResponse`가 빈 배열을 반환하면 `aiResult`가 `undefined`가 되어 이후 `newDetail`에 `undefined` 값들이 덮어써집니다. 실패 시 사용자에게 알림 후 기존 값을 유지하도록 방어 코드를 추가해 주세요.

```diff
- const aiResult = parsedResult[0];
- const meal = getValues(`mealList.${idx}`);
- const newDetail = { ...meal, ...aiResult };
- setValue(`mealList.${idx}`, newDetail);
+ const aiResult = parsedResult[0];
+ if (!aiResult) {
+   alert('AI 분석 결과를 가져오지 못했습니다. 잠시 후 다시 시도해주세요.');
+   return;
+ }
+ const meal = getValues(`mealList.${idx}`);
+ setValue(`mealList.${idx}`, { ...meal, ...aiResult });
```



<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

`````suggestion
      const generatedTextResult = await generateCaloriesAnalysisByText(menuName, weight);
      const parsedResult = parseGeminiResponse(generatedTextResult);
      const aiResult = parsedResult[0];
+     if (!aiResult) {
+       alert('AI 분석 결과를 가져오지 못했습니다. 잠시 후 다시 시도해주세요.');
+       return;
+     }
      const meal = getValues(`mealList.${idx}`);
-     const newDetail = { ...meal, ...aiResult };
-     setValue(`mealList.${idx}`, newDetail);
+     setValue(`mealList.${idx}`, { ...meal, ...aiResult });
    } catch (error) {
`````

</details>

<!-- suggestion_end -->

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-21T08:21:02Z
author_association: NONE
diff_hunk: @@ -40,7 +40,7 @@ const FOOD_IMAGE_ANALYSIS_PROMPT = `
   2. 1인분 기준의 대략적인 예상 중량(g, "weight")
   3. 2번의 예상 중량 기준의 대략적인 예상 칼로리(kcal, "calories")
   4. 주요 영양성분 : 탄수화물(g, "carbohydrate"), 단백질(g, "protein"), 지방(g, "fat")
-  
+  5. 영양 성분은 소숫점을 제외하고 정수로 응답해주세요.
path: src/apis/gemini.api.ts
user: login: jiyxxn
body: 소수점이 맞음. 201n년에 개정댐.
created_at: 2025-04-21T08:26:31Z
author_association: COLLABORATOR
diff_hunk: @@ -31,7 +31,7 @@ const MealImageCarousel = ({ imageList, pagination = true }: { imageList: string
     if (api) api.scrollTo(index);
   };
   // 페이지네이션이 사용 가능한 경우 - api 로드 완료 && 페이지네이션 사용 true && 이미지 1개 이상
-  const isPaginationOn = api && pagination && count > 1;
+  const isPaginationOn = typeof window !== 'undefined' && api && pagination && count > 1;
path: src/app/(client)/meal/components/meal-images-carousel.tsx
user: login: jiyxxn
body: `typeof window !== 'undefined'`는 `isClient` 사용 가능할 것 같습니다!
created_at: 2025-04-21T08:27:51Z
author_association: COLLABORATOR
diff_hunk: @@ -31,7 +31,7 @@ const MealImageCarousel = ({ imageList, pagination = true }: { imageList: string
     if (api) api.scrollTo(index);
   };
   // 페이지네이션이 사용 가능한 경우 - api 로드 완료 && 페이지네이션 사용 true && 이미지 1개 이상
-  const isPaginationOn = api && pagination && count > 1;
+  const isPaginationOn = typeof window !== 'undefined' && api && pagination && count > 1;
path: src/app/(client)/meal/components/meal-images-carousel.tsx
user: login: llddang
body: 새로 추가된 부분을 `isClient()` 함수로 대체해도 좋을 것 같아요!
created_at: 2025-04-21T08:27:56Z
author_association: OWNER
diff_hunk: @@ -16,14 +16,14 @@ const UploadImageSection = ({ isRecorded }: UploadImageSectionProps): JSX.Elemen
 
   if (isLoading) {
     return (
-      <div className="flex min-h-[calc(100vh-60px)] items-center justify-center">
+      <div className="flex min-h-[calc(100vh-64px-76px)] items-center justify-center">
path: src/app/(client)/meal/post/components/upload-image-section.tsx
user: login: jiyxxn
body: 이것 뭐에요? -140px을 해주면 안됐던 이유가 뭘까 심란하게 고민해지는 5시 28분..
created_at: 2025-04-21T08:28:29Z
author_association: COLLABORATOR
diff_hunk: @@ -1,57 +1,55 @@
 'use client';
-import { useFieldArray, useFormContext } from 'react-hook-form';
-import { FormEvent, useState } from 'react';
+import { Controller, useFormContext } from 'react-hook-form';
+import { useMemo, useState } from 'react';
 import MacronutrientBox from '@/components/commons/macronutrient-box';
 import IconButton from '@/components/commons/icon-button';
 import { Button } from '@/components/ui/button';
 import { MacronutrientEnum } from '@/types/nutrition.type';
 import {} from '@/types/DTO/meal.dto';
-import { CreateAiFullResponseDTO } from '@/types/DTO/ai_analysis.dto';
+import { AiResponseDTO } from '@/types/DTO/ai_analysis.dto';
 import dynamic from 'next/dynamic';
 import { Input } from '@/components/ui/input';
+import { formatNumberWithComma } from '@/utils/format.util';
+import { parseGeminiResponse } from '@/lib/gemini';
+import { generateCaloriesAnalysisByText } from '@/apis/gemini.api';
+import { Typography } from '@/components/ui/typography';
 
-const AiLoaderLottie = dynamic(() => import('@/components/commons/ai-loader-lottie'), {
+const AiLoaderWithoutBg = dynamic(() => import('./ai-loader-without-bg'), {
path: src/app/(client)/meal/post/edit/components/edit-card.tsx
user: login: jiyxxn
body: 아하 왜 기존 `AiLoaderLottie`의 props를 수정 안하시고 따로 파일을 만드셨을까 했는데 그대로 import 해야 해서 그렇군요
created_at: 2025-04-21T08:30:49Z
author_association: COLLABORATOR
path: src/app/(client)/meal/post/edit/components/ai-loader-without-bg.tsx
user: login: llddang
body: <img src="https://github.com/user-attachments/assets/4325856c-e253-4032-b69e-6ef3005dae87" width="400px" />

해당 로티에서 배경 들어가 있습니다!
공통 컴포넌트로 만들어진 로티 파일을 사용해도 괜찮을 것 같습니다!
created_at: 2025-04-21T08:33:36Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,17 @@
+import Lottie from 'react-lottie-player';
+import AiLoaderStar from '@/../public/lottie/ai-loader-star.json';
+
+const AiLoaderWithoutBg = () => {
+  return (
+    <div className="relative flex aspect-square w-20 items-center justify-center">
+      <Lottie
+        loop
+        play
+        animationData={AiLoaderStar}
+        className="absolute left-1/2 top-1/2 w-full -translate-x-1/2 -translate-y-1/2"
+      />
+    </div>
+  );
+};
+
+export default AiLoaderWithoutBg;
path: src/app/(client)/meal/post/edit/components/ai-loader-without-bg.tsx
user: login: llddang
body: <img src="https://github.com/user-attachments/assets/1788ad6a-1a14-4bd7-856c-aa173e9ef07f" width="300" />

해당 애니메이션에도 배경이 들어가 있으니, 공통 컴포넌트로 만들어진 로티를 사용해도 괜찮을 것 같습니다!
created_at: 2025-04-21T08:36:08Z
author_association: OWNER
diff_hunk: @@ -60,52 +58,66 @@ const EditCard = ({ mealDetail, idx }: EditCardProps) => {
   const handleDelete = async () => {
     const isConfirm = window.confirm('정말 삭제하시겠습니까?');
     if (isConfirm) {
-      mealListRemove(idx);
-      mealsRemove(idx);
+      onRemove(idx);
     }
   };
 
-  const onHandleMaxLengthInput = (e: FormEvent<HTMLInputElement>) => {
-    e.currentTarget.value = e.currentTarget.value.replace(/[^0-9]/g, '').slice(0, MAX_NUMERIC_LENGTH);
-  };
-
   return (
     <div className="flex w-full flex-col items-center justify-center gap-2 self-stretch rounded-2xl bg-white/50 p-2 backdrop-blur-[50px]">
       {isLoading ? (
-        <AiLoaderLottie />
+        <div className="flex h-[11.875rem] w-full flex-col items-center justify-center rounded-xl bg-white">
path: src/app/(client)/meal/post/edit/components/edit-card.tsx
user: login: jiyxxn
body: `height`를 고정 픽셀로 주는 건 좀 위험할 것 같긴 한데요.. 세로별로 다 다른 기기에서도 동일하게 가운데로 오게 되나요? 만약 고정 픽셀로 주더라도 시안 사이즈랑 다른 것 같아서 확인이 필요할 것 같아요~
created_at: 2025-04-21T08:37:29Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,250 @@
+'use client';
+
+import { AiResponseDTO } from '@/types/DTO/ai_analysis.dto';
+import { MealDTO } from '@/types/DTO/meal.dto';
+import { MealCategory } from '@/types/meal-category.type';
+import { createMealWithDetails, deleteMealAnalysisDetail } from '@/apis/meal.api';
+import { uploadImage } from '@/apis/storage.api';
+import SITE_MAP from '@/constants/site-map.constant';
+import { formatTimestamp } from '@/utils/format.util';
+import { urlToFile } from '../../../utils/file.util';
+import { zodResolver } from '@hookform/resolvers/zod';
+import { z } from 'zod';
+import { FormProvider, useFieldArray, useForm } from 'react-hook-form';
+import { useRouter } from 'next/navigation';
+import { useState } from 'react';
+import EditCard from './edit-card';
+import MealImageCarousel from '../../../components/meal-images-carousel';
+import { Typography } from '@/components/ui/typography';
+import GlassBackground from '@/components/commons/glass-background';
+import TagSelectItem from '@/components/commons/tag-select-item';
+import MealEditCalendar from './meal-edit-calendar';
+import Textarea from '@/components/commons/textarea';
+import { Button } from '@/components/ui/button';
+import TimePicker, { TimeFields } from './time-picker';
+
+type EditResultSectionProps = {
+  imageList: string[];
+  mealList: AiResponseDTO[];
+};
+
+const EditResultSection = ({ imageList, mealList }: EditResultSectionProps): JSX.Element => {
+  const router = useRouter();
+  const [isLoading, setIsLoading] = useState(false);
+  const now = new Date();
+  const { meridiem, hours, minutes } = getTimeFieldsFromDate(now);
+
+  const mealFormMethods = useForm({
+    resolver: zodResolver(mealEditFormSchema),
+    defaultValues: {
+      mealImages: imageList,
+      mealList: mealList,
+      date: {
+        day: new Date(),
+        meridiem,
+        hours,
+        minutes
+      },
+      mealCategory: MealCategory.BREAKFAST,
+      memo: ''
+    },
+    mode: 'onBlur'
+  });
+
+  const { fields: mealCardList, remove } = useFieldArray({ control: mealFormMethods.control, name: 'mealList' });
+
+  const day = mealFormMethods.getValues('date.day');
+  const date = mealFormMethods.watch('date');
+
+  const handleDayChange = (day: Date) => mealFormMethods.setValue('date.day', day);
+
+  const handleTimeChange = (time: TimeFields) => {
+    mealFormMethods.setValue('date.meridiem', time.meridiem);
+    mealFormMethods.setValue('date.hours', time.hours);
+    mealFormMethods.setValue('date.minutes', time.minutes);
+  };
+
+  const onSubmit = async (form: MealEditFormData) => {
+    const files = await Promise.all(form.mealImages.map((url, idx) => urlToFile(url, idx)));
+    const imagesFormData = new FormData();
+    setIsLoading(true);
+    try {
+      if (!form) {
+        return alert(' 데이터 형식이 올바르지 않습니다.');
+      }
+
+      const { mealImages, date, memo, mealCategory } = form;
+      const ateAt = formatTimestamp(date);
+
+      for (const file of files) {
+        imagesFormData.append('file', file);
+        await uploadImage('meal', imagesFormData);
+      }
+
+      const newMeals = {
+        foodImages: mealImages,
+        ateAt,
+        mealCategory,
+        memo
+      };
+
+      const { mealDetails } = await createMealWithDetails(
+        newMeals as Pick<MealDTO, 'ateAt' | 'foodImages' | 'memo' | 'mealCategory'>,
+        mealList.map((meal) => ({
+          menuName: meal.menuName,
+          weight: meal.weight,
+          calories: meal.calories,
+          carbohydrate: meal.carbohydrate,
+          protein: meal.protein,
+          fat: meal.fat
+        }))
+      );
+      if (mealDetails) {
+        await deleteMealAnalysisDetail();
+        router.push(SITE_MAP.HOME);
+      }
+    } catch (err) {
+      alert('식사 정보 등록에 실패하였습니다. 잠시후 다시 시도해주세요');
+      console.error('등록에 실패 했습니다. ', err);
path: src/app/(client)/meal/post/edit/components/edit-result-section.tsx
user: login: jiyxxn
body: 사소하지만 문구와 띄어쓰기가 통일되는게 좋을 것 같습니다! `실패했습니다.` 로 통일하는 거 어떨까요
created_at: 2025-04-21T08:41:53Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,250 @@
+'use client';
+
+import { AiResponseDTO } from '@/types/DTO/ai_analysis.dto';
+import { MealDTO } from '@/types/DTO/meal.dto';
+import { MealCategory } from '@/types/meal-category.type';
+import { createMealWithDetails, deleteMealAnalysisDetail } from '@/apis/meal.api';
+import { uploadImage } from '@/apis/storage.api';
+import SITE_MAP from '@/constants/site-map.constant';
+import { formatTimestamp } from '@/utils/format.util';
+import { urlToFile } from '../../../utils/file.util';
+import { zodResolver } from '@hookform/resolvers/zod';
+import { z } from 'zod';
+import { FormProvider, useFieldArray, useForm } from 'react-hook-form';
+import { useRouter } from 'next/navigation';
+import { useState } from 'react';
+import EditCard from './edit-card';
+import MealImageCarousel from '../../../components/meal-images-carousel';
+import { Typography } from '@/components/ui/typography';
+import GlassBackground from '@/components/commons/glass-background';
+import TagSelectItem from '@/components/commons/tag-select-item';
+import MealEditCalendar from './meal-edit-calendar';
+import Textarea from '@/components/commons/textarea';
+import { Button } from '@/components/ui/button';
+import TimePicker, { TimeFields } from './time-picker';
+
+type EditResultSectionProps = {
+  imageList: string[];
+  mealList: AiResponseDTO[];
+};
+
+const EditResultSection = ({ imageList, mealList }: EditResultSectionProps): JSX.Element => {
+  const router = useRouter();
+  const [isLoading, setIsLoading] = useState(false);
+  const now = new Date();
+  const { meridiem, hours, minutes } = getTimeFieldsFromDate(now);
+
+  const mealFormMethods = useForm({
+    resolver: zodResolver(mealEditFormSchema),
+    defaultValues: {
+      mealImages: imageList,
+      mealList: mealList,
+      date: {
+        day: new Date(),
+        meridiem,
+        hours,
+        minutes
+      },
+      mealCategory: MealCategory.BREAKFAST,
+      memo: ''
+    },
+    mode: 'onBlur'
+  });
+
+  const { fields: mealCardList, remove } = useFieldArray({ control: mealFormMethods.control, name: 'mealList' });
+
+  const day = mealFormMethods.getValues('date.day');
+  const date = mealFormMethods.watch('date');
+
+  const handleDayChange = (day: Date) => mealFormMethods.setValue('date.day', day);
+
+  const handleTimeChange = (time: TimeFields) => {
+    mealFormMethods.setValue('date.meridiem', time.meridiem);
+    mealFormMethods.setValue('date.hours', time.hours);
+    mealFormMethods.setValue('date.minutes', time.minutes);
+  };
+
+  const onSubmit = async (form: MealEditFormData) => {
+    const files = await Promise.all(form.mealImages.map((url, idx) => urlToFile(url, idx)));
+    const imagesFormData = new FormData();
+    setIsLoading(true);
+    try {
+      if (!form) {
+        return alert(' 데이터 형식이 올바르지 않습니다.');
+      }
+
+      const { mealImages, date, memo, mealCategory } = form;
+      const ateAt = formatTimestamp(date);
+
+      for (const file of files) {
+        imagesFormData.append('file', file);
+        await uploadImage('meal', imagesFormData);
+      }
+
+      const newMeals = {
+        foodImages: mealImages,
+        ateAt,
+        mealCategory,
+        memo
+      };
+
+      const { mealDetails } = await createMealWithDetails(
+        newMeals as Pick<MealDTO, 'ateAt' | 'foodImages' | 'memo' | 'mealCategory'>,
+        mealList.map((meal) => ({
+          menuName: meal.menuName,
+          weight: meal.weight,
+          calories: meal.calories,
+          carbohydrate: meal.carbohydrate,
+          protein: meal.protein,
+          fat: meal.fat
+        }))
+      );
+      if (mealDetails) {
+        await deleteMealAnalysisDetail();
+        router.push(SITE_MAP.HOME);
+      }
+    } catch (err) {
+      alert('식사 정보 등록에 실패하였습니다. 잠시후 다시 시도해주세요');
+      console.error('등록에 실패 했습니다. ', err);
+      router.refresh();
+    } finally {
+      setIsLoading(false);
+    }
+  };
+
+  return (
+    <div className="px-4 pb-4 pt-2">
+      <MealImageCarousel imageList={imageList} />
+      <FormProvider {...mealFormMethods}>
+        <form onSubmit={mealFormMethods.handleSubmit(onSubmit)}>
+          <div className="mt-10 flex flex-col gap-3">
+            <Typography className="pl-1">
+              음식 정보
+              <Typography variant="subTitle2" as="span" className="ml-2">
+                {mealCardList.length}
+              </Typography>
+            </Typography>
+            {mealCardList.map((meal, idx) => (
+              <EditCard key={meal.id} idx={idx} mealDetail={meal} onRemove={remove} />
+            ))}
+          </div>
+
+          <section className="my-10 flex w-full flex-col items-start justify-center gap-3">
+            <Typography as="h3" variant="body1" className="pl-1">
+              식사 시간
+            </Typography>
+            <GlassBackground className="min-h-auto flex w-full flex-col items-start gap-3 rounded-2xl border-none p-4">
+              <div className="scrollbar-hidden flex w-full items-start justify-between gap-2 overflow-x-auto">
+                {MEAL_CATEGORY.map((option) => {
+                  const field = mealFormMethods.register('mealCategory');
+                  const selected = mealFormMethods.watch('mealCategory');
+                  return (
+                    <TagSelectItem
+                      key={option.value}
+                      id={option.value}
+                      groupName="MEAL_CATEGORY"
+                      icon={option.icon}
+                      label={option.label}
+                      value={option.value}
+                      checked={selected === option.value}
+                      {...field}
+                    />
+                  );
+                })}
+              </div>
+              <div className="flex w-full gap-2">
+                <MealEditCalendar date={day} onDateChange={handleDayChange} />
+                <TimePicker currentTime={date} onTimeChange={handleTimeChange} />
+              </div>
+            </GlassBackground>
+          </section>
+          <section className="space-y-3">
+            <Typography as="h3" variant="body1" className="pl-1">
+              식사 일기
+            </Typography>
+            <GlassBackground className="min-h-auto flex w-full flex-col gap-3 rounded-2xl border-none">
+              <div className="flex items-start justify-between gap-[0.38rem] before:mt-[0.13rem] before:block before:aspect-square before:w-[1.125rem] before:bg-edit-4-icon before:bg-contain before:content-['']">
+                <Typography as="span" variant="subTitle3" className="flex-1 !font-medium text-gray-600">
+                  음식을 먹을 때 어떤 기분이었는지 간단하게 적어주세요. 식습관을 돌아보는데 큰 도움이 돼요!
+                </Typography>
+              </div>
+              <Textarea
+                {...mealFormMethods.register('memo')}
+                className="min-h-60 text-gray-500"
path: src/app/(client)/meal/post/edit/components/edit-result-section.tsx
user: login: jiyxxn
body: 이거 text 컬러 따로 주면 입력해도 이 글씨 그대로 반영되지 않나요? 
created_at: 2025-04-21T08:43:07Z
author_association: COLLABORATOR
diff_hunk: @@ -42,33 +42,38 @@ export const formatDateWithDash = (date: Date): string => {
 /**
  * 날짜와 시간 정보를 타임스탬프 문자열로 변환하는 함수입니다.
  *
- * @function formatTimestamp
- * @param {Date} baseDate - 기준 날짜 객체
- * @param {Object} time - 시간 정보 객체
- * @param {('오전'|'오후')} time.meridiem - 오전/오후 구분
- * @param {string} time.hours - 시간
- * @param {string} time.minutes - 분
- * @returns {string} 'YYYY-MM-DD HH:MM:00' 형식의 타임스탬프 문자열
+ * @param datetime - 날짜 및 시간 정보를 포함한 객체
+ * @param datetime.day - 기준 날짜 (Date 객체)
+ * @param datetime.meridiem - '오전' 또는 '오후'
+ * @param datetime.hours - 시(hour), 문자열 형태 ('01' ~ '12')
+ * @param datetime.minutes - 분(minute), 문자열 형태 ('00' ~ '59')
+ * @returns 포맷된 timestamp 문자열 ('YYYY-MM-DD HH:mm:ss')
+ *
+
  */
-export const formatTimestamp = (
-  baseDate: Date,
-  time: { meridiem: '오전' | '오후'; hours: string; minutes: string }
-): string => {
-  let hour = parseInt(time.hours, 10);
-  const minutes = time.minutes.padStart(2, '0');
+export const formatTimestamp = (datetime: {
+  day: Date;
+  meridiem: '오전' | '오후';
+  hours: string;
+  minutes: string;
+}): string => {
+  const { day, meridiem, hours, minutes } = datetime;
+
+  let hour = parseInt(hours, 10);
+  const paddedMinutes = minutes.padStart(2, '0');
 
-  if (time.meridiem === '오전' && hour === 12) {
+  if (meridiem === '오전' && hour === 12) {
     hour = 0;
-  } else if (time.meridiem === '오후' && hour !== 12) {
+  } else if (meridiem === '오후' && hour !== 12) {
     hour += 12;
   }
 
-  const yyyy = baseDate.getFullYear();
-  const mm = String(baseDate.getMonth() + 1).padStart(2, '0');
-  const dd = String(baseDate.getDate()).padStart(2, '0');
+  const yyyy = day.getFullYear();
+  const mm = String(day.getMonth() + 1).padStart(2, '0');
+  const dd = String(day.getDate()).padStart(2, '0');
   const hh = String(hour).padStart(2, '0');
 
-  return `${yyyy}-${mm}-${dd} ${hh}:${minutes}:00`;
+  return `${yyyy}-${mm}-${dd} ${hh}:${paddedMinutes}:00`;
 };
path: src/utils/format.util.ts
user: login: llddang
body: ```tsx
export const formatTimestamp = (datetime: {
  day: Date;
  meridiem: '오전' | '오후';
  hours: string;
  minutes: string;
}): string => {
  const { day, meridiem, hours, minutes } = datetime;
  
  let hour = parseInt(hours, 10);
  if (meridiem === '오전' && hour === 12) hour = 0;
  if (meridiem === '오후' && hour !== 12) hour += 12;
  
  const timestamp = new Date(day);
  timestamp.setHours(hour);
  timestamp.setMinutes(parseInt(minutes, 10));
  timestamp.setSeconds(0); // 생략 가능
  timestamp.setMilliseconds(0); // 생략 가능
  
  return timestamp.toISOString(); // '2025-04-21T08:53:56.103Z'
};
```

Date를 만든 다음에, Date에서 제공하는 toISOString을 통해 문자열로 변경하는 것은 어떻게 생각하시나요?
created_at: 2025-04-21T08:59:11Z
author_association: OWNER
diff_hunk: @@ -128,7 +140,7 @@ const EditCard = ({ mealDetail, idx }: EditCardProps) => {
 export default EditCard;
 
 const MAX_NUMERIC_LENGTH = 4;
-
+const MAX_MENU_NAME_LENGTH = 16;
path: src/app/(client)/meal/post/edit/components/edit-card.tsx
user: login: llddang
body: 이렇게 input에 직접 넣어주는 방법도 있지만요.

저희가 zod를 사용하는 만큼 zod를 활용하는 것은 어떻게 생각하시나요?
created_at: 2025-04-21T09:03:26Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,250 @@
+'use client';
+
+import { AiResponseDTO } from '@/types/DTO/ai_analysis.dto';
+import { MealDTO } from '@/types/DTO/meal.dto';
+import { MealCategory } from '@/types/meal-category.type';
+import { createMealWithDetails, deleteMealAnalysisDetail } from '@/apis/meal.api';
+import { uploadImage } from '@/apis/storage.api';
+import SITE_MAP from '@/constants/site-map.constant';
+import { formatTimestamp } from '@/utils/format.util';
+import { urlToFile } from '../../../utils/file.util';
+import { zodResolver } from '@hookform/resolvers/zod';
+import { z } from 'zod';
+import { FormProvider, useFieldArray, useForm } from 'react-hook-form';
+import { useRouter } from 'next/navigation';
+import { useState } from 'react';
+import EditCard from './edit-card';
+import MealImageCarousel from '../../../components/meal-images-carousel';
+import { Typography } from '@/components/ui/typography';
+import GlassBackground from '@/components/commons/glass-background';
+import TagSelectItem from '@/components/commons/tag-select-item';
+import MealEditCalendar from './meal-edit-calendar';
+import Textarea from '@/components/commons/textarea';
+import { Button } from '@/components/ui/button';
+import TimePicker, { TimeFields } from './time-picker';
+
+type EditResultSectionProps = {
+  imageList: string[];
+  mealList: AiResponseDTO[];
+};
+
+const EditResultSection = ({ imageList, mealList }: EditResultSectionProps): JSX.Element => {
+  const router = useRouter();
+  const [isLoading, setIsLoading] = useState(false);
+  const now = new Date();
+  const { meridiem, hours, minutes } = getTimeFieldsFromDate(now);
+
+  const mealFormMethods = useForm({
+    resolver: zodResolver(mealEditFormSchema),
+    defaultValues: {
+      mealImages: imageList,
+      mealList: mealList,
+      date: {
+        day: new Date(),
+        meridiem,
+        hours,
+        minutes
+      },
+      mealCategory: MealCategory.BREAKFAST,
+      memo: ''
+    },
+    mode: 'onBlur'
+  });
+
+  const { fields: mealCardList, remove } = useFieldArray({ control: mealFormMethods.control, name: 'mealList' });
+
+  const day = mealFormMethods.getValues('date.day');
+  const date = mealFormMethods.watch('date');
+
+  const handleDayChange = (day: Date) => mealFormMethods.setValue('date.day', day);
+
+  const handleTimeChange = (time: TimeFields) => {
+    mealFormMethods.setValue('date.meridiem', time.meridiem);
+    mealFormMethods.setValue('date.hours', time.hours);
+    mealFormMethods.setValue('date.minutes', time.minutes);
+  };
+
+  const onSubmit = async (form: MealEditFormData) => {
+    const files = await Promise.all(form.mealImages.map((url, idx) => urlToFile(url, idx)));
+    setIsLoading(true);
+    try {
+      if (!form) {
+        return alert(' 데이터 형식이 올바르지 않습니다.');
+      }
+
+      const { mealImages, date, memo, mealCategory } = form;
+      const ateAt = formatTimestamp(date);
+
+      for (const file of files) {
+        const formData = new FormData();
+        formData.append('file', file);
+        await uploadImage('meal', formData);
+      }
+
+      const newMeals = {
+        foodImages: mealImages,
+        ateAt,
+        mealCategory,
+        memo
+      };
+
path: src/app/(client)/meal/post/edit/components/edit-result-section.tsx
user: login: llddang
body: newMeals의 foodImages가 mealImage이면 버려질 스토리지의 이미지를 table에서 갖게 됩니다.

여기서 foodImages는 바로 위에서 for(const file of files){...}의 로직 내에서 업로드 된 이미지의 url이어야 합니다.
created_at: 2025-04-21T09:14:33Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,250 @@
+'use client';
+
+import { AiResponseDTO } from '@/types/DTO/ai_analysis.dto';
+import { MealDTO } from '@/types/DTO/meal.dto';
+import { MealCategory } from '@/types/meal-category.type';
+import { createMealWithDetails, deleteMealAnalysisDetail } from '@/apis/meal.api';
+import { uploadImage } from '@/apis/storage.api';
+import SITE_MAP from '@/constants/site-map.constant';
+import { formatTimestamp } from '@/utils/format.util';
+import { urlToFile } from '../../../utils/file.util';
+import { zodResolver } from '@hookform/resolvers/zod';
+import { z } from 'zod';
+import { FormProvider, useFieldArray, useForm } from 'react-hook-form';
+import { useRouter } from 'next/navigation';
+import { useState } from 'react';
+import EditCard from './edit-card';
+import MealImageCarousel from '../../../components/meal-images-carousel';
+import { Typography } from '@/components/ui/typography';
+import GlassBackground from '@/components/commons/glass-background';
+import TagSelectItem from '@/components/commons/tag-select-item';
+import MealEditCalendar from './meal-edit-calendar';
+import Textarea from '@/components/commons/textarea';
+import { Button } from '@/components/ui/button';
+import TimePicker, { TimeFields } from './time-picker';
+
+type EditResultSectionProps = {
+  imageList: string[];
+  mealList: AiResponseDTO[];
+};
+
+const EditResultSection = ({ imageList, mealList }: EditResultSectionProps): JSX.Element => {
+  const router = useRouter();
+  const [isLoading, setIsLoading] = useState(false);
+  const now = new Date();
+  const { meridiem, hours, minutes } = getTimeFieldsFromDate(now);
+
+  const mealFormMethods = useForm({
+    resolver: zodResolver(mealEditFormSchema),
+    defaultValues: {
+      mealImages: imageList,
+      mealList: mealList,
+      date: {
+        day: new Date(),
+        meridiem,
+        hours,
+        minutes
+      },
+      mealCategory: MealCategory.BREAKFAST,
+      memo: ''
+    },
+    mode: 'onBlur'
+  });
+
+  const { fields: mealCardList, remove } = useFieldArray({ control: mealFormMethods.control, name: 'mealList' });
+
+  const day = mealFormMethods.getValues('date.day');
+  const date = mealFormMethods.watch('date');
+
+  const handleDayChange = (day: Date) => mealFormMethods.setValue('date.day', day);
+
+  const handleTimeChange = (time: TimeFields) => {
+    mealFormMethods.setValue('date.meridiem', time.meridiem);
+    mealFormMethods.setValue('date.hours', time.hours);
+    mealFormMethods.setValue('date.minutes', time.minutes);
+  };
+
+  const onSubmit = async (form: MealEditFormData) => {
+    const files = await Promise.all(form.mealImages.map((url, idx) => urlToFile(url, idx)));
+    setIsLoading(true);
+    try {
+      if (!form) {
+        return alert(' 데이터 형식이 올바르지 않습니다.');
+      }
+
+      const { mealImages, date, memo, mealCategory } = form;
+      const ateAt = formatTimestamp(date);
+
+      for (const file of files) {
+        const formData = new FormData();
+        formData.append('file', file);
+        await uploadImage('meal', formData);
+      }
+
+      const newMeals = {
+        foodImages: mealImages,
+        ateAt,
+        mealCategory,
+        memo
+      };
+
+      const { mealDetails } = await createMealWithDetails(
+        newMeals as Pick<MealDTO, 'ateAt' | 'foodImages' | 'memo' | 'mealCategory'>,
path: src/app/(client)/meal/post/edit/components/edit-result-section.tsx
user: login: llddang
body: 여기서 타입 단언이 불필요해보이는데용.
필요한가요?
created_at: 2025-04-21T09:15:00Z
author_association: OWNER
diff_hunk: @@ -0,0 +1,250 @@
+'use client';
+
+import { AiResponseDTO } from '@/types/DTO/ai_analysis.dto';
+import { MealDTO } from '@/types/DTO/meal.dto';
+import { MealCategory } from '@/types/meal-category.type';
+import { createMealWithDetails, deleteMealAnalysisDetail } from '@/apis/meal.api';
+import { uploadImage } from '@/apis/storage.api';
+import SITE_MAP from '@/constants/site-map.constant';
+import { formatTimestamp } from '@/utils/format.util';
+import { urlToFile } from '../../../utils/file.util';
+import { zodResolver } from '@hookform/resolvers/zod';
+import { z } from 'zod';
+import { FormProvider, useFieldArray, useForm } from 'react-hook-form';
+import { useRouter } from 'next/navigation';
+import { useState } from 'react';
+import EditCard from './edit-card';
+import MealImageCarousel from '../../../components/meal-images-carousel';
+import { Typography } from '@/components/ui/typography';
+import GlassBackground from '@/components/commons/glass-background';
+import TagSelectItem from '@/components/commons/tag-select-item';
+import MealEditCalendar from './meal-edit-calendar';
+import Textarea from '@/components/commons/textarea';
+import { Button } from '@/components/ui/button';
+import TimePicker, { TimeFields } from './time-picker';
+
+type EditResultSectionProps = {
+  imageList: string[];
+  mealList: AiResponseDTO[];
+};
+
+const EditResultSection = ({ imageList, mealList }: EditResultSectionProps): JSX.Element => {
+  const router = useRouter();
+  const [isLoading, setIsLoading] = useState(false);
+  const now = new Date();
+  const { meridiem, hours, minutes } = getTimeFieldsFromDate(now);
path: src/app/(client)/meal/post/edit/components/edit-result-section.tsx
user: login: llddang
body: getTimeFieldsFromDate에 default 값으로 현재 값을 넣어줌으로 34 번째 줄과 인자가 없어도 될 것 같습니다.
created_at: 2025-04-21T09:17:40Z
author_association: OWNER
diff_hunk: @@ -40,7 +40,7 @@ const FOOD_IMAGE_ANALYSIS_PROMPT = `
   2. 1인분 기준의 대략적인 예상 중량(g, "weight")
   3. 2번의 예상 중량 기준의 대략적인 예상 칼로리(kcal, "calories")
   4. 주요 영양성분 : 탄수화물(g, "carbohydrate"), 단백질(g, "protein"), 지방(g, "fat")
-  
+  5. 영양 성분은 소숫점을 제외하고 정수로 응답해주세요.
path: src/apis/gemini.api.ts
user: login: woohyuckk
body: ㅋㅋㅋㅋㅋㅋㅋ  커서가 자동완성해줬는데.. 한국어는 미숙한가봐요
created_at: 2025-04-21T09:38:25Z
author_association: COLLABORATOR
diff_hunk: @@ -16,14 +16,14 @@ const UploadImageSection = ({ isRecorded }: UploadImageSectionProps): JSX.Elemen
 
   if (isLoading) {
     return (
-      <div className="flex min-h-[calc(100vh-60px)] items-center justify-center">
+      <div className="flex min-h-[calc(100vh-64px-76px)] items-center justify-center">
path: src/app/(client)/meal/post/components/upload-image-section.tsx
user: login: woohyuckk
body: 헤더와 푸터 픽셀을 정확하게 기입한다고 합칠생각은 못했던... 
created_at: 2025-04-21T09:39:15Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,250 @@
+'use client';
+
+import { AiResponseDTO } from '@/types/DTO/ai_analysis.dto';
+import { MealDTO } from '@/types/DTO/meal.dto';
+import { MealCategory } from '@/types/meal-category.type';
+import { createMealWithDetails, deleteMealAnalysisDetail } from '@/apis/meal.api';
+import { uploadImage } from '@/apis/storage.api';
+import SITE_MAP from '@/constants/site-map.constant';
+import { formatTimestamp } from '@/utils/format.util';
+import { urlToFile } from '../../../utils/file.util';
+import { zodResolver } from '@hookform/resolvers/zod';
+import { z } from 'zod';
+import { FormProvider, useFieldArray, useForm } from 'react-hook-form';
+import { useRouter } from 'next/navigation';
+import { useState } from 'react';
+import EditCard from './edit-card';
+import MealImageCarousel from '../../../components/meal-images-carousel';
+import { Typography } from '@/components/ui/typography';
+import GlassBackground from '@/components/commons/glass-background';
+import TagSelectItem from '@/components/commons/tag-select-item';
+import MealEditCalendar from './meal-edit-calendar';
+import Textarea from '@/components/commons/textarea';
+import { Button } from '@/components/ui/button';
+import TimePicker, { TimeFields } from './time-picker';
+
+type EditResultSectionProps = {
+  imageList: string[];
+  mealList: AiResponseDTO[];
+};
+
+const EditResultSection = ({ imageList, mealList }: EditResultSectionProps): JSX.Element => {
+  const router = useRouter();
+  const [isLoading, setIsLoading] = useState(false);
+  const now = new Date();
+  const { meridiem, hours, minutes } = getTimeFieldsFromDate(now);
+
+  const mealFormMethods = useForm({
+    resolver: zodResolver(mealEditFormSchema),
+    defaultValues: {
+      mealImages: imageList,
+      mealList: mealList,
+      date: {
+        day: new Date(),
+        meridiem,
+        hours,
+        minutes
+      },
+      mealCategory: MealCategory.BREAKFAST,
+      memo: ''
+    },
+    mode: 'onBlur'
+  });
+
+  const { fields: mealCardList, remove } = useFieldArray({ control: mealFormMethods.control, name: 'mealList' });
+
+  const day = mealFormMethods.getValues('date.day');
+  const date = mealFormMethods.watch('date');
+
+  const handleDayChange = (day: Date) => mealFormMethods.setValue('date.day', day);
+
+  const handleTimeChange = (time: TimeFields) => {
+    mealFormMethods.setValue('date.meridiem', time.meridiem);
+    mealFormMethods.setValue('date.hours', time.hours);
+    mealFormMethods.setValue('date.minutes', time.minutes);
+  };
+
+  const onSubmit = async (form: MealEditFormData) => {
+    const files = await Promise.all(form.mealImages.map((url, idx) => urlToFile(url, idx)));
+    const imagesFormData = new FormData();
+    setIsLoading(true);
+    try {
+      if (!form) {
+        return alert(' 데이터 형식이 올바르지 않습니다.');
+      }
+
+      const { mealImages, date, memo, mealCategory } = form;
+      const ateAt = formatTimestamp(date);
+
+      for (const file of files) {
+        imagesFormData.append('file', file);
+        await uploadImage('meal', imagesFormData);
+      }
+
+      const newMeals = {
+        foodImages: mealImages,
+        ateAt,
+        mealCategory,
+        memo
+      };
+
+      const { mealDetails } = await createMealWithDetails(
+        newMeals as Pick<MealDTO, 'ateAt' | 'foodImages' | 'memo' | 'mealCategory'>,
+        mealList.map((meal) => ({
+          menuName: meal.menuName,
+          weight: meal.weight,
+          calories: meal.calories,
+          carbohydrate: meal.carbohydrate,
+          protein: meal.protein,
+          fat: meal.fat
+        }))
+      );
+      if (mealDetails) {
+        await deleteMealAnalysisDetail();
+        router.push(SITE_MAP.HOME);
+      }
+    } catch (err) {
+      alert('식사 정보 등록에 실패하였습니다. 잠시후 다시 시도해주세요');
+      console.error('등록에 실패 했습니다. ', err);
+      router.refresh();
+    } finally {
+      setIsLoading(false);
+    }
+  };
+
+  return (
+    <div className="px-4 pb-4 pt-2">
+      <MealImageCarousel imageList={imageList} />
+      <FormProvider {...mealFormMethods}>
+        <form onSubmit={mealFormMethods.handleSubmit(onSubmit)}>
+          <div className="mt-10 flex flex-col gap-3">
+            <Typography className="pl-1">
+              음식 정보
+              <Typography variant="subTitle2" as="span" className="ml-2">
+                {mealCardList.length}
+              </Typography>
+            </Typography>
+            {mealCardList.map((meal, idx) => (
+              <EditCard key={meal.id} idx={idx} mealDetail={meal} onRemove={remove} />
+            ))}
+          </div>
+
+          <section className="my-10 flex w-full flex-col items-start justify-center gap-3">
+            <Typography as="h3" variant="body1" className="pl-1">
+              식사 시간
+            </Typography>
+            <GlassBackground className="min-h-auto flex w-full flex-col items-start gap-3 rounded-2xl border-none p-4">
+              <div className="scrollbar-hidden flex w-full items-start justify-between gap-2 overflow-x-auto">
+                {MEAL_CATEGORY.map((option) => {
+                  const field = mealFormMethods.register('mealCategory');
+                  const selected = mealFormMethods.watch('mealCategory');
+                  return (
+                    <TagSelectItem
+                      key={option.value}
+                      id={option.value}
+                      groupName="MEAL_CATEGORY"
+                      icon={option.icon}
+                      label={option.label}
+                      value={option.value}
+                      checked={selected === option.value}
+                      {...field}
+                    />
+                  );
+                })}
+              </div>
+              <div className="flex w-full gap-2">
+                <MealEditCalendar date={day} onDateChange={handleDayChange} />
+                <TimePicker currentTime={date} onTimeChange={handleTimeChange} />
+              </div>
+            </GlassBackground>
+          </section>
+          <section className="space-y-3">
+            <Typography as="h3" variant="body1" className="pl-1">
+              식사 일기
+            </Typography>
+            <GlassBackground className="min-h-auto flex w-full flex-col gap-3 rounded-2xl border-none">
+              <div className="flex items-start justify-between gap-[0.38rem] before:mt-[0.13rem] before:block before:aspect-square before:w-[1.125rem] before:bg-edit-4-icon before:bg-contain before:content-['']">
+                <Typography as="span" variant="subTitle3" className="flex-1 !font-medium text-gray-600">
+                  음식을 먹을 때 어떤 기분이었는지 간단하게 적어주세요. 식습관을 돌아보는데 큰 도움이 돼요!
+                </Typography>
+              </div>
+              <Textarea
+                {...mealFormMethods.register('memo')}
+                className="min-h-60 text-gray-500"
path: src/app/(client)/meal/post/edit/components/edit-result-section.tsx
user: login: woohyuckk
body: `Textarea` 속성안에 `focus:text-gray-900`이 있습니다! 
created_at: 2025-04-21T09:53:16Z
author_association: COLLABORATOR
diff_hunk: @@ -42,33 +42,38 @@ export const formatDateWithDash = (date: Date): string => {
 /**
  * 날짜와 시간 정보를 타임스탬프 문자열로 변환하는 함수입니다.
  *
- * @function formatTimestamp
- * @param {Date} baseDate - 기준 날짜 객체
- * @param {Object} time - 시간 정보 객체
- * @param {('오전'|'오후')} time.meridiem - 오전/오후 구분
- * @param {string} time.hours - 시간
- * @param {string} time.minutes - 분
- * @returns {string} 'YYYY-MM-DD HH:MM:00' 형식의 타임스탬프 문자열
+ * @param datetime - 날짜 및 시간 정보를 포함한 객체
+ * @param datetime.day - 기준 날짜 (Date 객체)
+ * @param datetime.meridiem - '오전' 또는 '오후'
+ * @param datetime.hours - 시(hour), 문자열 형태 ('01' ~ '12')
+ * @param datetime.minutes - 분(minute), 문자열 형태 ('00' ~ '59')
+ * @returns 포맷된 timestamp 문자열 ('YYYY-MM-DD HH:mm:ss')
+ *
+
  */
-export const formatTimestamp = (
-  baseDate: Date,
-  time: { meridiem: '오전' | '오후'; hours: string; minutes: string }
-): string => {
-  let hour = parseInt(time.hours, 10);
-  const minutes = time.minutes.padStart(2, '0');
+export const formatTimestamp = (datetime: {
+  day: Date;
+  meridiem: '오전' | '오후';
+  hours: string;
+  minutes: string;
+}): string => {
+  const { day, meridiem, hours, minutes } = datetime;
+
+  let hour = parseInt(hours, 10);
+  const paddedMinutes = minutes.padStart(2, '0');
 
-  if (time.meridiem === '오전' && hour === 12) {
+  if (meridiem === '오전' && hour === 12) {
     hour = 0;
-  } else if (time.meridiem === '오후' && hour !== 12) {
+  } else if (meridiem === '오후' && hour !== 12) {
     hour += 12;
   }
 
-  const yyyy = baseDate.getFullYear();
-  const mm = String(baseDate.getMonth() + 1).padStart(2, '0');
-  const dd = String(baseDate.getDate()).padStart(2, '0');
+  const yyyy = day.getFullYear();
+  const mm = String(day.getMonth() + 1).padStart(2, '0');
+  const dd = String(day.getDate()).padStart(2, '0');
   const hh = String(hour).padStart(2, '0');
 
-  return `${yyyy}-${mm}-${dd} ${hh}:${minutes}:00`;
+  return `${yyyy}-${mm}-${dd} ${hh}:${paddedMinutes}:00`;
 };
path: src/utils/format.util.ts
user: login: woohyuckk
body: 세심하게 챙겨주셔서 감사합니다 이런방법도 있군요! 적용해보겠습니다.  
created_at: 2025-04-21T09:56:48Z
author_association: COLLABORATOR
diff_hunk: @@ -128,7 +140,7 @@ const EditCard = ({ mealDetail, idx }: EditCardProps) => {
 export default EditCard;
 
 const MAX_NUMERIC_LENGTH = 4;
-
+const MAX_MENU_NAME_LENGTH = 16;
path: src/app/(client)/meal/post/edit/components/edit-card.tsx
user: login: woohyuckk
body: zod는 제출할때 검증이 가능해서 입력자체를 막지는 않더라구요! 입력자체를 막으려고 직접 주었습니다.
created_at: 2025-04-21T09:57:30Z
author_association: COLLABORATOR
path: src/app/(client)/meal/post/edit/components/ai-loader-without-bg.tsx
user: login: woohyuckk
body: 제 부분에는 뒷배경이 없는 로티라서 따로 사용하였습니다! 
created_at: 2025-04-21T10:23:14Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,250 @@
+'use client';
+
+import { AiResponseDTO } from '@/types/DTO/ai_analysis.dto';
+import { MealDTO } from '@/types/DTO/meal.dto';
+import { MealCategory } from '@/types/meal-category.type';
+import { createMealWithDetails, deleteMealAnalysisDetail } from '@/apis/meal.api';
+import { uploadImage } from '@/apis/storage.api';
+import SITE_MAP from '@/constants/site-map.constant';
+import { formatTimestamp } from '@/utils/format.util';
+import { urlToFile } from '../../../utils/file.util';
+import { zodResolver } from '@hookform/resolvers/zod';
+import { z } from 'zod';
+import { FormProvider, useFieldArray, useForm } from 'react-hook-form';
+import { useRouter } from 'next/navigation';
+import { useState } from 'react';
+import EditCard from './edit-card';
+import MealImageCarousel from '../../../components/meal-images-carousel';
+import { Typography } from '@/components/ui/typography';
+import GlassBackground from '@/components/commons/glass-background';
+import TagSelectItem from '@/components/commons/tag-select-item';
+import MealEditCalendar from './meal-edit-calendar';
+import Textarea from '@/components/commons/textarea';
+import { Button } from '@/components/ui/button';
+import TimePicker, { TimeFields } from './time-picker';
+
+type EditResultSectionProps = {
+  imageList: string[];
+  mealList: AiResponseDTO[];
+};
+
+const EditResultSection = ({ imageList, mealList }: EditResultSectionProps): JSX.Element => {
+  const router = useRouter();
+  const [isLoading, setIsLoading] = useState(false);
+  const now = new Date();
+  const { meridiem, hours, minutes } = getTimeFieldsFromDate(now);
+
+  const mealFormMethods = useForm({
+    resolver: zodResolver(mealEditFormSchema),
+    defaultValues: {
+      mealImages: imageList,
+      mealList: mealList,
+      date: {
+        day: new Date(),
+        meridiem,
+        hours,
+        minutes
+      },
+      mealCategory: MealCategory.BREAKFAST,
+      memo: ''
+    },
+    mode: 'onBlur'
+  });
+
+  const { fields: mealCardList, remove } = useFieldArray({ control: mealFormMethods.control, name: 'mealList' });
+
+  const day = mealFormMethods.getValues('date.day');
+  const date = mealFormMethods.watch('date');
+
+  const handleDayChange = (day: Date) => mealFormMethods.setValue('date.day', day);
+
+  const handleTimeChange = (time: TimeFields) => {
+    mealFormMethods.setValue('date.meridiem', time.meridiem);
+    mealFormMethods.setValue('date.hours', time.hours);
+    mealFormMethods.setValue('date.minutes', time.minutes);
+  };
+
+  const onSubmit = async (form: MealEditFormData) => {
+    const files = await Promise.all(form.mealImages.map((url, idx) => urlToFile(url, idx)));
+    setIsLoading(true);
+    try {
+      if (!form) {
+        return alert(' 데이터 형식이 올바르지 않습니다.');
+      }
+
+      const { mealImages, date, memo, mealCategory } = form;
+      const ateAt = formatTimestamp(date);
+
+      for (const file of files) {
+        const formData = new FormData();
+        formData.append('file', file);
+        await uploadImage('meal', formData);
+      }
+
+      const newMeals = {
+        foodImages: mealImages,
+        ateAt,
+        mealCategory,
+        memo
+      };
+
+      const { mealDetails } = await createMealWithDetails(
+        newMeals as Pick<MealDTO, 'ateAt' | 'foodImages' | 'memo' | 'mealCategory'>,
path: src/app/(client)/meal/post/edit/components/edit-result-section.tsx
user: login: woohyuckk
body: 필요 없는 부분 맞습니다! 삭제하였습니다.
created_at: 2025-04-21T10:28:36Z
author_association: COLLABORATOR
diff_hunk: @@ -60,52 +58,66 @@ const EditCard = ({ mealDetail, idx }: EditCardProps) => {
   const handleDelete = async () => {
     const isConfirm = window.confirm('정말 삭제하시겠습니까?');
     if (isConfirm) {
-      mealListRemove(idx);
-      mealsRemove(idx);
+      onRemove(idx);
     }
   };
 
-  const onHandleMaxLengthInput = (e: FormEvent<HTMLInputElement>) => {
-    e.currentTarget.value = e.currentTarget.value.replace(/[^0-9]/g, '').slice(0, MAX_NUMERIC_LENGTH);
-  };
-
   return (
     <div className="flex w-full flex-col items-center justify-center gap-2 self-stretch rounded-2xl bg-white/50 p-2 backdrop-blur-[50px]">
       {isLoading ? (
-        <AiLoaderLottie />
+        <div className="flex h-[11.875rem] w-full flex-col items-center justify-center rounded-xl bg-white">
path: src/app/(client)/meal/post/edit/components/edit-card.tsx
user: login: woohyuckk
body: 기기별로 가운데에 오는것은 확인했는데요.. !! 상하가 시안에는 1.16인데 제 디자인에는 1.17이라 0.16px정도 차이가 나네요 ㅠ_ㅠ

![image](https://github.com/user-attachments/assets/1779642f-6ab1-40af-ac60-e641cc3ebb6c)

created_at: 2025-04-21T11:14:30Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,17 @@
+import Lottie from 'react-lottie-player';
+import AiLoaderStar from '@/../public/lottie/ai-loader-star.json';
+
+const AiLoaderWithoutBg = () => {
+  return (
+    <div className="relative flex aspect-square w-20 items-center justify-center">
+      <Lottie
+        loop
+        play
+        animationData={AiLoaderStar}
+        className="absolute left-1/2 top-1/2 w-full -translate-x-1/2 -translate-y-1/2"
+      />
+    </div>
+  );
+};
+
+export default AiLoaderWithoutBg;
path: src/app/(client)/meal/post/edit/components/ai-loader-without-bg.tsx
user: login: woohyuckk
body: 마찬가지로 제 부분에는 뒷배경이 없는 로티라서 따로 사용하였습니다!
created_at: 2025-04-21T11:25:12Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,251 @@
+'use client';
+
+import { AiResponseDTO } from '@/types/DTO/ai_analysis.dto';
+import { MealCategory } from '@/types/meal-category.type';
+import { createMealWithDetails, deleteMealAnalysisDetail } from '@/apis/meal.api';
+import { uploadImage } from '@/apis/storage.api';
+import SITE_MAP from '@/constants/site-map.constant';
+import { formatTimestamp } from '@/utils/format.util';
+import { urlToFile } from '../../../utils/file.util';
+import { zodResolver } from '@hookform/resolvers/zod';
+import { z } from 'zod';
+import { FormProvider, useFieldArray, useForm } from 'react-hook-form';
+import { useRouter } from 'next/navigation';
+import { useState } from 'react';
+import EditCard from './edit-card';
+import MealImageCarousel from '../../../components/meal-images-carousel';
+import { Typography } from '@/components/ui/typography';
+import GlassBackground from '@/components/commons/glass-background';
+import TagSelectItem from '@/components/commons/tag-select-item';
+import MealEditCalendar from './meal-edit-calendar';
+import Textarea from '@/components/commons/textarea';
+import { Button } from '@/components/ui/button';
+import TimePicker, { TimeFields } from './time-picker';
+
+type EditResultSectionProps = {
+  imageList: string[];
+  mealList: AiResponseDTO[];
+};
+
+const EditResultSection = ({ imageList, mealList }: EditResultSectionProps): JSX.Element => {
+  const router = useRouter();
+  const [isLoading, setIsLoading] = useState(false);
+  const { meridiem, hours, minutes } = getTimeFieldsFromDate();
+
+  const mealFormMethods = useForm({
+    resolver: zodResolver(mealEditFormSchema),
+    defaultValues: {
+      mealImages: imageList,
+      mealList: mealList,
+      date: {
+        day: new Date(),
+        meridiem,
+        hours,
+        minutes
+      },
+      mealCategory: MealCategory.BREAKFAST,
+      memo: ''
+    },
+    mode: 'onBlur'
+  });
+
+  const { fields: mealCardList, remove } = useFieldArray({ control: mealFormMethods.control, name: 'mealList' });
+
+  const day = mealFormMethods.getValues('date.day');
+  const date = mealFormMethods.watch('date');
+
+  const handleDayChange = (day: Date) => mealFormMethods.setValue('date.day', day);
+
+  const handleTimeChange = (time: TimeFields) => {
+    mealFormMethods.setValue('date.meridiem', time.meridiem);
+    mealFormMethods.setValue('date.hours', time.hours);
+    mealFormMethods.setValue('date.minutes', time.minutes);
+  };
+
+  const onSubmit = async (form: MealEditFormData) => {
+    const files = await Promise.all(form.mealImages.map((url, idx) => urlToFile(url, idx)));
+    setIsLoading(true);
+    try {
+      if (!form) {
+        return alert(' 데이터 형식이 올바르지 않습니다.');
+      }
+
+      const { date, memo, mealCategory } = form;
+      const ateAt = formatTimestamp(date);
+      const storedImageUrls: string[] = [];
+      for (const file of files) {
+        const formData = new FormData();
+        formData.append('file', file);
+        const { data: fileUrl } = await uploadImage('meal', formData);
+        if (fileUrl) {
+          storedImageUrls.push(fileUrl);
+        }
+      }
+
+      const newMeals = {
+        foodImages: storedImageUrls,
+        ateAt,
+        mealCategory,
+        memo
+      };
+      const { mealDetails } = await createMealWithDetails(
+        newMeals,
+        mealList.map((meal) => ({
+          menuName: meal.menuName,
+          weight: meal.weight,
+          calories: meal.calories,
+          carbohydrate: meal.carbohydrate,
+          protein: meal.protein,
+          fat: meal.fat
+        }))
+      );
+      if (mealDetails) {
+        await deleteMealAnalysisDetail();
+        router.push(SITE_MAP.HOME);
+      }
+    } catch (err) {
+      alert('식사 정보 등록에 실패했습니다. 잠시후 다시 시도해주세요');
+      console.error('식사 정보 등록에 실패했습니다.', err);
+      router.refresh();
+    } finally {
+      setIsLoading(false);
+    }
+  };
path: src/app/(client)/meal/post/edit/components/edit-result-section.tsx
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**이미지 업로드 로직 최적화 및 에러 처리 개선 제안**

현재 이미지 업로드 로직에 몇 가지 개선이 필요합니다:

1. 이미지 업로드가 순차적으로 처리되어 성능 저하가 발생할 수 있습니다.
2. 이미지 업로드 실패 시 적절한 에러 처리가 없습니다.
3. 오류 메시지가 일관되지 않습니다.

다음과 같이 개선할 수 있습니다:

```diff
  const onSubmit = async (form: MealEditFormData) => {
    const files = await Promise.all(form.mealImages.map((url, idx) => urlToFile(url, idx)));
    setIsLoading(true);
    try {
      if (!form) {
        return alert(' 데이터 형식이 올바르지 않습니다.');
      }

      const { date, memo, mealCategory } = form;
      const ateAt = formatTimestamp(date);
      const storedImageUrls: string[] = [];
-     for (const file of files) {
-       const formData = new FormData();
-       formData.append('file', file);
-       const { data: fileUrl } = await uploadImage('meal', formData);
-       if (fileUrl) {
-         storedImageUrls.push(fileUrl);
-       }
-     }
+     const uploadPromises = files.map(file => {
+       const formData = new FormData();
+       formData.append('file', file);
+       return uploadImage('meal', formData);
+     });
+     
+     const uploadResults = await Promise.all(uploadPromises);
+     const uploadErrors = uploadResults.filter(result => result.error !== null);
+     
+     if (uploadErrors.length > 0) {
+       throw new Error('일부 이미지 업로드에 실패했습니다.');
+     }
+     
+     const storedImageUrls = uploadResults
+       .map(result => result.data)
+       .filter((url): url is string => url !== null);

      const newMeals = {
        foodImages: storedImageUrls,
        ateAt,
        mealCategory,
        memo
      };
      const { mealDetails } = await createMealWithDetails(
        newMeals,
        mealList.map((meal) => ({
          menuName: meal.menuName,
          weight: meal.weight,
          calories: meal.calories,
          carbohydrate: meal.carbohydrate,
          protein: meal.protein,
          fat: meal.fat
        }))
      );
      if (mealDetails) {
        await deleteMealAnalysisDetail();
        router.push(SITE_MAP.HOME);
      }
    } catch (err) {
-     alert('식사 정보 등록에 실패했습니다. 잠시후 다시 시도해주세요');
-     console.error('식사 정보 등록에 실패했습니다.', err);
+     const errorMessage = '식사 정보 등록에 실패했습니다. 잠시후 다시 시도해주세요.';
+     alert(errorMessage);
+     console.error(errorMessage, err);
      router.refresh();
    } finally {
      setIsLoading(false);
    }
  };
```


> Committable suggestion skipped: line range outside the PR's diff.

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-04-21T11:26:02Z
author_association: NONE
diff_hunk: @@ -16,14 +16,14 @@ const UploadImageSection = ({ isRecorded }: UploadImageSectionProps): JSX.Elemen
 
   if (isLoading) {
     return (
-      <div className="flex min-h-[calc(100vh-60px)] items-center justify-center">
+      <div className="flex min-h-[calc(100vh-140px)] items-center justify-center">
path: src/app/(client)/meal/post/components/upload-image-section.tsx
user: login: llddang
body: footer는 정확하지 않지만 header의 height 단위는 rem이라고 알고 있습니다!
그렇다면 여기서도 px이 아니라 rem을 사용하는 것은 어떤가요?
created_at: 2025-04-22T02:45:33Z
author_association: OWNER
diff_hunk: @@ -60,52 +58,66 @@ const EditCard = ({ mealDetail, idx }: EditCardProps) => {
   const handleDelete = async () => {
     const isConfirm = window.confirm('정말 삭제하시겠습니까?');
     if (isConfirm) {
-      mealListRemove(idx);
-      mealsRemove(idx);
+      onRemove(idx);
     }
   };
 
-  const onHandleMaxLengthInput = (e: FormEvent<HTMLInputElement>) => {
-    e.currentTarget.value = e.currentTarget.value.replace(/[^0-9]/g, '').slice(0, MAX_NUMERIC_LENGTH);
-  };
-
   return (
     <div className="flex w-full flex-col items-center justify-center gap-2 self-stretch rounded-2xl bg-white/50 p-2 backdrop-blur-[50px]">
       {isLoading ? (
-        <AiLoaderLottie />
+        <div className="flex h-[11.875rem] w-full flex-col items-center justify-center rounded-xl bg-white">
path: src/app/(client)/meal/post/edit/components/edit-card.tsx
user: login: llddang
body: ![image](https://github.com/user-attachments/assets/1a64c7df-75b6-4083-bd86-4505294273af)

저기서 왔다갔다하는 것처럼 보이는 이유가 탄단지 이름과 그램수 사이의 간격이 달라서인 것 같습니다!
지금 확인하니까 홈에서도 식단 관리에서도 gap-0.5로 들어가야하는데 gap-1.5로 들어가 있는 것 같습니다.

공통 컴포넌트 자체에서 gap-0.5로 돌려도 shift 일어나는지 확인해주세요!
created_at: 2025-04-22T03:00:44Z
author_association: OWNER
diff_hunk: @@ -42,33 +42,34 @@ export const formatDateWithDash = (date: Date): string => {
 /**
  * 날짜와 시간 정보를 타임스탬프 문자열로 변환하는 함수입니다.
  *
- * @function formatTimestamp
- * @param {Date} baseDate - 기준 날짜 객체
- * @param {Object} time - 시간 정보 객체
- * @param {('오전'|'오후')} time.meridiem - 오전/오후 구분
- * @param {string} time.hours - 시간
- * @param {string} time.minutes - 분
- * @returns {string} 'YYYY-MM-DD HH:MM:00' 형식의 타임스탬프 문자열
+ * @param datetime - 날짜 및 시간 정보를 포함한 객체
+ * @param datetime.day - 기준 날짜 (Date 객체)
+ * @param datetime.meridiem - '오전' 또는 '오후'
+ * @param datetime.hours - 시(hour), 문자열 형태 ('01' ~ '12')
+ * @param datetime.minutes - 분(minute), 문자열 형태 ('00' ~ '59')
+ * @returns 포맷된 timestamp 문자열 ('YYYY-MM-DD HH:mm:ss')
+ *
+
  */
-export const formatTimestamp = (
-  baseDate: Date,
-  time: { meridiem: '오전' | '오후'; hours: string; minutes: string }
-): string => {
-  let hour = parseInt(time.hours, 10);
-  const minutes = time.minutes.padStart(2, '0');
+export const formatTimestamp = (datetime: {
+  day: Date;
+  meridiem: '오전' | '오후';
+  hours: string;
+  minutes: string;
+}): string => {
+  const { day, meridiem, hours, minutes } = datetime;
 
-  if (time.meridiem === '오전' && hour === 12) {
-    hour = 0;
-  } else if (time.meridiem === '오후' && hour !== 12) {
-    hour += 12;
-  }
+  let hour = parseInt(hours, 10);
+  if (meridiem === '오전' && hour === 12) hour = 0;
+  if (meridiem === '오후' && hour !== 12) hour += 12;
 
-  const yyyy = baseDate.getFullYear();
-  const mm = String(baseDate.getMonth() + 1).padStart(2, '0');
-  const dd = String(baseDate.getDate()).padStart(2, '0');
-  const hh = String(hour).padStart(2, '0');
+  const timestamp = new Date(day);
+  timestamp.setHours(hour);
+  timestamp.setMinutes(parseInt(minutes, 10));
+  timestamp.setSeconds(0);
+  timestamp.setMilliseconds(0);
 
-  return `${yyyy}-${mm}-${dd} ${hh}:${minutes}:00`;
+  return timestamp.toISOString(); // '2025-04-21T08:53:56.103Z'
path: src/utils/format.util.ts
user: login: llddang
body: 주석 삭제 부탁드립니다!
created_at: 2025-04-22T03:02:33Z
author_association: OWNER
diff_hunk: @@ -60,52 +58,66 @@ const EditCard = ({ mealDetail, idx }: EditCardProps) => {
   const handleDelete = async () => {
     const isConfirm = window.confirm('정말 삭제하시겠습니까?');
     if (isConfirm) {
-      mealListRemove(idx);
-      mealsRemove(idx);
+      onRemove(idx);
     }
   };
 
-  const onHandleMaxLengthInput = (e: FormEvent<HTMLInputElement>) => {
-    e.currentTarget.value = e.currentTarget.value.replace(/[^0-9]/g, '').slice(0, MAX_NUMERIC_LENGTH);
-  };
-
   return (
     <div className="flex w-full flex-col items-center justify-center gap-2 self-stretch rounded-2xl bg-white/50 p-2 backdrop-blur-[50px]">
       {isLoading ? (
-        <AiLoaderLottie />
+        <div className="flex h-[11.875rem] w-full flex-col items-center justify-center rounded-xl bg-white">
path: src/app/(client)/meal/post/edit/components/edit-card.tsx
user: login: woohyuckk
body: `gap`을 수정했으나, 로티가 늦게 로드되면서 발생하는 레이아웃 쉬프팅은 어쩔수 없네요 ㅠ 그럼 혹시 로딩되기전에  카드크기를 로딩 후에 사용되는 고정픽셀을 적용하는 방법이 있을 것 같은데 선택지가 별로 인것 같습니다.. 
created_at: 2025-04-22T03:33:25Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,98 @@
+'use client';
+import IconButton from '@/components/commons/icon-button';
+import {
+  Drawer,
+  DrawerClose,
+  DrawerContent,
+  DrawerDescription,
+  DrawerFooter,
+  DrawerTitle,
+  DrawerTrigger
+} from '@/components/ui/drawer';
+import { Typography } from '@/components/ui/typography';
+import { useState } from 'react';
+import Picker from 'react-mobile-picker';
+import { dateSchema } from './edit-result-section';
+import { z } from 'zod';
+import { Button } from '@/components/ui/button';
+
+type TimePickerProps = {
+  currentTime: TimeFields;
+  onTimeChange: (currentTime: TimeFields) => void;
+};
+
+const TimePicker = ({ currentTime, onTimeChange }: TimePickerProps) => {
+  const [isOpen, setIsOpen] = useState<boolean>(false);
+  const [time, setTime] = useState<TimeFields>({
+    meridiem: currentTime.meridiem,
+    hours: currentTime.hours,
+    minutes: currentTime.minutes
+  });
+
+  const handleSelectedTime = () => {
+    onTimeChange(time);
+    setIsOpen(false);
+  };
+
+  return (
+    <Drawer open={isOpen} onOpenChange={setIsOpen} dismissible={true} handleOnly={true}>
path: src/app/(client)/meal/post/edit/components/time-picker.tsx
user: login: woohyuckk
body: Drawer의 `dismissible` 옵션과 `handleOnly` 옵션을 통해 Drawer의 드래그 설정을 끌 수 있습니다! TimePicker에도 드래그옵션이 있어서 이중 드래그 옵션이 적용된 부분을 해결했습니다! 
created_at: 2025-04-22T06:25:50Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,98 @@
+'use client';
+import IconButton from '@/components/commons/icon-button';
+import {
+  Drawer,
+  DrawerClose,
+  DrawerContent,
+  DrawerDescription,
+  DrawerFooter,
+  DrawerTitle,
+  DrawerTrigger
+} from '@/components/ui/drawer';
+import { Typography } from '@/components/ui/typography';
+import { useState } from 'react';
+import Picker from 'react-mobile-picker';
+import { dateSchema } from './edit-result-section';
+import { z } from 'zod';
+import { Button } from '@/components/ui/button';
+
+type TimePickerProps = {
+  currentTime: TimeFields;
+  onTimeChange: (currentTime: TimeFields) => void;
+};
+
+const TimePicker = ({ currentTime, onTimeChange }: TimePickerProps) => {
+  const [isOpen, setIsOpen] = useState<boolean>(false);
+  const [time, setTime] = useState<TimeFields>({
+    meridiem: currentTime.meridiem,
+    hours: currentTime.hours,
+    minutes: currentTime.minutes
+  });
+
+  const handleSelectedTime = () => {
+    onTimeChange(time);
+    setIsOpen(false);
+  };
+
+  return (
+    <Drawer open={isOpen} onOpenChange={setIsOpen} dismissible={true} handleOnly={true}>
path: src/app/(client)/meal/post/edit/components/time-picker.tsx
user: login: jiyxxn
body: 둘 다 true로 들어갔는데도 꺼지나요?!
created_at: 2025-04-22T08:17:06Z
author_association: COLLABORATOR
diff_hunk: @@ -0,0 +1,98 @@
+'use client';
+import IconButton from '@/components/commons/icon-button';
+import {
+  Drawer,
+  DrawerClose,
+  DrawerContent,
+  DrawerDescription,
+  DrawerFooter,
+  DrawerTitle,
+  DrawerTrigger
+} from '@/components/ui/drawer';
+import { Typography } from '@/components/ui/typography';
+import { useState } from 'react';
+import Picker from 'react-mobile-picker';
+import { dateSchema } from './edit-result-section';
+import { z } from 'zod';
+import { Button } from '@/components/ui/button';
+
+type TimePickerProps = {
+  currentTime: TimeFields;
+  onTimeChange: (currentTime: TimeFields) => void;
+};
+
+const TimePicker = ({ currentTime, onTimeChange }: TimePickerProps) => {
+  const [isOpen, setIsOpen] = useState<boolean>(false);
+  const [time, setTime] = useState<TimeFields>({
+    meridiem: currentTime.meridiem,
+    hours: currentTime.hours,
+    minutes: currentTime.minutes
+  });
+
+  const handleSelectedTime = () => {
+    onTimeChange(time);
+    setIsOpen(false);
+  };
+
+  return (
+    <Drawer open={isOpen} onOpenChange={setIsOpen} dismissible={true} handleOnly={true}>
path: src/app/(client)/meal/post/edit/components/time-picker.tsx
user: login: woohyuckk
body: `dismissble`이 끌꺼야?  응! (`true`)라서 꺼지더라구요! 
created_at: 2025-04-22T08:34:52Z
author_association: COLLABORATOR
diff_hunk: @@ -40,7 +40,7 @@ const FOOD_IMAGE_ANALYSIS_PROMPT = `
   2. 1인분 기준의 대략적인 예상 중량(g, "weight")
   3. 2번의 예상 중량 기준의 대략적인 예상 칼로리(kcal, "calories")
   4. 주요 영양성분 : 탄수화물(g, "carbohydrate"), 단백질(g, "protein"), 지방(g, "fat")
-  
+  5. 영양 성분은 소수점을 제외하고 정수로 응답해주세요.
path: src/apis/gemini.api.ts
user: login: arendt9797
body: 지금까지 소수점이 나온 적이 없었던 것 같은데, 요상하네요
created_at: 2025-04-22T11:09:47Z
author_association: COLLABORATOR

PR comments:
user: login: vercel[bot]
created_at: 2025-04-21T08:16:30Z
body: [vc]: #FNm/twiC526qj/nTdUnX78yF5DLbRJzq8aVtx+XjYrQ=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJqaXdvb2RhLWRldiIsInJvb3REaXJlY3RvcnkiOm51bGwsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiIifSwiaW5zcGVjdG9yVXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL2xsZGRhbmdzLXByb2plY3RzL2ppd29vZGEtZGV2LzhYRVVpekZMZVBMaE0zVjNuYXFYdllmRXphbWIiLCJuZXh0Q29tbWl0U3RhdHVzIjoiSUdOT1JFRCIsInByZXZpZXdVcmwiOiJqaXdvb2RhLWRldi1naXQtcmVmYWN0b3ItMTgzLXFhLWxsZGRhbmdzLXByb2plY3RzLnZlcmNlbC5hcHAifV19
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)


<details><summary>1 Skipped Deployment</summary>

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **jiwooda-dev** | ⬜️ Ignored ([Inspect](https://vercel.com/llddangs-projects/jiwooda-dev/8XEUizFLePLhM3V3naqXvYfEzamb)) | [Visit Preview](https://jiwooda-dev-git-refactor-183-qa-llddangs-projects.vercel.app) |  | Apr 23, 2025 1:02am |
</details>


author_association: NONE
user: login: coderabbitai[bot]
created_at: 2025-04-21T08:16:32Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

"""
## Walkthrough

이번 변경에서는 식단 기록 및 편집 페이지의 UI/UX 개선과 코드 리팩토링이 이루어졌습니다. 주요 변경 사항으로는 이미지 업로드 섹션, 식단 이미지 캐러셀, 식단 편집 카드, 시간 선택기, 결과 섹션 등 다양한 컴포넌트의 신설 및 개선, 그리고 서버 사이드 렌더링 기반 페이지로의 전환이 포함됩니다. 또한, 입력값 포맷팅, 로딩 UI 개선, 유틸리티 함수 및 CSS 유틸리티 클래스 추가, AI 프롬프트 명확화 등도 반영되었습니다.

## Changes

| 파일/경로 요약                                                                                      | 변경 요약                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
|-----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| src/apis/gemini.api.ts                                                                              | AI 프롬프트(FOOD_IMAGE_ANALYSIS_PROMPT)에 영양소 값을 소수점 없이 정수로 표기하라는 항목을 추가.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| src/app/(client)/meal/components/meal-images-carousel.tsx                                           | 캐러셀 페이지네이션 활성화 조건에 window 객체 존재 여부를 추가하여 SSR 환경에서 비활성화되도록 수정.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| src/app/(client)/meal/post/components/upload-image-section.tsx<br>src/app/(client)/meal/post/page.tsx | 이미지 업로드 섹션 컴포넌트 경로 및 import명 수정, 잘못된 hook 파일명 교정, 로딩 컨테이너 최소 높이 및 전체 폭(w-full) 적용, 관련 JSX 수정.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| src/app/(client)/meal/post/edit/components/ai-loader-without-bg.tsx                                 | Lottie 애니메이션을 활용한 새로운 로딩 컴포넌트(AiLoaderWithoutBg) 추가 및 export.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| src/app/(client)/meal/post/edit/components/edit-card.tsx                                            | useFieldArray 제거, onRemove 콜백 prop 도입, meals → mealList로 필드명 변경, 무게/칼로리 입력에 숫자 포맷팅(콤마) 적용, Controller 사용, 분석 버튼 활성화 조건 개선, AI 분석 결과 병합 로직 추가, macronutrient 표시 방식 개선, 불필요 코드 제거, MAX_MENU_NAME_LENGTH/parseNumber export.                                                                                                                                                                                                                                                                       |
| src/app/(client)/meal/post/edit/components/edit-result-section.tsx                                  | 식단 편집 및 제출을 위한 EditResultSection 컴포넌트 신설, react-hook-form+zod 기반 폼 상태 관리, 이미지 업로드/변환/제출 로직 구현, 카테고리/시간/메모 입력 UI 및 유틸리티 함수/타입/스키마 export.                                                                                                                                                                                                                                                                                                                                                                  |
| src/app/(client)/meal/post/edit/components/time-picker.tsx                                          | 드로어 기반 시간 선택기(TimePicker) 컴포넌트 신설, meridiem/시/분 선택, props/타입 export, 내부 상태 관리, react-mobile-picker 활용.                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| src/app/(client)/meal/post/edit/page.tsx                                                           | 클라이언트 컴포넌트에서 서버 사이드 async 컴포넌트로 전환, 폼 및 상태/로직 제거, 데이터 fetch 후 EditResultSection만 렌더, 메타데이터 함수 분리 및 export, 관련 타입/스키마/폼 로직 삭제.                                                                                                                                                                                                                                                                                                                                                                           |
| src/app/(client)/meal/post/page.tsx                                                                | 이미지 업로드 섹션 컴포넌트 import 경로 및 이름 변경에 따른 JSX 수정.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| src/app/globals.css                                                                                | cross-browser 스크롤바 숨김용 유틸리티 클래스(.scrollbar-hidden) 추가.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| src/utils/format.util.ts                                                                           | formatTimestamp 함수 시그니처 변경(여러 파라미터 → 객체 하나), 내부 변수명 및 JSDoc 주석 수정, 날짜/시간 처리 방식 개선.                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| src/app/(client)/meal/post/layout.tsx                                                             | 최상위 div 클래스명 "temp-layout"에서 "layout-container"로 변경.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| src/app/(client)/meal/post/components/restore-analysis-modal.tsx                                   | RestoreAnalysisModal 컴포넌트 props 다중 라인 구조로 변경, AlertDialogFooter에 flex-col 및 gap-2 클래스 추가하여 레이아웃 스타일 조정.                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| src/components/commons/macronutrient-box.tsx                                                      | macronutrient 라벨과 값 사이의 vertical gap을 gap-1.5에서 gap-0.5로 줄여 간격 축소.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant EditResultSection
    participant EditCard
    participant TimePicker
    participant Backend

    User->>EditResultSection: 페이지 진입/렌더링
    EditResultSection->>EditCard: 식단 카드 렌더 및 수정
    User->>EditCard: 메뉴명/무게/칼로리 입력, 분석 버튼 클릭
    EditCard->>Backend: AI 분석 요청
    Backend-->>EditCard: 분석 결과 응답
    EditCard->>EditResultSection: 분석 결과/입력값 반영
    User->>TimePicker: 시간 선택 요청
    TimePicker-->>EditResultSection: 선택 시간 전달
    User->>EditResultSection: 제출 버튼 클릭
    EditResultSection->>Backend: 이미지 업로드 및 식단 데이터 제출
    Backend-->>EditResultSection: 성공/실패 응답
    EditResultSection-->>User: 완료/에러 안내 및 페이지 이동
```

## Assessment against linked issues

| Objective                                                                                  | Addressed | Explanation                                                                                  |
|--------------------------------------------------------------------------------------------|-----------|----------------------------------------------------------------------------------------------|
| 이미지 추가 버튼 크기 화면에 꽉차도록 수정, 로딩 이미지와 텍스트 가운데 정렬 (#183)        | ✅        |                                                                                              |
| 이미지 캐러셀 페이지네이션 추가, SSR 환경 대응 (#183)                                      | ✅        |                                                                                              |
| 식사 시간 카테고리 간격 수정, 시간이 현재 시간으로 자동 적용 (#183)                        | ✅        |                                                                                              |
| 무게/칼로리 입력시 3자리 이상에 , 표시 추가 (#183)                                         | ✅        |                                                                                              |

## Possibly related PRs

- llddang/todayeat#171: EditCard 컴포넌트 리팩토링 및 입력 핸들링 개선과 직접적으로 연관됨.
- llddang/todayeat#154: meal post edit 페이지의 클라이언트/서버 구현 변경과 관련됨.
- llddang/todayeat#77: EditCard 컴포넌트에 AI 분석 API 호출 및 입력 제어 기능 추가와 관련됨.

## Suggested labels

`✨ Feature`, `💌 리뷰 필요`

## Suggested reviewers

- jiyxxn
- arendt9797

## Poem

> 🥕  
> 새로워진 식단 기록의 길,  
> 콤마와 숫자, 시간의 빛,  
> 로딩 별 춤추고,  
> 캐러셀은 부드럽게 돌고,  
> 토끼는 기뻐 깡총깡총!  
> 🐰✨  
>  
> — 오늘도 맛있게, 코드와 함께
"""

<!-- walkthrough_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNxU3bABsvkCiQBHbGlcSHFcLzpIACIbEgAzNDF8CgB6MwBGAA4AZkhAXaHAC6bABjrAXQ7ADOXAF3HAAcnIQBRWwATxwA9xgLRIQBV5wB2WwBrOwEplwALFwEHO6Mg5SGxESkgAd3x8WFlsBgBrZfRaWn9ESeQkBxJITNyNGFgD5m0sePwGCZRkfCwlRHgiLABFAEF0DHomJT8CSSBAo8AwREg1z4uDOkDYaF8/iYFHo3DQpA0RgA0iR5AxYJhSLsMAwvNglBwDFBPrQhBNxOCwrD4BdSOt6AI8AQsC8AF4HAiQ+A+JkHRAMfxkGbwWgwzFQADC7EoYARrwwYIhMIOXnwaFompQrIOmHoNAAHpoqZAaQbGWiiGDqPBHmF8KKjeiDgxnPgJiQvPLIABZRTweKyQ2INEMQ0CEi4aYkKXw3ziNiMagkIgpeDSIMAMXg5sN2pwBAu4gY6G43C88B94ld+HiHtuFH8GFC6ZIQdthqYTnsJDRVBByChKAwnlwD1bSdesFCpszutB0kgJHNDGTdq1sElkANjtnQYAkl2KIoloa2uRppCSNRsP5ISkwlvcGABGhJvQ2Bg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mI2EBssoyQAZlowdqCcsKgqBBaK4D6R+EtCbhveYCcceoqmQtkzxY1dgFjkZXaiSmcSugMTjpSLLg5H/QOFPHIXGSKF3YqWfqvoUZANAe8TkearADqQrVU8VvoZnpxmx5ShGOzrpkDiDkW8HS08BAk+J0gQVXSGyCRmC77K4wQqqULQtmCSqksWmUGi9mXCYCo0S9DANdCKTJD3lmSh6f4DBWqTUx6k5wZmJqGzddJ8Kj8u1nIC2LPYusUVEUpFgmw/FFsNcl2C4Bdt2VDsVWA9hUAuwtY7sQwLWstjqA64MoRAHXB2R746AdcAkvml5gGBa1dAeIAwFUiYDVIDABTFkHUibr1IgnQTvED3gKYkge8LIEpgYBZAkgtAA9QIByCKZWwOsfmJCFUi0A6MWEhTEJloCqQcgQmeIOpFUgCAP1JAPeKpCEwCApOqkNdfECYxoAsgWQDIHvByC0Adwmke9RAEYA7g0A8QKTgphvWqQSAWQeIO+pyDqQf1QmJjKpD3hwaiN6kH8D+viC0ABA8QDIExurAobmMe8AQHvCYwZAb1CmVSFJzoy0Asggmrjd+qExCYpOGQEgBJvA1MZMNJAMjepCk45A71HsedQ+r3hoBRAYGw9RJq40MBaAN6oTNBqYy5AD1tAOjQIAyBCYcgym89UxgYBCZ1ILG1TYOsY1ZBP1/6hIBkH3XzwDNWQSzTkAc0KZd1OQPeCQAUwCBHN7GqDbQCEz9q1NqGpzVZvc02af1KgNzUpjfUHq0AUnCzRkCSBCYHN8QBTJhoYA5AEg8WhLVACHW4AR1thcdS8MnW0A64l9fQEAA== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details>
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=llddang/todayeat&utm_content=192):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: NONE