개설한 스터디가 마이 스터디 탭에서 보이지 않는 문제 수정#537
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthrough여러 마이스터디 페이지와 컴포넌트에서 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
PROJECT_INDEX.md (1)
161-166: 관리자 페이지 스타일링 예외 정책을 문서에 명시해 주세요.현재 문구는
p-4,rounded-lg같은 base Tailwind 클래스를 전면 금지하는 것으로 읽히는데, 관리자 영역은 예외 허용 정책이 이미 있습니다. 전역 규칙로만 적지 말고 admin 경로 예외를 함께 명시해 주세요.Based on learnings, in
code-zero-to-one/study-platform-client, admin pages undersrc/app/(admin)/**are intentionally exempt from custom design token guidelines and raw Tailwind utility classes are acceptable.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@PROJECT_INDEX.md` around lines 161 - 166, The Styling Conventions section currently forbids base Tailwind utilities globally; update the document to state an explicit exception for admin pages by adding a sentence clarifying that pages under the admin route (src/app/(admin)/**) may use raw Tailwind utility classes and base scale tokens (e.g., p-4, rounded-lg) instead of project tokens, while the global rule (no arbitrary values, use cn() from src/components/common/ui/(shadcn)/lib/utils.ts) remains enforced for all non-admin code; ensure the added text appears in the "Styling Conventions" block so readers see the admin exemption alongside the existing rules.src/app/(service)/(my)/my-study/completed/page.tsx (1)
34-36: Line [36]의 배열 단언(as)은 타입 가드로 대체하는 편이 안전합니다.현재는 필터 조건과 타입 계약이 어긋나도 컴파일에서 놓칠 수 있습니다.
filter자체를 타입 가드로 만들면 단언 없이 안전하게 좁힐 수 있습니다.제안 코드
- const completedStudyList = (data?.content || []).filter( - (list) => list.type === 'GROUP_STUDY' || list.type === 'MENTOR_STUDY', - ) as MemberGroupStudyList[]; + const isCompletedGroupOrMentorStudy = ( + list: MemberStudyItem, + ): list is MemberGroupStudyList => + (list.type === 'GROUP_STUDY' || list.type === 'MENTOR_STUDY') && + list.status === 'COMPLETED'; + + const completedStudyList = (data?.content ?? []).filter( + isCompletedGroupOrMentorStudy, + );As per coding guidelines,
**/*.{ts,tsx}: Useinguard with fallback instead of TypeScriptasassertion for enum-like string type assertions.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/app/`(service)/(my)/my-study/completed/page.tsx around lines 34 - 36, Replace the unsafe TypeScript assertion on completedStudyList with a proper type guard: change the filter callback used to derive completedStudyList so it narrows items by checking the discriminant (e.g., verify 'type' exists and equals 'GROUP_STUDY' or 'MENTOR_STUDY' using an "in" guard or property check) and return a boolean typed as a user-defined type predicate (e.g., function isMemberGroupStudy(item): item is MemberGroupStudyList). Update the call that builds completedStudyList to use that predicate instead of "as" so the array is safely narrowed without assertions.src/app/(service)/(my)/my-study/not-completed/page.tsx (1)
34-36: Line [36]의 타입 단언은 제거하고 타입 가드로 고정해 주세요.현재 필터는
type만 검사한 뒤 배열 전체를 단언하고 있어, 실제 응답 형태 변화 시 타입 안정성이 약해집니다.제안 코드
- const notCompletedStudyList = (data?.content || []).filter( - (s) => s.type === 'GROUP_STUDY' || s.type === 'MENTOR_STUDY', - ) as MemberGroupStudyList[]; + const isGroupOrMentorStudy = ( + s: MemberStudyItem, + ): s is MemberGroupStudyList => + s.type === 'GROUP_STUDY' || s.type === 'MENTOR_STUDY'; + + const notCompletedStudyList = (data?.content ?? []).filter( + isGroupOrMentorStudy, + );As per coding guidelines,
**/*.{ts,tsx}: Useinguard with fallback instead of TypeScriptasassertion for enum-like string type assertions.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/app/`(service)/(my)/my-study/not-completed/page.tsx around lines 34 - 36, Remove the use of the type assertion on notCompletedStudyList and replace it with a proper type guard function (e.g., isMemberGroupStudy) that narrows to MemberGroupStudyList by checking both s.type === 'GROUP_STUDY' || s.type === 'MENTOR_STUDY' and the presence of required properties using the `in` operator (or other property checks) to ensure runtime shape safety; then use that guard in the filter call that constructs notCompletedStudyList and, if necessary, provide a fallback path for items that fail the guard.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@PROJECT_INDEX.md`:
- Line 244: The hardcoded branch line "Current branch: `feat/delete-inquiry` |
Main branch: `develop`" is inconsistent with this PR's source branch
(`fix/my-study`) and will become stale; update PROJECT_INDEX.md by either
removing that hardcoded branch info or replacing it with a generic example
placeholder (e.g., "Current branch: `<your-branch>` | Main branch:
`<main-branch>`") so it no longer ties the document to a specific branch.
---
Nitpick comments:
In `@PROJECT_INDEX.md`:
- Around line 161-166: The Styling Conventions section currently forbids base
Tailwind utilities globally; update the document to state an explicit exception
for admin pages by adding a sentence clarifying that pages under the admin route
(src/app/(admin)/**) may use raw Tailwind utility classes and base scale tokens
(e.g., p-4, rounded-lg) instead of project tokens, while the global rule (no
arbitrary values, use cn() from src/components/common/ui/(shadcn)/lib/utils.ts)
remains enforced for all non-admin code; ensure the added text appears in the
"Styling Conventions" block so readers see the admin exemption alongside the
existing rules.
In `@src/app/`(service)/(my)/my-study/completed/page.tsx:
- Around line 34-36: Replace the unsafe TypeScript assertion on
completedStudyList with a proper type guard: change the filter callback used to
derive completedStudyList so it narrows items by checking the discriminant
(e.g., verify 'type' exists and equals 'GROUP_STUDY' or 'MENTOR_STUDY' using an
"in" guard or property check) and return a boolean typed as a user-defined type
predicate (e.g., function isMemberGroupStudy(item): item is
MemberGroupStudyList). Update the call that builds completedStudyList to use
that predicate instead of "as" so the array is safely narrowed without
assertions.
In `@src/app/`(service)/(my)/my-study/not-completed/page.tsx:
- Around line 34-36: Remove the use of the type assertion on
notCompletedStudyList and replace it with a proper type guard function (e.g.,
isMemberGroupStudy) that narrows to MemberGroupStudyList by checking both s.type
=== 'GROUP_STUDY' || s.type === 'MENTOR_STUDY' and the presence of required
properties using the `in` operator (or other property checks) to ensure runtime
shape safety; then use that guard in the filter call that constructs
notCompletedStudyList and, if necessary, provide a fallback path for items that
fail the guard.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c0f75354-8fb1-41dd-87a8-6e9077cdb7fe
📒 Files selected for processing (8)
CLAUDE.mdPROJECT_INDEX.mdsrc/app/(service)/(my)/my-study/completed/page.tsxsrc/app/(service)/(my)/my-study/not-completed/page.tsxsrc/app/(service)/(my)/my-study/page.tsxsrc/components/lists/completed-group-study-list.tsxsrc/components/lists/not-completed-group-study-list.tsxsrc/components/my-page/my-study-info-card.tsx
🌱 연관된 이슈
☘️ 작업 내용
MENTOR_STUDY타입 추가하여 확장 수정🍀 참고사항
스크린샷 (선택)
Summary by CodeRabbit
릴리스 노트
새로운 기능
문서
리팩토