feat: 홈 화면 개선 — DB 닉네임 인사말, 통계 API, 새 사건 버튼 연결 - #68
Conversation
- 헤더: 세션 유저명 + character-welcome.png 부엉이 이미지 - 일기 박스: 365x88, border black-700 2px, bg primary-100 - TODO: GangwonEduPower 폰트 추가 후 헤더 로고 텍스트 적용 필요 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Header.tsx에 variant prop 추가 (logo | title) - logo: 좌측 상단 말해부엉 로고 표시 (66x19, h:56, padding: 16px 20px) - title: 기존 뒤로가기 + 페이지 제목 형태 유지 - Header.module.scss에 __logo 스타일 추가 - home/page.tsx에 Header variant='logo' 적용 - 헤더를 컨테이너 padding 밖으로 분리하여 상단 여백 제거 - home/page.module.scss diaryBox에 align-self: center 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- width: 365px → width: 100% + max-width: 365px - 작은 화면에서 좌우 패딩과 결합 시 오버플로우 방지 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 일기 박스 전체를 Link로 변경 (텍스트 + 버튼 모두 클릭 가능) - diaryBox에 text-decoration: none, cursor: pointer 추가 - /diary/new 경로는 임시 지정 (담당자 확인 후 수정 예정) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- character-welcome.png → character-home.png 교체 (169x138) - 캐릭터 절대 위치 적용 (top: 41px, right: -20px) - 캐릭터가 일기 박스 뒤에 위치하도록 z-index 조정 (character: 0, container: 1) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 캐릭터 이미지 가로 스크롤 방지: .page에 overflow-x: hidden 추가 - 비로그인 사용자 분기 처리: 말해부엉 알아보기 박스 추가 (/login 이동) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- greetingText, diaryTitle, diarySubtitle에 typography 믹신 사용 - 개별 font 속성 직접 선언 → @include m.text-* 토큰으로 교체 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 인사/일기 박스는 로그인 여부 무관하게 항상 표시 - 말해부엉 알아보기 박스를 진행중인 사건 위치(구분선 아래)로 이동 - 비로그인 인사: '안녕하세요' 표시 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- StatsCategorySection, useStatistics, QueryProvider 병합 - 고민 카테고리 TOP4 통계 섹션 추가 - 통계 섹션 하단 구분선 추가 (h:8px, black-100, gap:42px) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- isLoggedIn = true 하드코딩으로 로그인 상태 유지 - TODO 주석으로 배포 전 제거 안내 표시 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ActiveCasesSection 컴포넌트 추가 - 진행중인 사건 목록 표시 (waiting_opponent / opponent_joined / both_submitted) - CaseCard 공통 컴포넌트 재사용 - 좌측 카테고리 컬러 accent bar - 카드 간격 12px - useActiveCases 훅 추가 (mock 데이터, TODO: 실 API 연동) - CaseCard에 participants prop 추가 (AvatarGroup 렌더링) - CategoryIcon의 CATEGORY_COLOR_MAP export 추가 - 홈 페이지에 로그인 시 ActiveCasesSection 표시 - 구분선 ↔ 섹션 간격 20px 적용 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- CaseCard 원본 구조 완전 원복 (participants prop 제거, div 래퍼 제거) - CategoryIcon CATEGORY_COLOR_MAP export 원복 - 불필요한 좌측 카테고리 accent bar 제거 - Avatar absolute 오버레이 우측→좌측 하단 변경 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
변경 이유:
- src/app/page.tsx: 홈 화면 콘텐츠를 루트 경로(/)에서 서빙하도록 이동
→ Next.js App Router에서 루트 경로는 src/app/page.tsx가 담당하므로
기존 (page)/home/page.tsx 대신 루트로 이동하는 것이 구조적으로 올바름
- src/app/page.module.scss: (page)/home/page.module.scss를 루트로 이동
→ page.tsx와 동일 위치에서 관리하도록 이동 (git rename으로 추적됨)
- src/app/(page)/home/page.tsx: redirect('/')로 교체
→ 기존 /home URL 접근 시 /로 리다이렉트하여 북마크/공유 링크 호환성 유지
- src/app/(page)/login/page.tsx: callbackUrl '/home' → '/'
→ 로그인 성공 후 이동 경로를 변경된 홈 경로(/)에 맞게 수정
- src/components/layout/BottomNavigation.tsx: href '/home' → '/'
→ 하단 탭 홈 버튼이 올바른 경로를 가리키도록 수정
→ pathname.startsWith('/') 는 모든 경로에서 true이므로
홈 탭 활성 조건을 pathname === '/' 로 변경하여 활성 상태 오류 수정
- src/components/home/StatsCategorySection.module.scss: width 100%로 변경
→ 고정 픽셀(346px) 대신 width: 100%로 반응형 처리
- src/middleware.ts: 개발 환경 인증 bypass 추가
→ PR #50 카카오 로그인 병합 후 next-auth/middleware가 모든 경로를 차단하게 됨
→ 개발 편의를 위해 NODE_ENV === development 일 때 인증 없이 접근 허용
→ 배포 전 반드시 제거 필요 (TODO 주석 명시)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- NewCaseButton: 홈 화면 우측 하단 고정 플로팅 버튼 추가 (w115 h48, color/black-700, border-radius 100, text-title-s) 새 사건 작성 페이지 생성 후 href 연결 필요 (TODO 주석) - HomeServiceInfo: 서비스 정보 박스 구현 (로고 w66 h19, 서비스 소개/개인정보처리방침/이용약관/고객문의 링크, Copyright 텍스트, 전체 너비 반응형, 탭바 뒤에 위치) - BottomNavigation: 홈 페이지에 탭바 추가, z-index 100 유지 (서비스 정보 박스보다 앞에 렌더링) - page.tsx: NewCaseButton, HomeServiceInfo, BottomNavigation 렌더링 추가 - page.module.scss: container padding-bottom 60px, serviceInfoWrapper 스타일 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 새 사건 + 버튼 클릭 시 카테고리 선택 모달 표시 - 모달 오버레이: color-black-700 40% 틴트 + bg-page 불투명 베이스 (배경 콘텐츠가 비치지 않도록 레이어드 배경 처리) - 카테고리 박스: w133 h176, 흰 배경, 4개 카테고리 항목 가운데 정렬 (CategoryIcon 공통 컴포넌트 사용, 연인관계/직장관계/친구관계/가족관계) (텍스트: text-body-m, text/primary, 아이콘과 9px 간격) - X 닫기 버튼: 48x48 흰 원형, CloseIcon 24x24 - 모달 오픈 시 body overflow hidden으로 스크롤 잠금 - 카테고리 href: '#' 임시 처리 (새 사건 작성 페이지 생성 후 교체 필요) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- isLoggedIn = true → !!session 으로 교체, 개발용 TODO 주석 제거 - HomeServiceInfo /privacy, /terms 실제 경로 연결 - page.module.scss 불필요 인라인 주석 제거 - HomeServiceInfo.module.scss .link/.copyright @include 뒤 빈 줄 추가 - NewCaseButton.module.scss @include 뒤 빈 줄, 주석/선언 그룹 간격 정리 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- useUserMe 훅 추가 (/api/user/me 호출, TanStack Query) - HomeGreeting 클라이언트 컴포넌트 추가 (DB 닉네임 기반 인사말) - page.tsx에서 session.user.name 제거, HomeGreeting으로 교체 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthrough
Changes홈 화면 UI 개편
카테고리 통계 API 인증 제거
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
src/app/page.tsx (1)
16-16: ⚡ Quick win비로그인 상태의 불필요한
/api/user/me호출을 줄이는 편이 좋습니다.Line 16에서 이미 로그인 여부를 알고 있으므로, Line 32의
HomeGreeting을 조건부 렌더링하면 게스트 401 요청을 줄일 수 있습니다.🚀 제안 수정안
- <HomeGreeting /> + {isLoggedIn ? ( + <HomeGreeting /> + ) : ( + <section className={styles.greeting}> + <p className={styles.userName}>안녕하세요</p> + <p className={styles.greetingText}>오늘 감정은 어떠신가요?</p> + </section> + )}Also applies to: 32-32
🤖 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/app/page.tsx` at line 16, The `HomeGreeting` component is being rendered unconditionally on line 32, which causes unnecessary `/api/user/me` API calls that result in 401 errors when the user is not logged in. Use the `isLoggedIn` variable that is already computed on line 16 to conditionally render `HomeGreeting` only when the user is authenticated, preventing the unnecessary API call for guest users.src/components/home/NewCaseButton.tsx (1)
33-38: ⚡ Quick win다이얼로그에 접근성 최소 요건(이름/ESC 종료) 보강을 권장합니다.
role="dialog"를 사용 중이므로 접근 가능한 이름과 키보드 종료 경로를 함께 제공하는 편이 안전합니다.♿ 제안 수정안
<div className={styles.overlay} onClick={() => setIsOpen(false)} role="dialog" aria-modal="true" + aria-label="새 사건 카테고리 선택" + onKeyDown={(e) => { + if (e.key === 'Escape') setIsOpen(false) + }} + tabIndex={-1} > @@ <button className={styles.closeButton} onClick={() => setIsOpen(false)} aria-label="카테고리 선택 닫기" + autoFocus >Also applies to: 48-53
🤖 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/components/home/NewCaseButton.tsx` around lines 33 - 38, The dialog element in NewCaseButton component with role="dialog" is missing accessibility requirements. Add an accessible name to the dialog div using aria-label or aria-labelledby attribute to provide a descriptive title for screen readers, and implement an ESC key event handler that calls setIsOpen(false) to allow keyboard users to close the dialog. These changes ensure the dialog meets minimum accessibility standards for both naming and keyboard navigation.
🤖 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/components/home/HomeServiceInfo.tsx`:
- Around line 4-9: The LINKS array in HomeServiceInfo component contains
placeholder links with href '#' (for '서비스 소개' and '고객문의' entries) that do not
navigate anywhere meaningful and disrupt user experience. Remove these
placeholder links from the LINKS array or conditionally exclude them from
rendering, ensuring only links with actual valid paths are displayed to users.
If these navigation items are required but not yet implemented, consider
rendering them as disabled buttons or placeholder text instead of interactive
links.
In `@src/components/home/NewCaseButton.module.scss`:
- Line 11: Remove the empty lines that appear before CSS declarations in the
NewCaseButton.module.scss file to comply with the declaration-empty-line-before
stylelint rule. Specifically, delete the blank lines that precede declarations
at the locations mentioned (lines 11, 17, 47, 61, and 89), ensuring that CSS
declarations are not preceded by empty lines as required by the stylelint
configuration.
In `@src/components/home/NewCaseButton.tsx`:
- Around line 16-20: The getCategoryHref function in NewCaseButton.tsx is
currently returning a hardcoded '#' for all categories, which prevents the
category selection links (used around lines 41-45) from navigating to actual
case creation flows. Replace the placeholder implementation by mapping the
_category parameter to actual destination paths based on each category type (for
example, different categories should return different routes like
/rooms/new/category-name instead of the static '#'). This allows users to
navigate to the appropriate case creation page when clicking category links once
those pages are implemented.
---
Nitpick comments:
In `@src/app/page.tsx`:
- Line 16: The `HomeGreeting` component is being rendered unconditionally on
line 32, which causes unnecessary `/api/user/me` API calls that result in 401
errors when the user is not logged in. Use the `isLoggedIn` variable that is
already computed on line 16 to conditionally render `HomeGreeting` only when the
user is authenticated, preventing the unnecessary API call for guest users.
In `@src/components/home/NewCaseButton.tsx`:
- Around line 33-38: The dialog element in NewCaseButton component with
role="dialog" is missing accessibility requirements. Add an accessible name to
the dialog div using aria-label or aria-labelledby attribute to provide a
descriptive title for screen readers, and implement an ESC key event handler
that calls setIsOpen(false) to allow keyboard users to close the dialog. These
changes ensure the dialog meets minimum accessibility standards for both naming
and keyboard navigation.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 0a194a0b-638d-4685-8bd0-1e17d70b6458
📒 Files selected for processing (8)
src/app/page.module.scsssrc/app/page.tsxsrc/components/home/HomeGreeting.tsxsrc/components/home/HomeServiceInfo.module.scsssrc/components/home/HomeServiceInfo.tsxsrc/components/home/NewCaseButton.module.scsssrc/components/home/NewCaseButton.tsxsrc/domains/user/hooks.ts
홈 화면 고민 카테고리 TOP4는 비로그인 포함 전체 공개 데이터이므로 인증 체크 제거. 판결 완료 사건 기준 집계 로직은 유지. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
실제 판결 데이터 쌓이면 자동으로 실제 데이터로 전환됨. TODO: 실제 데이터 쌓이면 MOCK_ITEMS 및 fallback 로직 제거 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
실 API 미연동 상태로 빈 배열 반환 처리. API 연동 시 fetchActiveCases 주석 해제 후 교체 필요. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
선택한 카테고리를 ?category= 쿼리 파라미터로 전달.
/disputes/test/statement?category={category}로 임시 연결.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
href 없는 항목은 a 태그 대신 span(aria-disabled)으로 렌더링. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
useUserMe훅 추가:/api/user/me로 DB 닉네임 조회 → 홈 인사말에 적용HomeGreeting클라이언트 컴포넌트 추가: DB 닉네임 기반 조건부 렌더링page.tsx:session.user.name(카카오 원본명) 제거,<HomeGreeting />교체/api/statistics/categories) 불필요한 인증 체크 제거 (공개 집계 데이터)useStatistics훅: 실데이터 없을 때 UI 확인용 Mock fallback 추가useActiveCases훅: Mock 데이터 제거, 실 API 연동 전까지 빈 배열 반환NewCaseButton: 카테고리 클릭 시/disputes/test/statement?category=로 이동HomeServiceInfo: 미연결 링크(서비스 소개,고객문의)<a href="#">→<span aria-disabled>교체NewCaseButton.module.scss: Stylelintdeclaration-empty-line-before위반 수정CodeRabbit 반영
HomeServiceInfo'#'링크 →null+ span 처리NewCaseButtongetCategoryHref('#')→ 실제 라우팅 연결NewCaseButton.module.scss선언 앞 빈 줄 5곳 제거Test plan
/disputes/test/statement?category={category}이동 확인🤖 Generated with Claude Code
Summary by CodeRabbit
릴리스 노트