Skip to content

Conversation

@hyesngy
Copy link
Member

@hyesngy hyesngy commented Dec 26, 2025

Summary

관련 있는 Issue를 태그해주세요. (e.g. > - #100)
closed #155
공유보드 사이드바 정보 수정

Tasks

  • 공유보드 사이드바 정보 수정

Summary by CodeRabbit

릴리스 노트

  • 리팩토링
    • 로그인 기반 사이드바 데이터 조회 흐름이 개선되었습니다.
    • 사용자 프로필 정보(프로필 이미지, 닉네임, 사운드 수) 조회 로직이 최적화되어 더욱 안정적인 사용 환경을 제공합니다.

✏️ Tip: You can customize this high-level summary in your review settings.

@hyesngy hyesngy self-assigned this Dec 26, 2025
@hyesngy hyesngy added the 🛠 Fix 버그 수정 label Dec 26, 2025
@hyesngy hyesngy linked an issue Dec 26, 2025 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Dec 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
2025-seasonthon-team-80-fe Ready Ready Preview, Comment Dec 26, 2025 8:44am

@coderabbitai
Copy link

coderabbitai bot commented Dec 26, 2025

Walkthrough

로그인 상태를 고려한 사이드바 정보 조회 로직을 개선했습니다. 단일 쿼리에서 두 단계 쿼리로 변경하여, 먼저 myBoardShare를 조회한 후 derived된 shareUri를 이용해 myBoardInfo를 조회합니다. 프로필 이미지, 닉네임, 사운드 개수 표시를 새로운 쿼리 결과로 업데이트했습니다.

Changes

Cohort / File(s) 변경 요약
로그인 인식 보드 정보 조회
src/components/ui/sidebar.tsx
boardInfo 단일 쿼리를 myBoardSharemyBoardInfo 두 단계 쿼리로 변경. myBoardShare.data.shareUri로 파생된 myShareUri 추가. isLoggedInmyShareUri 존재 조건부로 myBoardInfo 쿼리 활성화. 프로필 이미지, 닉네임, 메시지 개수를 myBoardInfo 데이터로 업데이트.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 보드의 정보 구분해서 가져오니,
로그인한 사용자의 것만 보여주네요,
타인의 정보는 안녕히, 공유 보드는 명확하게,
사이드바가 드디어 올바른 얼굴로! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 '[Fix/#155] 공유보드 사이드바 정보 수정'로 명확하게 해당 PR의 주요 변경사항과 관련 이슈를 정확히 설명하고 있습니다.
Description check ✅ Passed PR 설명이 템플릿의 필수 항목인 Summary와 Tasks를 포함하고 있으며, 관련 이슈(#155)를 명시하고 있습니다.
Linked Issues check ✅ Passed 코드 변경사항이 이슈 #155의 요구사항인 '사이드바에 로그인한 사용자 정보가 아닌 타인의 정보가 표시되는 문제'를 해결합니다. myBoardShare와 myShareUri를 통해 로그인 여부에 따른 올바른 정보 조회를 구현했습니다.
Out of Scope Changes check ✅ Passed 모든 코드 변경사항이 이슈 #155의 '공유보드 사이드바 정보 수정' 범위 내에 있으며, 사이드바 컴포넌트의 데이터 페칭 로직 개선에만 집중되어 있습니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/#155

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

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

🧹 Nitpick comments (2)
src/components/ui/sidebar.tsx (2)

46-52: 타입 안전성 개선 고려

enabled 조건으로 myShareUri가 존재할 때만 쿼리가 실행되므로 현재 코드는 안전합니다. 그러나 line 50의 as string 타입 단언보다는 non-null assertion 연산자(!)를 사용하는 것이 의도를 더 명확하게 표현할 수 있습니다.

🔎 제안하는 개선 방안
  const { data: myBoardInfo } = useQuery({
    queryKey: ["myBoardInfo", myShareUri],
-   queryFn: () => getBoardInfo(myShareUri as string),
+   queryFn: () => getBoardInfo(myShareUri!),
    enabled: isLoggedIn && Boolean(myShareUri),
  });

40-52: 에러 핸들링 추가 권장

현재 myBoardSharemyBoardInfo 쿼리에 에러 핸들링이 없습니다. 쿼리 실패 시 사용자에게 적절한 피드백을 제공하기 위해 에러 상태를 처리하는 것을 권장합니다.

🔎 제안하는 에러 핸들링 추가
  const { data: myBoardShare } = useQuery({
    queryKey: ["myBoardShare"],
    queryFn: getBoardShare,
    enabled: isLoggedIn,
  });

  const myShareUri = myBoardShare?.data?.shareUri;

- const { data: myBoardInfo } = useQuery({
+ const { data: myBoardInfo, error: myBoardInfoError } = useQuery({
    queryKey: ["myBoardInfo", myShareUri],
    queryFn: () => getBoardInfo(myShareUri as string),
    enabled: isLoggedIn && Boolean(myShareUri),
  });

그 후 UI에서 에러 상태를 확인하여 사용자에게 알림을 표시하거나 재시도 옵션을 제공할 수 있습니다.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 97e7c34 and 47d928d.

📒 Files selected for processing (1)
  • src/components/ui/sidebar.tsx
🧰 Additional context used
🧬 Code graph analysis (1)
src/components/ui/sidebar.tsx (1)
src/apis/board.ts (2)
  • getBoardShare (32-34)
  • getBoardInfo (56-62)
🔇 Additional comments (4)
src/components/ui/sidebar.tsx (4)

5-5: 변경 사항 확인 완료

로그인 사용자의 보드 정보를 가져오기 위해 getBoardShare를 올바르게 import했습니다.


39-44: 쿼리 설정 확인 완료

로그인 상태일 때만 사용자의 보드 공유 정보를 가져오도록 enabled 조건이 올바르게 설정되었습니다.


193-213: UI 업데이트 확인 완료

myBoardInfo 데이터를 사용하도록 올바르게 업데이트되었으며, 옵셔널 체이닝과 적절한 폴백 값을 통해 안전하게 처리되고 있습니다. 이제 타인의 공유보드를 볼 때도 로그인한 사용자의 정보가 표시됩니다.


39-52: 이슈 해결 확인 완료 🎉

이번 변경으로 공유보드 사이드바에서 보드 소유자의 정보가 아닌 로그인한 사용자 본인의 정보가 올바르게 표시됩니다. 로그인 상태 체크, 데이터 페칭, UI 렌더링이 모두 적절하게 구현되었습니다.

Also applies to: 193-213

@hyesngy hyesngy merged commit 5304159 into develop Dec 26, 2025
6 checks passed
@hyesngy hyesngy deleted the fix/#155 branch December 26, 2025 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠 Fix 버그 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix]: 공유보드 사이드바 정보 수정

2 participants