Skip to content

Conversation

@claudia99503
Copy link
Member

@claudia99503 claudia99503 commented Dec 15, 2025

📝 변경 사항

검색 기능 구현

  • 모임 목록 페이지에 모임 검색 기능 추가
  • URL 쿼리 파라미터(?keyword=검색어) 기반 검색 상태 관리
  • 검색 결과를 무한 스크롤로 표시

컴포넌트 구조 개선

  • GroupSearch 컴포넌트 추가: 검색 로직을 별도 컴포넌트로 분리
  • Header 기능 확장: searchBar prop을 추가하여 모임 목록 페이지에서 검색바 추가
  • LayoutWrapper: 루트 페이지일 때만 GroupSearch를 Header에 전달
  • GroupList: URL 쿼리 파라미터에서 keyword를 읽어 검색 결과 표시

Server Component 검색 지원

  • page.tsx에서 searchParams를 읽어 검색 키워드 처리
  • 검색 키워드가 있을 경우 API 호출 시 전달
  • 검색 결과를 initialData로 전달하여 초기 렌더링에 반영

🔗 관련 이슈

Closes #


🧪 테스트 방법

  • 수동 테스트 검증(로컬 환경)
  • 유닛 테스트 검증
  • 통합 테스트 검증

📸 스크린샷 (선택)

image

📋 체크리스트

  • 관련 문서를 업데이트했습니다 (필요한 경우)
  • 테스트를 추가/수정했습니다 (필요한 경우)
  • Breaking change가 있다면 명시했습니다

💬 추가 코멘트


CodeRabbit Review는 자동으로 실행되지 않습니다.

Review를 실행하려면 comment에 아래와 같이 작성해주세요

@coderabbitai review

Summary by CodeRabbit

릴리스 노트

  • 새 기능

    • 그룹 검색 기능 추가
    • 페이지 위치에 따른 동적 헤더 크기 조정
  • 스타일

    • 검색 바 아이콘 버튼 수직 위치 개선

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 15, 2025

요약

검색 기능을 지원하는 URL 파라미터 기반 그룹 검색 시스템을 구현합니다. 홈페이지에서 검색 키워드를 URL 파라미터로 수신하고, 레이아웃 계층에서 동적 헤더 높이를 관리하며, 그룹 리스트 페이지에서 검색 바를 렌더링하고 검색어 상태를 관리합니다.

변경사항

커호트 / 파일(들) 변경 요약
페이지 및 라우팅
src/app/page.tsx, src/components/layout/header/index.tsx, src/components/layout/layout-wrapper/index.tsx
HomePage가 searchParams를 수신하여 keyword를 추출하고 API 호출 및 GroupList 컴포넌트에 전달. Header 컴포넌트가 heightClass와 searchBar props를 받도록 확장. LayoutWrapper가 usePathname을 사용하여 동적 헤더 높이를 계산하고, 루트 경로에서 GroupSearch 컴포넌트를 조건부로 렌더링.
검색 컴포넌트
src/components/pages/group-search/index.tsx, src/components/pages/group-list/index.tsx
GroupSearch 컴포넌트 신규 추가 - URL 검색 파라미터에서 keyword를 읽고 SearchBar를 렌더링하며, onSearch에서 URL 파라미터를 업데이트하고 네비게이션 처리. GroupList가 useSearchParams로 URL에서 keyword를 추출하고 useInfiniteGroupList에 전달.
UI 개선
src/components/shared/search-bar/index.tsx
SearchBar의 iconButton 위치를 CSS 클래스 변경으로 수직 중앙 정렬 (top-4 right-5 → top-1/2 right-5 -translate-y-1/2).

예상 코드 리뷰 난이도

🎯 3 (보통) | ⏱️ ~20-30분

검토 시 주의사항:

  • 다중 레이어를 통한 keyword prop 전달 체인 검증 필요 (HomePage → GroupList → GroupSearch)
  • usePathname을 사용한 경로 기반 조건부 렌더링 로직 확인
  • URL searchParams와 initialKeyword의 우선순위 로직 검증 (initialKeyword ?? keywordFromUrl)
  • SearchBar의 CSS 클래스 변경이 모든 뷰포트에서 올바르게 렌더링되는지 확인

관련 PR

리뷰어 제안

  • HopeFullee
  • wooktori

축하 시

🐰 검색 기능이 우르르 추가되고,

URL 파라미터 타고 흘러가네!

동적 헤더, 조건부 렌더링,

키워드 전달의 우아한 춤사위 🎉

검색의 마법이 완성되었다!

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 (2 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 '모임 목록 페이지 모임 검색 기능 추가'로, 변경사항의 핵심인 검색 기능 추가를 명확하게 나타냅니다.
Description check ✅ Passed PR 설명은 템플릿의 주요 섹션(변경 사항, 테스트 방법, 체크리스트)을 모두 작성했으나, 관련 이슈 링크가 비어있습니다.
✨ 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 minseo-feat/infinite-schedule

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 github-actions bot requested a review from HopeFullee December 15, 2025 07:57
@github-actions
Copy link

github-actions bot commented Dec 15, 2025

🎭 Playwright Report

E2E Test가 성공적으로 완료되었습니다.

Test 요약 내용을 확인해주세요.

Status Build Log Updated (UTC)
✅ Ready View Build 2025-12-15 08:15:30

📊 Test Summary

  • ✅ Passed: 9
  • ❌ Failed: 0
  • ⏱️ Duration: 42.2s

📜 Test Details

✅ Passed Tests (9)
  • profile.test.ts (9)
    • [chromium] 비로그인 상태에서 /mypage 접속 시 /login으로 redirect 되는 지 테스트
    • [chromium] 나의 프로필 페이지로 접속 시 /mypage로 /redirect 되는 지 테스트
    • [chromium] 존재하지 않는 프로필 페이지로 접속 시 404 redirect 되는 지 테스트
    • [firefox] 비로그인 상태에서 /mypage 접속 시 /login으로 redirect 되는 지 테스트
    • [firefox] 나의 프로필 페이지로 접속 시 /mypage로 /redirect 되는 지 테스트
    • [firefox] 존재하지 않는 프로필 페이지로 접속 시 404 redirect 되는 지 테스트
    • [webkit] 비로그인 상태에서 /mypage 접속 시 /login으로 redirect 되는 지 테스트
    • [webkit] 나의 프로필 페이지로 접속 시 /mypage로 /redirect 되는 지 테스트
    • [webkit] 존재하지 않는 프로필 페이지로 접속 시 404 redirect 되는 지 테스트

@github-actions
Copy link

github-actions bot commented Dec 15, 2025

📊 Coverage Report

Status Build Log Updated (UTC)
✅ Ready View Build 2025-12-15 08:14:07

📉 #190main에 병합하면 coverage가 0.36% 감소합니다.

Coverage 요약

@@             Coverage Diff             @@
##             main     #190       +/-   ##
===========================================
- Coverage   34.92%   34.56%    -0.36%     
===========================================
  Files         153      154        +1     
  Lines        6330     6397       +67     
  Branches      247      248        +1     
===========================================
  Hits         2211     2211         0     
+ Misses       4119     4186       +67     

영향받은 파일

이 PR로 영향받은 파일이 없습니다

수정된 모든 파일이 현재 coverage를 유지했습니다.

@github-actions
Copy link

github-actions bot commented Dec 15, 2025

🎨 Storybook Report

Story가 변경되었습니다

Chromatic에서 비주얼 변경사항을 확인하세요.

Status Storybook Build Log Updated (UTC)
✅ Ready View Storybook View Build 2025-12-15 08:14:49

@github-actions
Copy link

github-actions bot commented Dec 15, 2025

🚀 PR Preview Report

Build가 성공적으로 완료되었습니다.

Preview에서 변경사항을 확인하세요.

Status Preview Build Log Updated (UTC)
✅ Ready Visit Preview View Logs 2025-12-15 08:15:17

@claudia99503 claudia99503 added the Ready For Review! 리뷰 받을 준비가 되었습니다. label Dec 15, 2025
@claudia99503
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 15, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@claudia99503 claudia99503 merged commit a02c949 into main Dec 15, 2025
7 of 8 checks passed
@claudia99503 claudia99503 deleted the minseo-feat/infinite-schedule branch December 15, 2025 08:19
Copy link
Contributor

@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 (3)
src/components/pages/group-search/index.tsx (1)

7-29: URL 변경 시 SearchBar 값 동기화 & 빈 쿼리 처리 개선 제안

  1. URL ↔ 입력값 불일치 가능성

    • currentKeywordsearchParams가 바뀔 때마다 변하지만, SearchBardefaultValue만 사용하고 내부 state로 값을 관리하고 있어요.
    • 예: 검색 후 다른 키워드로 검색 → 뒤로가기 등으로 URL의 keyword가 바뀌면, URL과 리스트는 새 키워드를 기준으로 갱신되지만 SearchBar input 값은 이전 내부 state를 그대로 유지할 수 있습니다.
    • 대응 아이디어:
      • 간단히 key를 주어 검색어가 바뀔 때마다 SearchBar를 remount:
        <SearchBar
          key={currentKeyword}
          className='h-11'
          defaultValue={currentKeyword}
          placeholder='원하는 모임을 검색해보세요'
          onSearch={handleSearch}
        />
      • 또는 SearchBar를 완전히 제어 컴포넌트로 사용(value + onChange)하는 방향도 장기적으로 고려할 수 있습니다.
  2. 빈 쿼리일 때 /? 대신 /로 이동

    • params.toString()이 빈 문자열이면 router.push('/?')가 되어 약간 지저분한 URL이 됩니다.
    • 아래처럼 정리하면 더 깔끔할 것 같습니다:
      const handleSearch = (keyword: string) => {
        const params = new URLSearchParams(searchParams.toString());
        const trimmed = keyword.trim();
      
        if (trimmed) {
          params.set('keyword', trimmed);
        } else {
          params.delete('keyword');
        }
      
        const query = params.toString();
        router.push(query ? `/?${query}` : '/');
      };
src/components/layout/layout-wrapper/index.tsx (1)

15-32: main의 min-height 정의가 중복됩니다

main에 Tailwind class로 min-h-[calc(100vh-112px)]를 주고, 동시에 인라인 스타일로 style={{ minHeight: mainMinHeight }}를 설정하고 있어서 실제로는 인라인 스타일만 적용됩니다.

  • 동작엔 문제 없지만, 나중에 높이 조정 시 혼동될 수 있으니 한쪽으로만 정리하는 걸 추천드립니다.
    • 예: class에서 min-h 제거:
      <main style={{ minHeight: mainMinHeight }}>
        {children}
      </main>
src/components/layout/header/index.tsx (1)

8-28: 루트 페이지 판별 로직이 LayoutWrapper와 Header에 중복되어 있습니다

현재는:

  • LayoutWrapper에서 isRoot에 따라 searchBar={isRoot ? <GroupSearch /> : undefined}로 한 번 필터링하고,
  • Header 내부에서도 isRootPage && searchBar && ...로 다시 조건을 검증하고 있습니다.

동작에는 문제 없지만, 루트 여부 판별이 두 군데에 나뉘어 있어 추후 유지보수 시 혼동될 수 있습니다.
장기적으로는:

  • 루트 판단은 Header만 담당하고 LayoutWrapper는 그냥 searchBar만 넘기거나,
  • 반대로 Header는 단순 프레젠테이션 컴포넌트로 두고, 루트 여부는 LayoutWrapper에서만 처리하는 식으로 책임을 한쪽에 모으는 것도 고려해 볼 수 있습니다.
📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ae63b35 and 2cb7989.

📒 Files selected for processing (6)
  • src/app/page.tsx (2 hunks)
  • src/components/layout/header/index.tsx (1 hunks)
  • src/components/layout/layout-wrapper/index.tsx (1 hunks)
  • src/components/pages/group-list/index.tsx (2 hunks)
  • src/components/pages/group-search/index.tsx (1 hunks)
  • src/components/shared/search-bar/index.tsx (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
src/components/pages/group-list/index.tsx (1)
src/hooks/use-group/use-group-infinite-list/index.ts (1)
  • useInfiniteGroupList (201-225)
src/app/page.tsx (3)
src/api/index.ts (1)
  • API (22-22)
src/lib/constants/group-list.ts (1)
  • GROUP_LIST_PAGE_SIZE (1-1)
src/components/pages/group-list/index.tsx (1)
  • GroupList (20-93)
src/components/layout/layout-wrapper/index.tsx (2)
src/components/layout/header/index.tsx (1)
  • Header (13-30)
src/components/pages/group-search/index.tsx (1)
  • GroupSearch (7-30)
src/components/layout/header/index.tsx (1)
src/components/icon/index.tsx (1)
  • Icon (55-61)
🔇 Additional comments (3)
src/components/shared/search-bar/index.tsx (1)

60-67: 검색 아이콘 정렬 변경 좋습니다

top-1/2 -translate-y-1/2로 수직 중앙 정렬이 자연스럽고, 기존 입력/검색 로직에도 영향이 없어 보입니다.

src/components/pages/group-list/index.tsx (1)

20-30: URL 기반 키워드 합성 로직이 자연스럽습니다

initialKeyword ?? keywordFromUrl로 서버에서 내려준 초기 키워드를 우선 사용하고, 없을 때만 URL을 참조하는 구조가 수화 관점에서 안정적으로 보입니다.
다만, 나중에 다른 곳에서 GroupList를 재사용하면서 initialKeyword를 명시적으로 넘기는 경우에도 이 우선순위가 여전히 의도에 맞는지 한 번만 생각해 보시면 좋겠습니다.

src/app/page.tsx (1)

10-30: searchParams → API → GroupList로 이어지는 키워드 전달 흐름이 잘 정리되어 있습니다

  • searchParams에서 keyword를 읽어 API 호출에 그대로 넘기고,
  • 동일한 값을 initialKeywordGroupList에도 전달해서 서버 초기 데이터와 클라이언트 무한스크롤 쿼리 키가 일관되게 맞춰진 점이 좋습니다.

추가로, 나중에 검색 조건이 늘어날 경우(예: 위치, 태그 등)에도 같은 패턴으로 searchParams → API → initialData/초기 파라미터를 확장하면 이해하기 쉬운 구조일 것 같습니다.

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

Labels

Ready For Review! 리뷰 받을 준비가 되었습니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants