Skip to content

Conversation

@Yongmin0423
Copy link
Contributor

@Yongmin0423 Yongmin0423 commented Aug 4, 2025

👻 관련 이슈 번호

👻 요약

  • 예약 거절 시 캐시가 무효화 되도록 설정하였습니다.

👻 주요 변경 사항

  • 캐시 무효화
  • 스토리북 배포 테스트

👻 체크리스트

  • Assignees에 본인을 등록했나요?
  • 라벨을 사이드 탭에서 등록했나요?
  • PR은 사이드 탭 Projects를 등록 하지마세요.
  • PR은 Milestone을 등록 하지마세요.
  • PR을 보내는 브랜치가 올바른지 확인했나요?
  • 팀원들이 리뷰하기 쉽도록 설명을 자세하게 작성했나요?
  • 변경사항을 충분히 테스트 했나요?
  • 컨벤션에 맞게 구현했나요?

📷 UI 변경 사항

👻 문제 사항

👻 논의 사항

👻 기타 참고 사항

Summary by CodeRabbit

  • Chores

    • 빌드 스크립트가 업데이트되어, Next.js 빌드 후 Storybook 정적 파일이 public/storybook 디렉토리에 생성됩니다.
    • Storybook 설정에서 정적 파일 서빙이 비활성화되었습니다.
    • /storybook 경로를 통해 Storybook UI에 접근할 수 있도록 설정이 추가되었습니다.
    • Storybook 프로덕션 빌드 시 경로(base)가 /storybook/로 설정됩니다.
    • Storybook 접속 시 자동으로 /storybook/index.html로 리다이렉트되는 기능이 추가되었습니다.
  • 버그 수정

    • 예약 거절 시 예약 데이터 새로고침 범위가 개선되어, 더 정확한 정보가 반영됩니다.
    • 활동 삭제 후 캐러셀 활동 데이터도 함께 새로고침되어 최신 상태가 유지됩니다.
    • 내 활동 삭제 후 캐러셀 활동 및 내 활동 데이터가 모두 새로고침됩니다.

@coderabbitai
Copy link

coderabbitai bot commented Aug 4, 2025

Walkthrough

이번 변경에서는 예약 캘린더의 DayCell 컴포넌트에서 거절(reject) mutation 성공 시 캐시 무효화 키를 수정했습니다. 또한 Storybook의 정적 파일 제공 설정을 비활성화하고, 빌드 스크립트에 Storybook 정적 파일을 Next.js 출력 폴더에 빌드하도록 명령을 추가했습니다. 마지막으로, Vercel 설정에 Storybook UI 접근을 위한 rewrite 규칙을 추가했습니다. 그리고 Storybook 접근을 위한 React 클라이언트 리디렉션 컴포넌트가 새로 도입되었으며, 활동 삭제 후 캐시 무효화 범위가 확대되었습니다.

Changes

Cohort / File(s) Change Summary
예약 캘린더 캐시 무효화 로직 수정
src/domain/Reservation/components/reservation-calendar/DayCell.tsx
reject mutation 성공 시 캐시 무효화 키를 ['reservationsBySchedule']에서 ['allReservationsByDate', selectedActivityId, day.format('YYYY-MM-DD')]로 변경. 나머지 무효화 키는 그대로 유지.
Storybook 정적 파일 설정 및 빌드 관련 변경
.storybook/main.ts, package.json, vercel.json, src/app/storybook/page.tsx
.storybook/main.ts에서 staticDirs 주석 처리로 정적 파일 제공 비활성화, viteFinal 함수 추가로 프로덕션 빌드 시 base 경로 변경. package.json 빌드 스크립트에 Storybook 빌드 명령 추가. vercel.json/storybook 경로 rewrite 규칙 추가. src/app/storybook/page.tsx에 Storybook 리디렉트용 React 컴포넌트 추가.
활동 삭제 후 캐시 무효화 확장
src/domain/Activity/components/detail/activity-summary/ActivityDropdown.tsx, src/domain/Reservation/components/my-activity-card/DeleteMyActivityModal.tsx
활동 삭제 성공 후 activitiesKeys.all 외에 ['carousel-activities'] 쿼리도 무효화하도록 추가. DeleteMyActivityModal.tsx에서도 ['my-activities'] 외에 ['carousel-activities'] 무효화 추가.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DayCell Component
    participant Mutation (reject)
    participant QueryClient

    User->>DayCell Component: 예약 거절 액션 실행
    DayCell Component->>Mutation (reject): reject mutation 호출
    Mutation (reject)-->>DayCell Component: onSuccess 콜백 실행
    DayCell Component->>QueryClient: invalidate ['allReservationsByDate', selectedActivityId, day.format('YYYY-MM-DD')]
    DayCell Component->>QueryClient: invalidate ['schedules']
    DayCell Component->>QueryClient: invalidate ['reservationDashboard']
Loading
sequenceDiagram
    participant User
    participant StorybookRedirect Component
    participant Router

    User->>StorybookRedirect Component: /storybook 경로 접근
    StorybookRedirect Component->>Router: router.replace('/storybook/index.html')
    Router-->>User: 페이지 리디렉션 완료
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Refactor: 3차 QA내용 반영 #503: DayCell.tsx 내 다른 mutation의 캐시 무효화 키를 수정하며, 관련 prop도 추가. 캐시 무효화 로직 변경이 직접적으로 연관됨.
  • Feat: 예약 달력 구현 #168: DayCell 컴포넌트 및 캘린더 기능의 초기 구현 PR로, 이번 변경이 해당 코드에 직접적으로 기반함.

Suggested reviewers

  • sgoldenbird
  • Seon-K

Poem

🐇
캐시 키 바꿔 예약 새롭게,
Storybook은 잠시 쉬고,
빌드 스크립트에 힘을 더해,
Vercel 길 열어주네.
토끼는 깡충깡충 뛰며,
코드 속 변화 축하해!
🥕✨

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/510/decline

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.

@github-actions
Copy link

github-actions bot commented Aug 4, 2025

✅ Preview Deployment Ready!

🔗 Preview URL: https://roam-ready-q3svnxvgf-yongmins-projects-bf5f7733.vercel.app
📝 Branch: fix/510/decline
💾 Commit: Fix: 예약 거절 시 캐시 무효화
🕐 Deployed at:


This preview will be automatically updated on new commits.

@github-actions
Copy link

github-actions bot commented Aug 4, 2025

✅ Preview Deployment Ready!

🔗 Preview URL: https://roam-ready-af1ojurkz-yongmins-projects-bf5f7733.vercel.app
📝 Branch: fix/510/decline
💾 Commit: Fix: 예약 거절 시 캐시 무효화
🕐 Deployed at:


This preview will be automatically updated on new commits.

@github-actions
Copy link

github-actions bot commented Aug 4, 2025

✅ Preview Deployment Ready!

🔗 Preview URL: https://roam-ready-j9jfkihkk-yongmins-projects-bf5f7733.vercel.app
📝 Branch: fix/510/decline
💾 Commit: Fix: 예약 거절 시 캐시 무효화
🕐 Deployed at:


This preview will be automatically updated on new commits.

@github-actions
Copy link

github-actions bot commented Aug 4, 2025

✅ Preview Deployment Ready!

🔗 Preview URL: https://roam-ready-ooi1nou46-yongmins-projects-bf5f7733.vercel.app
📝 Branch: fix/510/decline
💾 Commit: Fix: 예약 거절 시 캐시 무효화
🕐 Deployed at:


This preview will be automatically updated on new commits.

@github-actions
Copy link

github-actions bot commented Aug 4, 2025

✅ Preview Deployment Ready!

🔗 Preview URL: https://roam-ready-91xe4ziz1-yongmins-projects-bf5f7733.vercel.app
📝 Branch: fix/510/decline
💾 Commit: Fix: 예약 거절 시 캐시 무효화
🕐 Deployed at:


This preview will be automatically updated on new commits.

@github-actions
Copy link

github-actions bot commented Aug 4, 2025

✅ Preview Deployment Ready!

🔗 Preview URL: https://roam-ready-6s80yfnql-yongmins-projects-bf5f7733.vercel.app
📝 Branch: fix/510/decline
💾 Commit: Fix: 예약 거절 시 캐시 무효화
🕐 Deployed at:


This preview will be automatically updated on new commits.

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

🧹 Nitpick comments (1)
src/app/storybook/page.tsx (1)

6-12: 컴포넌트 구현이 깔끔하지만 몇 가지 개선점이 있습니다.

Storybook 리다이렉트 컴포넌트가 잘 구현되었습니다. 다만 다음 개선사항들을 고려해보세요:

  1. SEO 최적화를 위한 로딩 상태 표시
  2. 리다이렉트 실패 시 에러 처리
  3. 접근성을 위한 적절한 메타데이터 추가

개선된 구현 예시:

 export default function StorybookRedirect() {
   const router = useRouter();
+  
   useEffect(() => {
-    router.replace('/storybook/index.html');
-  }, []);
-  return null;
+    router.replace('/storybook/index.html');
+  }, [router]);
+  
+  return (
+    <div>
+      <p>Storybook으로 리다이렉트 중...</p>
+    </div>
+  );
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e9be8bb and 9e49260.

📒 Files selected for processing (4)
  • .storybook/main.ts (1 hunks)
  • src/app/storybook/page.tsx (1 hunks)
  • src/domain/Activity/components/detail/activity-summary/ActivityDropdown.tsx (1 hunks)
  • src/domain/Reservation/components/my-activity-card/DeleteMyActivityModal.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/domain/Activity/components/detail/activity-summary/ActivityDropdown.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • .storybook/main.ts
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Yongmin0423
PR: codeit-FE-15-Part4-Team1/RoamReady#367
File: src/domain/Reservation/components/reservation-calendar/DayCell.tsx:180-180
Timestamp: 2025-07-30T05:52:34.014Z
Learning: Yongmin0423은 기본 기능 구현을 우선순위로 두고, 사용자 경험 개선(토스트 알림 등)은 리팩토링 단계에서 처리하는 개발 방식을 선호합니다.
🔇 Additional comments (1)
src/domain/Reservation/components/my-activity-card/DeleteMyActivityModal.tsx (1)

32-32: 캐시 무효화 범위 확장이 적절합니다.

['carousel-activities'] 쿼리 키에 대한 캐시 무효화를 추가하여 활동 삭제 후 캐러셀 관련 데이터의 일관성을 보장하는 것은 좋은 개선사항입니다. 이는 다른 컴포넌트와의 일관성을 유지하고 사용자가 최신 데이터를 볼 수 있도록 합니다.

Comment on lines +8 to +10
useEffect(() => {
router.replace('/storybook/index.html');
}, []);
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

useEffect 의존성 배열에 router 추가가 필요합니다.

React Hook 규칙에 따라 useEffect 내부에서 사용되는 router는 의존성 배열에 포함되어야 합니다.

   useEffect(() => {
     router.replace('/storybook/index.html');
-  }, []);
+  }, [router]);
📝 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
useEffect(() => {
router.replace('/storybook/index.html');
}, []);
useEffect(() => {
router.replace('/storybook/index.html');
}, [router]);
🤖 Prompt for AI Agents
In src/app/storybook/page.tsx around lines 8 to 10, the useEffect hook uses the
router object but does not include it in the dependency array. To comply with
React Hook rules, add router to the dependency array of useEffect to ensure the
effect runs correctly when router changes.

@Yongmin0423 Yongmin0423 merged commit 9bcdf6d into develop Aug 4, 2025
2 checks passed
@Yongmin0423 Yongmin0423 deleted the fix/510/decline branch August 4, 2025 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants