Skip to content

Conversation

@evaain706
Copy link
Contributor

@evaain706 evaain706 commented Aug 4, 2025

📌 변경 사항 개요

fix: 일정수정로직수정/후기 일자 표기 수정

📝 상세 내용

  • 일정 수정로직 수정
  • 후기 일자표기 수정

🔗 관련 이슈

🖼️ 스크린샷(선택사항)

💡 참고 사항

Summary by CodeRabbit

  • 버그 수정

    • 리뷰 작성일 표시 형식이 "YYYY.MM.DD"로 변경되어 날짜가 더 간결하게 보입니다.
  • 기능 개선

    • 활동 일정 수정 시, 기존 일정의 세부 정보(날짜, 시작/종료 시간)가 변경된 경우에도 올바르게 반영되도록 처리 방식이 개선되었습니다.
    • 활동 제목 입력란에 최대 20자 입력 제한이 추가되었습니다.
    • 버튼 내 로딩 표시 텍스트가 간결한 기호로 변경되어 사용자 경험이 향상되었습니다.
    • 예약 버튼의 로딩 텍스트가 "요청전송중..."으로 변경되어 진행 상황이 명확하게 표시됩니다.

@evaain706 evaain706 self-assigned this Aug 4, 2025
@evaain706 evaain706 added the 🔨 Refactor 코드 리팩토링 label Aug 4, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 4, 2025

Walkthrough

리뷰 날짜 포맷팅 방식이 문자열 슬라이싱과 치환으로 단순화되었고, 활동 편집 시 일정 변경 로직이 개선되어, 기존 일정의 필드가 변경된 경우 해당 일정을 제거 후 새 일정으로 추가하는 방식으로 처리됩니다.

Changes

Cohort / File(s) Change Summary
리뷰 날짜 포맷팅 단순화 및 스타일 조건부 적용
src/app/(with-header)/activities/[id]/components/ReviewSection.tsx
리뷰 생성일 포맷팅을 toLocaleDateString에서 문자열 슬라이싱(slice(0, 10).replace(/-/g, '.')) 방식으로 변경. 로그인 여부에 따른 블러 효과 및 마진 조건부 적용을 cn 유틸리티로 변경하고 관련 import 추가. 컨테이너 최소 높이 축소
활동 일정 수정 로직 개선
src/app/(with-header)/myactivity/[id]/hooks/useEditActivityForm.ts
일정 편집 시, 기존과 현재 일정 모두에 존재하지만 필드가 변경된 일정은 기존 일정 ID를 제거 목록에 추가하고, 변경된 일정은 새 일정 목록에 추가하는 로직 도입. 제거할 ID 필터링 방식 개선
입력 제한 추가
src/app/(with-header)/myactivity/components/InfoSection.tsx
제목 입력란에 최대 입력 길이 20자 제한 추가 (maxLength=20)
버튼 로딩 텍스트 변경
src/components/Button.tsx, src/components/FloatingBox/BookingButton.tsx
Button 컴포넌트 로딩 텍스트를 "로딩중..."에서 "..."으로 변경, BookingButton 컴포넌트 로딩 텍스트를 "..."에서 "요청전송중..."으로 변경

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EditFormHook
    participant Server

    User->>EditFormHook: 제출(수정된 일정 포함)
    EditFormHook->>EditFormHook: 기존 일정과 비교<br>필드 변경된 일정 식별
    EditFormHook->>Server: 변경된 일정 제거 요청
    EditFormHook->>Server: 새 일정 추가 요청
    Server-->>EditFormHook: 응답
    EditFormHook-->>User: 결과 반환
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • LeeCh0129
  • minimo-9

Poem

🐇
날짜는 점으로 깔끔하게,
일정 수정도 똑똑하게!
오래된 스케줄은 안녕,
새 일정 환영하는 봄날의 정.
버튼은 말없이 변신해,
로딩 텍스트도 살짝 바뀌고!
토끼는 코드에 춤을 추네,
변화의 발자국을 남기며!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/140

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for 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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@evaain706 evaain706 changed the title [#140] fix: 일정수정로직수정/후기 일자 표기 수정 fix/140 3차 QA수정사항수정 Aug 4, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 01659dd and 3963387.

📒 Files selected for processing (2)
  • src/app/(with-header)/activities/[id]/components/ReviewSection.tsx (1 hunks)
  • src/app/(with-header)/myactivity/[id]/hooks/useEditActivityForm.ts (1 hunks)
🔇 Additional comments (2)
src/app/(with-header)/myactivity/[id]/hooks/useEditActivityForm.ts (1)

150-166: 일정 수정 감지 로직이 잘 구현되었습니다

기존 일정과 현재 일정을 비교하여 변경된 필드(날짜, 시작시간, 종료시간)를 정확히 감지하고, 변경된 일정을 새로 추가하면서 기존 일정을 삭제 목록에 추가하는 로직이 올바르게 구현되었습니다. 이는 일정 수정 시 데이터 일관성을 보장합니다.

src/app/(with-header)/activities/[id]/components/ReviewSection.tsx (1)

61-61: createdAt 필드 포맷 일관성 확인 필요

날짜 포맷팅을 위해 string 슬라이싱(slice(0, 10).replace(/-/g, '.'))을 사용하는 것은 성능 상 이점이 있지만, createdAt이 항상 ‘YYYY-MM-DD’ 형태의 ISO 8601 문자열이라는 보장이 없습니다. 타입 정의(src/types/...)에서는 단순히 string으로 선언되어 있어 포맷 안정성이 보장되지 않으므로, API 응답 형식을 재확인하거나 런타임 검증 로직을 추가하는 것을 권장합니다.

  • src/app/(with-header)/activities/[id]/components/ReviewSection.tsx:61
    • review.createdAt.slice(0, 10).replace(/-/g, '.') 사용 부분
  • src/types/**/* 에서 createdAt: string으로만 선언되어 포맷 검증이 없음

Comment on lines +147 to +148
.map((d) => d.id!)
.filter(Boolean);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

타입 안전성 개선 제안

d.id!의 non-null assertion 사용은 런타임 에러 위험이 있습니다. 더 안전한 타입 가드를 사용하는 것을 권장합니다.

다음과 같이 수정하세요:

-        .map((d) => d.id!)
-        .filter(Boolean);
+        .map((d) => d.id)
+        .filter((id): id is number => id !== undefined);
📝 Committable suggestion

‼️ 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.

Suggested change
.map((d) => d.id!)
.filter(Boolean);
.map((d) => d.id)
.filter((id): id is number => id !== undefined);
🤖 Prompt for AI Agents
In src/app/(with-header)/myactivity/[id]/hooks/useEditActivityForm.ts at lines
147-148, the use of non-null assertion `d.id!` can cause runtime errors if `id`
is null or undefined. Replace the non-null assertion with a type-safe guard by
filtering out items where `d.id` is falsy before mapping, or use a conditional
check within the map to ensure only defined `id`s are processed. This will
improve type safety and prevent potential runtime exceptions.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3963387 and d27b3a2.

📒 Files selected for processing (4)
  • src/app/(with-header)/activities/[id]/components/ReviewSection.tsx (5 hunks)
  • src/app/(with-header)/myactivity/components/InfoSection.tsx (1 hunks)
  • src/components/Button.tsx (1 hunks)
  • src/components/FloatingBox/BookingButton.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/components/Button.tsx (5)
src/app/(non-header)/oauth/kakao/components/KakaoLoading.tsx (2)
  • KakaoLoading (7-16)
  • KakaoLoadingProps (3-5)
src/components/Loading.tsx (1)
  • Loading (3-29)
src/app/(with-header)/mypage/page.tsx (1)
  • i (67-72)
src/app/(with-header)/mypage/reservations/page.tsx (1)
  • i (167-172)
src/app/(with-header)/activities/[id]/components/Skeletons/ActivityDetailSkeleton.tsx (1)
  • _ (76-85)
src/app/(with-header)/activities/[id]/components/ReviewSection.tsx (3)
src/lib/utils.ts (1)
  • cn (4-6)
src/app/(with-header)/activities/[id]/components/ReviewCard.tsx (1)
  • ReviewCard (4-30)
src/types/activityDetailType.ts (1)
  • ReviewCardProps (6-12)

Comment on lines +62 to 63
date={review.createdAt.slice(0, 10).replace(/-/g, '.')}
reviewText={review.content}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

날짜 포맷팅 방식 견고성 부족

slice(0, 10).replace(/-/g, '.') 는 ISO-8601 형식이 아닐 경우 깨질 수 있습니다.
dayjs, date-fns 등의 라이브러리 사용을 권장합니다.

- date={review.createdAt.slice(0, 10).replace(/-/g, '.')}
+ import dayjs from 'dayjs';
+ ...
+ date={dayjs(review.createdAt).format('YYYY.MM.DD')}
🤖 Prompt for AI Agents
In src/app/(with-header)/activities/[id]/components/ReviewSection.tsx around
lines 62 to 63, the current date formatting uses slice and replace on
review.createdAt, which is fragile if the date is not in ISO-8601 format.
Replace this manual string manipulation with a robust date formatting method by
importing and using a library like dayjs or date-fns to parse and format the
date safely.

Comment on lines +107 to +110
<div className='pointer-events-none relative min-h-300 select-none'>
<div className={cn(user ? '' : 'blur-sm', 'mt-10')}>
{ReviewComponent()}
</div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

pointer-events-none 무조건 적용으로 상호작용 차단

pointer-events-none 가 로그인 여부와 무관하게 적용되어 리뷰 영역 내 링크·텍스트 선택이 모두 비활성화됩니다.
로그인한 사용자는 정상적으로 상호작용할 수 있도록 조건부로 적용해 주세요.

- <div className='pointer-events-none relative min-h-300 select-none'>
+ <div
+   className={cn(!user && 'pointer-events-none select-none', 'relative min-h-300')}
+ >
📝 Committable suggestion

‼️ 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.

Suggested change
<div className='pointer-events-none relative min-h-300 select-none'>
<div className={cn(user ? '' : 'blur-sm', 'mt-10')}>
{ReviewComponent()}
</div>
<div
className={cn(!user && 'pointer-events-none select-none', 'relative min-h-300')}
>
<div className={cn(user ? '' : 'blur-sm', 'mt-10')}>
{ReviewComponent()}
</div>
🤖 Prompt for AI Agents
In src/app/(with-header)/activities/[id]/components/ReviewSection.tsx around
lines 107 to 110, the class 'pointer-events-none' is applied unconditionally,
blocking all interactions in the review area regardless of login status. Modify
the code to apply 'pointer-events-none' only when the user is not logged in,
allowing logged-in users to interact normally with links and text selection.

Comment on lines +42 to 43
maxLength={20}
onChange={(e) => onTitleChange(e.target.value)}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

❓ Verification inconclusive

글자 수 제한 UX 보완 제안

maxLength={20} 설정으로 입력이 조용히 차단됩니다.
남은 글자 수 표시(예: “12/20”) 또는 경고 메시지를 추가하면 사용자 경험이 향상됩니다. 또한 백엔드에서도 동일한 제한이 적용되는지 확인해 주세요.


글자 수 제한 UX 보완 필요

InfoSection.tsx (src/app/(with-header)/myactivity/components/InfoSection.tsx) 42–43행에서

  maxLength={20}
  onChange={(e) => onTitleChange(e.target.value)}

현재 입력이 20자를 넘으면 조용히 막히기만 하므로, 아래를 검토해 주세요:

  • 남은 글자 수 표시 추가 (예: “12/20”)
  • 초과 입력 시 경고 또는 비활성화 상태 안내
  • 백엔드에서도 동일한 20자 제한이 정상적으로 적용되는지 확인
🤖 Prompt for AI Agents
In src/app/(with-header)/myactivity/components/InfoSection.tsx around lines
42-43, the input field limits text to 20 characters silently without user
feedback. Enhance the UX by adding a visible character count display (e.g.,
"12/20") near the input, provide a warning or disable further input when the
limit is exceeded, and verify that the backend enforces the same 20-character
limit to maintain consistency.

Comment on lines +48 to 49
{isLoading ? <span className='animate-pulse'>...</span> : children}
</button>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

로딩 텍스트 접근성 개선 필요

'...' 만으로는 스크린리더가 의미 있는 읽기를 하지 못합니다.
aria-label 또는 visually-hidden span 으로 “로딩 중” 과 같은 문구를 추가하여 접근성을 보완해 주세요.

- {isLoading ? <span className='animate-pulse'>...</span> : children}
+ {isLoading ? (
+   <span
+     className='animate-pulse'
+     aria-label='로딩 중'
+     role='status'
+   >
+     ...
+     <span className='sr-only'>로딩 중</span>
+   </span>
+ ) : (
+   children
+ )}
📝 Committable suggestion

‼️ 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.

Suggested change
{isLoading ? <span className='animate-pulse'>...</span> : children}
</button>
{isLoading ? (
<span
className='animate-pulse'
aria-label='로딩 중'
role='status'
>
...
<span className='sr-only'>로딩 중</span>
</span>
) : (
children
)}
</button>
🤖 Prompt for AI Agents
In src/components/Button.tsx around lines 48 to 49, the loading indicator
currently uses only '...' which is not accessible for screen readers. To improve
accessibility, add an aria-label with a descriptive text like "Loading" to the
span or include a visually hidden span containing the text "로딩 중" alongside the
dots. This will ensure screen readers convey meaningful information during
loading states.

Comment on lines 31 to 35
{onBooking ? (
<div className='flex items-center justify-center gap-2'>
<span className='h-10 w-10 animate-spin rounded-full border-2 border-white border-t-transparent' />
<p>...</p>
<p>요청전송중...</p>
</div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

로딩 문구 일관성 유지 검토

요청전송중...Button 컴포넌트의 '...' 가 불일치합니다.
사용자에게 동일한 로딩 경험을 제공하기 위해 메시지·스타일을 공통 util 로 추출하거나 최소한 문구를 통일하는 방안을 고려해 주세요.

🤖 Prompt for AI Agents
In src/components/FloatingBox/BookingButton.tsx around lines 31 to 35, the
loading text "요청전송중..." inside the div is inconsistent with the ellipsis style
used in the Button component. To fix this, unify the loading message and style
by either extracting the loading text and animation into a shared utility or
constant used by both places, or at minimum, make sure the ellipsis and wording
match exactly to provide a consistent user experience.

Copy link
Contributor

@LeeCh0129 LeeCh0129 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다.

Copy link
Contributor

@minimo-9 minimo-9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

마지막까지 수정하시느라 고생 많으셨습니다!

@evaain706 evaain706 merged commit 4eac5f9 into develop Aug 4, 2025
2 checks passed
@evaain706 evaain706 deleted the fix/140 branch August 4, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants