fix: address second pass QA issues#20
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Worried about impact? Review this PR in Change Stack to explore blast radius before you approve or request changes. Warning Review limit reached
More reviews will be available in 20 minutes and 50 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthrough이 PR은 최근 본 피드 추적, 스팟 채팅방 권한 시스템 리팩토링, 피드 UI 북마크 표시 개선, AI 시뮬레이션 기반 포스트 생성 폼 프리필 강화를 포괄하는 다기능 업데이트이다. 로컬 스토리지 캐시 기반 최근 조회 기록, 백엔드 파생 필드 기반 채팅방 권한 판정, 동적 북마크 상태 표시, sessionStorage 기반 폼 초기값 전달 메커니즘을 추가한다. Changes최근 본 피드 추적
스팟 채팅방 권한 및 라이프사이클
피드 UI 및 북마크 표시 개선
포스트 폼 프리필 및 AI 시뮬레이션
기타 UI 스타일
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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: 3
🧹 Nitpick comments (2)
src/features/chat/model/mock.ts (1)
522-537: 💤 Low value
isSupporterForSpot호출을 위해 부분 객체를 인라인으로 구성하는 것은 중복과 복잡성을 유발합니다.
isSupporterForSpot함수는room.spot.type,room.spot.authorId,userId만 사용합니다. 전체SpotChatRoom객체를 인라인으로 재구성하는 대신 로직을 직접 인라인하거나 더 단순한 헬퍼를 사용하는 것이 좋습니다.♻️ 제안된 간소화
- participationRole: isSupporterForSpot({ - id: `spot-room-${spot.id}`, - category: 'spot', - currentUserId: CHAT_CURRENT_USER_ID, - currentUserName: CHAT_CURRENT_USER_NAME, - title: spot.title, - subtitle: '', - description: spot.description, - metaLabel: '', - updatedAt: spot.updatedAt, - unreadCount: 0, - spot, - messages: [], - }) - ? 'SUPPORTER' - : 'PARTNER', + participationRole: + (spot.type === 'OFFER' + ? spot.authorId === CHAT_CURRENT_USER_ID + : spot.authorId !== CHAT_CURRENT_USER_ID) + ? 'SUPPORTER' + : 'PARTNER',🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/features/chat/model/mock.ts` around lines 522 - 537, The code builds a full SpotChatRoom-like object just to call isSupporterForSpot when that helper only needs room.spot.type, room.spot.authorId, and a userId; replace the inline object with a direct call using those minimal values (e.g., isSupporterForSpot({ type: spot.type, authorId: spot.authorId, userId: CHAT_CURRENT_USER_ID }) or inline the boolean check using spot.type/spot.authorId and CHAT_CURRENT_USER_ID) and then set participationRole based on that result to remove the duplicated complex object construction.src/features/chat/ui/ChatDetail.tsx (1)
600-621: ⚖️ Poor tradeoff
roomLifecycleSource와userFeedRole계산 로직이ChatCreationPanel.tsx와 중복됩니다.두 파일 모두 동일한 로직으로
roomLifecycleSource와userFeedRole을 계산합니다. 향후 로직 변경 시 불일치가 발생할 수 있으므로, 공통 유틸리티 함수로 추출하는 것을 고려해 보세요.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/features/chat/ui/ChatDetail.tsx` around lines 600 - 621, The roomLifecycleSource and userFeedRole calculation is duplicated; extract the logic into a shared utility (e.g., a new function like computeRoomLifecycleAndRole or two helpers computeRoomLifecycleSource and computeUserFeedRole) and replace the in-file computations in ChatDetail (the roomLifecycleSource, userFeedRole, canManageOwnerActions, canCreateReverseOffer) and the equivalent code in ChatCreationPanel.tsx to call those utilities; ensure the helpers accept the room object (currentRoom) and any helper predicates used (isOwnedSpotRoom, isSupporterForSpot) or import them, and keep the same return values so canManageOwnerActions and canCreateReverseOffer continue to derive from the returned lifecycle source and role.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/features/feed/ui/detail/FeedRecentViewRecorder.tsx`:
- Around line 21-23: The useEffect currently depends on the whole item object
which can change reference on parent re-renders and cause duplicate recordings;
update the dependency array of the useEffect that calls recordRecentFeedView
(the effect containing recordRecentFeedView(item)) to depend only on item.id
(use [item.id]) so the effect runs only when the feed ID changes.
In `@src/features/feed/ui/FeedCard.tsx`:
- Around line 286-287: Rendering childArray twice when shouldLoop is true causes
duplicate React keys (ExploreSlotStrip children using slot.key); to fix, when
producing the second render wrap/map childArray and assign unique keys (e.g.,
prefix or suffix existing slot.key) or clone elements with React.cloneElement to
set key={`loop-${slot.key}`} so the second set is distinct while preserving
other props.
In `@src/features/my/model/recent-feed-views-store.ts`:
- Around line 44-64: The pagination mixes 0-based and 1-based logic; in
getRecentFeedViews decide on 1-based paging (recommended) by defaulting page to
1 (change page = params?.page ?? 1), compute zeroBasedPage with Math.max(0, page
- 1) instead of page > 0 ? page - 1 : page, keep start = zeroBasedPage * size
and slice as-is, and preserve meta.page as the original 1-based page so meta,
start, and hasNext are consistent (update references to page, zeroBasedPage,
start, and meta accordingly).
---
Nitpick comments:
In `@src/features/chat/model/mock.ts`:
- Around line 522-537: The code builds a full SpotChatRoom-like object just to
call isSupporterForSpot when that helper only needs room.spot.type,
room.spot.authorId, and a userId; replace the inline object with a direct call
using those minimal values (e.g., isSupporterForSpot({ type: spot.type,
authorId: spot.authorId, userId: CHAT_CURRENT_USER_ID }) or inline the boolean
check using spot.type/spot.authorId and CHAT_CURRENT_USER_ID) and then set
participationRole based on that result to remove the duplicated complex object
construction.
In `@src/features/chat/ui/ChatDetail.tsx`:
- Around line 600-621: The roomLifecycleSource and userFeedRole calculation is
duplicated; extract the logic into a shared utility (e.g., a new function like
computeRoomLifecycleAndRole or two helpers computeRoomLifecycleSource and
computeUserFeedRole) and replace the in-file computations in ChatDetail (the
roomLifecycleSource, userFeedRole, canManageOwnerActions, canCreateReverseOffer)
and the equivalent code in ChatCreationPanel.tsx to call those utilities; ensure
the helpers accept the room object (currentRoom) and any helper predicates used
(isOwnedSpotRoom, isSupporterForSpot) or import them, and keep the same return
values so canManageOwnerActions and canCreateReverseOffer continue to derive
from the returned lifecycle source and role.
🪄 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: 8d8edb0d-97fa-4e9a-a698-18e0012d81e8
📒 Files selected for processing (22)
src/app/(detail)/feed/[id]/page.tsxsrc/features/chat/api/chat-api.tssrc/features/chat/model/mock.tssrc/features/chat/model/types.tssrc/features/chat/ui/ChatCreationPanel.tsxsrc/features/chat/ui/ChatDetail.tsxsrc/features/feed/model/use-feed.tssrc/features/feed/ui/FeedCard.tsxsrc/features/feed/ui/MapFeedCardPager.tsxsrc/features/feed/ui/detail/FeedParticipationActions.test.tsxsrc/features/feed/ui/detail/FeedParticipationActions.tsxsrc/features/feed/ui/detail/FeedRecentViewRecorder.tsxsrc/features/map/client/MapClient.tsxsrc/features/map/ui/MapFeedInfoCard.tsxsrc/features/map/ui/MapFeedStackCard.tsxsrc/features/my/model/recent-feed-views-store.tssrc/features/my/model/use-my.tssrc/features/my/ui/my-page/MyFormControls.tsxsrc/features/post/client/OfferFormClient.tsxsrc/features/post/client/RequestFormClient.tsxsrc/features/post/model/use-post-base-form.tssrc/features/post/model/use-post-form-prefill.ts
Summary
Verification
Summary by CodeRabbit
릴리스 노트
새로운 기능
개선 사항