fix: Feed/Memory/GroupSearch 머지 충돌 해결#316
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughPostBody에 포스트 클릭 네비게이션이 추가되었습니다. ReplyList는 초기 로딩 상태 처리를 분리했고, Feed는 피드 캐시 저장 및 탭-로딩 동기화를 도입했습니다. RecordFilters와 Memory는 필터 입력 모드 및 필터 해석 로직을 강화하고, MemoryContent에 삭제(onDelete) 핸들러를 전달합니다. GroupSearch는 검색 페칭 트리거와 useInfiniteScroll 제네릭/파라미터를 조정했습니다. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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: 1
🧹 Nitpick comments (2)
src/components/common/Post/PostBody.tsx (1)
16-16: LGTM! 네비게이션 로직이 올바르게 구현되었습니다.
useNavigate를 사용한 피드 상세 페이지 이동이 적절히 구현되었습니다. 선택적으로,handlePostClick함수는 간단한 래퍼이므로 인라인으로 단순화할 수 있습니다:♻️ 선택적 단순화
- const handlePostClick = (feedId: number) => { - navigate(`/feed/${feedId}`); - }; ... - <Container onClick={() => handlePostClick(feedId)}> + <Container onClick={() => navigate(`/feed/${feedId}`)}>Also applies to: 22-24, 35-35
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/common/Post/PostBody.tsx` at line 16, The handlePostClick wrapper is unnecessary—replace the separate handlePostClick function with an inline call to navigate returned by useNavigate() to simplify PostBody; locate the useNavigate() call and any references to handlePostClick (e.g., onClick handlers around the post card/preview and the function named handlePostClick) and change them to directly call navigate(`/posts/${post.id}`) (or the existing route format) inline where the click handlers are defined so you can remove the handlePostClick function entirely.src/components/common/Post/ReplyList.tsx (1)
57-57: 초기 로딩 상태 처리가 개선되었습니다.
isInitialLoading도입으로 초기 로딩 중 빈 상태 메시지가 표시되지 않도록 올바르게 수정되었습니다. 다만, 초기 로딩 중null을 렌더링하면 레이아웃 시프트가 발생할 수 있습니다. 스켈레톤 렌더링을 고려해볼 수 있습니다.♻️ 초기 로딩 시 스켈레톤 렌더링 제안
- ) : !isInitialLoading ? ( + ) : isInitialLoading ? ( + <LoadingSpinner size="small" fullHeight={false} /> + ) : ( <EmptyState disableBottomMargin={disableBottomMargin}> <div className="title">아직 댓글이 없어요</div> <div className="sub-title">첫번째 댓글을 남겨보세요</div> </EmptyState> - ) : null} + )}Also applies to: 82-87
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/common/Post/ReplyList.tsx` at line 57, The new isInitialLoading flag prevents empty-state text during initial load but returning null causes layout shift; in the ReplyList component use isInitialLoading (and the same check around the block at the commentFeed list handling near lines 82-87) to render a skeleton/placeholder element instead of null—render a SkeletonReplyList (or a simple fixed-height skeleton container matching the expected list height) while commentFeed.isLoading && list.length === 0 so the layout stays stable and then render the normal list/empty state after loading completes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/pages/groupSearch/GroupSearch.tsx`:
- Around line 52-60: Two useEffect hooks can both call fetchRecentSearches() on
mount (since searchStatus starts as 'idle'), causing duplicate API calls; remove
the unconditional useEffect and consolidate into a single effect that calls
fetchRecentSearches() only when searchStatus === 'idle' (i.e., keep the effect
using [searchStatus, fetchRecentSearches] and delete the earlier effect), or
otherwise guard the first effect with the same searchStatus === 'idle' check so
fetchRecentSearches() runs only once.
---
Nitpick comments:
In `@src/components/common/Post/PostBody.tsx`:
- Line 16: The handlePostClick wrapper is unnecessary—replace the separate
handlePostClick function with an inline call to navigate returned by
useNavigate() to simplify PostBody; locate the useNavigate() call and any
references to handlePostClick (e.g., onClick handlers around the post
card/preview and the function named handlePostClick) and change them to directly
call navigate(`/posts/${post.id}`) (or the existing route format) inline where
the click handlers are defined so you can remove the handlePostClick function
entirely.
In `@src/components/common/Post/ReplyList.tsx`:
- Line 57: The new isInitialLoading flag prevents empty-state text during
initial load but returning null causes layout shift; in the ReplyList component
use isInitialLoading (and the same check around the block at the commentFeed
list handling near lines 82-87) to render a skeleton/placeholder element instead
of null—render a SkeletonReplyList (or a simple fixed-height skeleton container
matching the expected list height) while commentFeed.isLoading && list.length
=== 0 so the layout stays stable and then render the normal list/empty state
after loading completes.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (6)
src/components/common/Post/PostBody.tsxsrc/components/common/Post/ReplyList.tsxsrc/components/memory/RecordFilters/RecordFilters.tsxsrc/pages/feed/Feed.tsxsrc/pages/groupSearch/GroupSearch.tsxsrc/pages/memory/Memory.tsx
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/hooks/useUserSearch.ts (1)
36-42: 최소 로딩 시간 처리 방식 개선 권장현재 구현은 API 호출 완료 후 500ms를 추가로 대기합니다. API가 200ms 걸리면 총 700ms가 됩니다.
Promise.all을 사용하여 병렬 처리하면 API 응답이 500ms 미만일 때만 추가 대기하게 됩니다.♻️ 병렬 처리로 개선하는 방법
setLoading(true); setError(null); - const minLoadingTime = !isLoadMore ? new Promise(resolve => setTimeout(resolve, 500)) : null; - const response = await getUsers({ - keyword: searchKeyword, - size, - isFinalized, - }); - if (minLoadingTime) await minLoadingTime; + const minLoadingTime = new Promise(resolve => setTimeout(resolve, 500)); + const apiCall = getUsers({ + keyword: searchKeyword, + size, + isFinalized, + }); + + const [response] = isLoadMore + ? [await apiCall] + : await Promise.all([apiCall, minLoadingTime]);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/hooks/useUserSearch.ts` around lines 36 - 42, Currently the code awaits getUsers(...) then conditionally awaits minLoadingTime, causing total time to be sum of both; change to start the timeout and the API call in parallel and await them together so the extra 500ms only delays when the API is faster than 500ms: create a responsePromise by calling getUsers({ keyword: searchKeyword, size, isFinalized }) and set minLoadingTime to a Promise that resolves after 500ms when !isLoadMore (or Promise.resolve() when isLoadMore), then use Promise.all([responsePromise, minLoadingTime]) to await both and extract the API response from the first result (reference symbols: getUsers, responsePromise/minLoadingTime, searchKeyword, size, isFinalized, isLoadMore).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/hooks/useUserSearch.ts`:
- Around line 36-42: Currently the code awaits getUsers(...) then conditionally
awaits minLoadingTime, causing total time to be sum of both; change to start the
timeout and the API call in parallel and await them together so the extra 500ms
only delays when the API is faster than 500ms: create a responsePromise by
calling getUsers({ keyword: searchKeyword, size, isFinalized }) and set
minLoadingTime to a Promise that resolves after 500ms when !isLoadMore (or
Promise.resolve() when isLoadMore), then use Promise.all([responsePromise,
minLoadingTime]) to await both and extract the API response from the first
result (reference symbols: getUsers, responsePromise/minLoadingTime,
searchKeyword, size, isFinalized, isLoadMore).
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
src/hooks/useUserSearch.tssrc/pages/feed/UserSearch.tsxsrc/pages/feed/UserSearchResult.styled.tssrc/pages/feed/UserSearchResult.tsx
📝작업 내용
Summary by CodeRabbit
New Features
Bug Fixes
Chores