Skip to content

Conversation

@HaeJungg
Copy link
Contributor

@HaeJungg HaeJungg commented Nov 25, 2024

🔖 Issue Ticket

Ticket

✍️ Description

✅ Checklist

PR

  • Branch Convention 확인

    feat/ 피쳐, fix/ 버그 수정, refactor/ 개선

  • Base Branch 확인
  • 적절한 Label 지정
  • Assignee 및 Reviewer 지정

Test

  • 로컬 작동 확인

Summary by CodeRabbit

  • 버그 수정
    • 좋아요 및 싫어요 기능에서 성공 알림 메시지가 제거되었습니다.
  • 새로운 기능
    • 리뷰 제출 후 목록을 새로 고칠 수 있는 refetchList 기능이 추가되었습니다.
    • 리뷰 성공 시 호출되는 onReviewSuccess 콜백이 추가되었습니다.
  • 문서화
    • ReviewFormReviewingModal 컴포넌트의 인터페이스 업데이트.

@coderabbitai
Copy link

coderabbitai bot commented Nov 25, 2024

Walkthrough

이 풀 리퀘스트는 GatheringListSection, ReviewableGatheringCardList, ReviewableGatheringCard, ReviewForm, ReviewingModal, 및 관련 스토리 파일에 대한 여러 가지 수정을 포함합니다. 주요 변경 사항은 GatheringListSection에서 성공 알림을 제거하고, ReviewableGatheringCardListrefetch 기능을 추가하며, ReviewableGatheringCardReviewForm에서 리뷰 성공 시 호출되는 콜백을 통합하는 것입니다. 이러한 변경은 데이터 가져오기 및 사용자 상호작용의 흐름을 개선합니다.

Changes

파일 경로 변경 요약
src/app/(crew)/crew/detail/[id]/_components/gathering-list-section.tsx handleLikehandleUnlike에서 성공 알림 제거, 에러 핸들링 로직 유지.
src/app/(crew)/my-page/_components/reviewable-gatherings/reviewable-gathering-card-list.tsx useInfiniteScroll 훅에서 refetch 기능 추가, ReviewableGatheringCardrefetchList prop 전달.
src/app/(crew)/my-page/_components/reviewable-gatherings/reviewable-gathering-card.tsx ReviewableGatheringCardProps 인터페이스에 refetchList 추가, ReviewingModal에서 성공 시 콜백 호출.
src/app/(crew)/my-page/_components/reviewing-modal/review-form.tsx ReviewForm 인터페이스에 onReviewSuccess prop 추가, 리뷰 성공 시 콜백 호출.
src/app/(crew)/my-page/_components/reviewing-modal/reviewing-modal.stories.tsx Template 컴포넌트에 onReviewSuccess 함수 추가, ReviewingModal에 prop 전달.
src/app/(crew)/my-page/_components/reviewing-modal/reviewing-modal.tsx ReviewingModalProps 인터페이스에 onReviewSuccess 추가, ReviewForm에서 prop 전달.

Possibly related PRs

  • Feat/CR-63/ReviewingModal #68: GatheringListSection 컴포넌트의 변경 사항이 GatheringDetailModalContainer와 관련이 있으며, 두 PR 모두 모임 관련 기능을 다룹니다.
  • Feat/111/gathering api #120: GatheringListSection 컴포넌트의 업데이트가 새로운 API 기능과 일치하며, 모임 세부사항 및 상호작용을 처리합니다.
  • Feat/115/reviewing form api #161: GatheringListSection과 관련된 리뷰 기능이 포함되어 있으며, 모임의 데이터 제출 및 업데이트를 처리합니다.

Suggested labels

api, fix, refactor

Suggested reviewers

  • yulrang
  • minkyung5x5

🐰 새로움이 가득한 이 땅,
리뷰가 성공하면 기쁨이 넘쳐,
목록이 새로워지는 그 순간,
함께하는 모임, 더 즐거워져요!
🥕✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint (1.23.1)

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

warning [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning eslint > @humanwhocodes/[email protected]: Use @eslint/config-array instead
warning eslint > @humanwhocodes/config-array > @humanwhocodes/[email protected]: Use @eslint/object-schema instead
warning eslint > file-entry-cache > flat-cache > [email protected]: Rimraf versions prior to v4 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > [email protected]: Glob versions prior to v9 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning @storybook/nextjs > @storybook/builder-webpack5 > webpack-dev-middleware > [email protected]: this will be v4
warning @storybook/nextjs > @storybook/builder-webpack5 > fork-ts-checker-webpack-plugin > [email protected]: this will be v4
warning @storybook/[email protected]: In Storybook 8, this package functionality has been integrated to a new package called @storybook/test, which uses Vitest APIs for an improved experience. When upgrading to Storybook 8 with 'npx storybook@latest upgrade', you will get prompted and will get an automigration for the new package. Please migrate when you can.
warning @storybook/jest > @storybook/[email protected]: In Storybook 8, this package functionality has been integrated to a new package called @storybook/test, which uses Vitest APIs for an improved experience. When upgrading to Storybook 8 with 'npx storybook@latest upgrade', you will get prompted and will get an automigration for the new package. Please migrate when you can.
warning @storybook/[email protected]: In Storybook 8, this package functionality has been integrated to a new package called @storybook/test, which uses Vitest APIs for an improved experience. When upgrading to Storybook 8 with 'npx storybook@latest upgrade', you will get prompted and will get an automigration for the new package. Please migrate when you can.
warning "@storybook/nextjs > [email protected]" has unmet peer dependency "webpack@>=5".
warning "@storybook/nextjs > [email protected]" has unmet peer dependency "webpack@^5.0.0".
warning "@storybook/nextjs > [email protected]" has unmet peer dependency "webpack@^5.0.0".
warning "@storybook/nextjs > [email protected]" has unmet peer dependency "webpack@>=5".
warning "@storybook/nextjs > @pmmmwh/[email protected]" has unmet peer dependency "webpack@>=4.43.0 <6.0.0".
warning " > @storybook/[email protected]" has unmet peer dependency "webpack@^5.0.0".
warning Ignored scripts due to flag.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • 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 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

@HaeJungg HaeJungg merged commit 91f6e40 into develop Nov 25, 2024
2 of 4 checks passed
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: 0

🧹 Outside diff range and nitpick comments (1)
src/app/(crew)/my-page/_components/reviewable-gatherings/reviewable-gathering-card.tsx (1)

99-102: 리뷰 성공 시 처리 로직이 깔끔하게 구현되었습니다.

모달을 닫고 리스트를 갱신하는 순서가 적절합니다. 다만, 에러 처리도 고려해보시면 좋을 것 같습니다.

다음과 같이 에러 처리를 추가하는 것을 고려해보세요:

 onReviewSuccess={() => {
   setIsModalOpened(false);
-  refetchList();
+  try {
+    refetchList();
+  } catch (error) {
+    console.error('리스트 갱신 중 오류 발생:', error);
+    // 에러 처리 로직 추가
+  }
 }}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between a411220 and 91f6e40.

📒 Files selected for processing (6)
  • src/app/(crew)/crew/detail/[id]/_components/gathering-list-section.tsx (0 hunks)
  • src/app/(crew)/my-page/_components/reviewable-gatherings/reviewable-gathering-card-list.tsx (2 hunks)
  • src/app/(crew)/my-page/_components/reviewable-gatherings/reviewable-gathering-card.tsx (3 hunks)
  • src/app/(crew)/my-page/_components/reviewing-modal/review-form.tsx (2 hunks)
  • src/app/(crew)/my-page/_components/reviewing-modal/reviewing-modal.stories.tsx (1 hunks)
  • src/app/(crew)/my-page/_components/reviewing-modal/reviewing-modal.tsx (2 hunks)
💤 Files with no reviewable changes (1)
  • src/app/(crew)/crew/detail/[id]/_components/gathering-list-section.tsx
🔇 Additional comments (11)
src/app/(crew)/my-page/_components/reviewing-modal/reviewing-modal.tsx (3)

11-11: Props 인터페이스가 적절하게 정의되었습니다.

콜백 함수의 타입이 명확하게 정의되어 있으며, 필수 prop으로 지정된 것이 적절합니다.


14-19: 컴포넌트 시그니처가 깔끔하게 업데이트되었습니다.

props 구조분해할당이 인터페이스 정의와 일관성있게 구현되었습니다.


40-40: ReviewForm에 콜백 전달이 올바르게 구현되었습니다.

다만, ReviewForm 컴포넌트가 이 콜백을 적절히 처리하는지 확인이 필요합니다.

✅ Verification successful

Let me gather more context about the ReviewForm component to ensure proper callback handling.


onReviewSuccess 콜백이 정상적으로 구현되어 있음을 확인했습니다.

ReviewForm 컴포넌트가 다음과 같이 콜백을 올바르게 처리하고 있습니다:

  • Props 타입에 onReviewSuccess: () => void로 정의되어 있음
  • 리뷰 제출 성공 시 onSuccess 핸들러에서 onReviewSuccess()를 호출
  • 상위 컴포넌트에서도 적절하게 사용되고 있음 (모달 닫기, 리스트 갱신 등)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# ReviewForm 컴포넌트에서 onReviewSuccess 콜백 사용을 확인

# ReviewForm 컴포넌트 검색
ast-grep --pattern 'export default function ReviewForm({ $$$, onReviewSuccess, $$$ }) {
  $$$
}'

# onReviewSuccess 호출 부분 검색
rg "onReviewSuccess\(" -A 3

Length of output: 509


Script:

#!/bin/bash
# ReviewForm 컴포넌트의 전체 구현 확인
ast-grep --pattern 'export default function ReviewForm({ $$$, onReviewSuccess, $$$ }) {
  $$$
  onReviewSuccess($$$);
  $$$
}'

# ReviewForm 컴포넌트의 타입 정의 확인
rg "type.*ReviewForm.*Props" -A 5

# ReviewForm에서 onReviewSuccess가 사용되는 컨텍스트 확인
rg "onReviewSuccess" -B 3 -A 3

Length of output: 5931

src/app/(crew)/my-page/_components/reviewing-modal/reviewing-modal.stories.tsx (2)

33-36: 리뷰 성공 핸들러가 적절히 구현되었습니다.

액션 로깅과 모달 상태 업데이트가 명확하게 처리되어 있습니다.


41-41: ReviewingModal 컴포넌트의 props 전달이 올바르게 되었습니다.

기존 props와 함께 새로운 onReviewSuccess 콜백이 잘 통합되었습니다.

src/app/(crew)/my-page/_components/reviewable-gatherings/reviewable-gathering-card-list.tsx (2)

Line range hint 9-13: 리스트 새로고침 기능이 올바르게 구현되었습니다.

useInfiniteScroll 훅에서 refetch 함수를 추출하여 리스트 갱신 기능을 구현한 것이 적절해 보입니다.


53-53: 리뷰 후 목록 갱신 기능이 잘 연결되었습니다.

refetchList prop을 통해 리뷰 완료 후 목록을 갱신하는 기능이 잘 구현되었습니다. 다만, 다음 사항들을 확인해 주시면 좋겠습니다:

  1. 리뷰 작성 중 발생할 수 있는 에러 상황에서의 처리
  2. 리스트 갱신 시 사용자 경험 (로딩 상태 표시 등)

다음 스크립트로 관련 컴포넌트들의 에러 처리를 확인해보겠습니다:

src/app/(crew)/my-page/_components/reviewing-modal/review-form.tsx (3)

18-18: 인터페이스 변경이 적절합니다!

콜백 함수를 필수 prop으로 추가한 것이 리뷰 제출 후의 동작을 명확하게 정의하는데 도움이 됩니다.


21-21: 함수 시그니처 업데이트가 올바르게 되었습니다!

인터페이스와 일치하며 매개변수 구조분해가 적절하게 구현되었습니다.


48-50: 🛠️ Refactor suggestion

콜백 함수 실행 순서를 검토해주세요.

현재 onCancelonReviewSuccess 전에 실행되고 있습니다. onCancel이 컴포넌트를 언마운트하는 경우 onReviewSuccess 실행에 문제가 발생할 수 있습니다.

다음과 같이 순서를 변경하는 것을 고려해보세요:

    onSuccess: () => {
-     onCancel();
      onReviewSuccess();
+     onCancel();
    },
src/app/(crew)/my-page/_components/reviewable-gatherings/reviewable-gathering-card.tsx (1)

21-21: 인터페이스에 새로운 프로퍼티가 잘 추가되었습니다.

리스트 갱신을 위한 콜백 함수가 적절하게 타입 정의되었습니다.

@github-actions
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants