Conversation
Walkthrough그룹매칭 수락완료(result?type=agree) 화면에서 뒤로가기 헤더를 숨기도록 헤더 유틸에 가드를 추가하고, 해당 화면 컴포넌트에서 쿼리 파라미터 기반 네비게이션 가드(usePreventBackNavigation)와 관련 로직/임포트를 제거했습니다. 버튼의 매칭 페이지 이동 동작은 유지됩니다. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant V as MatchingAgreeView
participant R as Router
participant H as Header(getHeaderContent)
U->>V: Open result?type=agree
Note over V: 기존 back-navigation 가드 제거됨
V->>R: (on button) navigate(ROUTES.MATCH)
U->>H: Render header for current route
H->>H: if path is RESULT() and type==='agree'
H-->>U: return null (헤더 비표시)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes(해당 없음) Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the ✨ Finishing Touches
🧪 Generate unit tests
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 |
|
MATEBALL-STORYBOOK |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/shared/components/header/utils/get-header.tsx (2)
44-46: matchPath 대신 일관된 동등 비교(=) 또는 end 옵션 명시 권장현재 isResult 계산이
matchPath(암묵적 end 동작)에 의존합니다. 기존 코드가pathname === ROUTES.RESULT()로 엄밀 비교하던 맥락과 맞추거나, end 옵션을 명시해 오검출을 방지하는 편이 안전합니다.다음 중 하나로 단순화/명시화 제안:
- const isResult = Boolean(matchPath(`${ROUTES.RESULT()}`, pathname)); + const isResult = pathname === ROUTES.RESULT();또는:
- const isResult = Boolean(matchPath(`${ROUTES.RESULT()}`, pathname)); + const isResult = Boolean(matchPath({ path: ROUTES.RESULT(), end: true }, pathname));
45-47: 매직 스트링 제거로 오타 리스크 축소
'agree'는 상수화해 재사용하면 오타/변경 관리가 쉬워집니다.예시:
+ const RESULT_TYPES = { AGREE: 'agree' } as const; - const isGroupAgree = isResult && urlParams.get('type') === 'agree'; + const isGroupAgree = isResult && urlParams.get('type') === RESULT_TYPES.AGREE;src/pages/result/components/matching-agree-view.tsx (1)
35-37: 히스토리 되돌림 방지로 UX 마무리완료 화면에서 “매칭 현황 보기” 클릭 후 하드웨어/브라우저 뒤로가기로 다시 완료 화면으로 돌아오지 않게 하려면 replace 이동을 권장합니다. (요구사항에 따라 선택)
- <Button label="매칭 현황 보기" onClick={() => navigate(ROUTES.MATCH)} /> + <Button label="매칭 현황 보기" onClick={() => navigate(ROUTES.MATCH, { replace: true })} />
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/pages/result/components/matching-agree-view.tsx(1 hunks)src/shared/components/header/utils/get-header.tsx(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Cloudflare Pages
🔇 Additional comments (4)
src/shared/components/header/utils/get-header.tsx (2)
44-49: 목표 충족: result?type=agree에서 헤더를 완전히 숨겨 뒤로가기 제거의도대로 해당 화면에서 뒤로가기 버튼 및 헤더가 노출되지 않습니다. 👍
44-49: 케이스별 회귀 확인 요청아래 케이스에서 헤더 노출 여부가 의도와 일치하는지 빠른 수동/자동 확인 부탁드립니다.
- /result?type=agree → 헤더 없음
- /result?type=success | fail | receive | sent → 헤더 있음(기존 동작 유지)
- (있는 경우) /result/하위경로?type=agree → 헤더 정책 의도 확인
원하면 E2E 시나리오 작성 도와드릴게요.
src/pages/result/components/matching-agree-view.tsx (2)
8-8: 불필요한 뒤로가기 가드 제거 깔끔합니다화면 목적에 맞춰 의존성 정리된 점 좋습니다.
35-37: 제품 기대행동 확인 요청: 뒤로가기 허용 여부완료 화면에서 네이티브/브라우저 뒤로가기를 허용할지(현 상태 유지) 또는 차단/대체할지(
replace: true등) PO 결정을 확인해 주세요.
#️⃣ Related Issue
Closes #343
☀️ New-insight
결과 화면(
/result/:id)에서type=agree인 경우 헤더 자체를 렌더링하지 않도록 헤더 로직을 변경하고, 이 변경에 따라 개별 화면 컴포넌트 내부에서 사용하던 뒤로가기 가드 훅을 제거했습니다.💎 PR Point
기존에는 결과 화면에서도 헤더가 공통으로 노출되며 뒤로가기 아이콘/가드 훅으로 네비게이션을 제어했습니다. 이번 작업에서는 그룹 매칭 수락 완료 화면 내 사용자의 혼란을 방지하기 위해 따라서 헤더 단계에서
type=agree를 감지해 헤더를 숨김 처리하고, 페이지 내부의 usePreventBackNavigation 훅을 제거해 중복 제어를 없앴습니다.pathname이 결과 경로이고type=agree이면null을 반환하여 헤더 비노출usePreventBackNavigation훅 제거1) Header:
getHeaderContent에 agree 분기 추가2) 결과-수락 완료 화면: 컴포넌트에서 뒤로가기 훅 제거
usePreventBackNavigation
https://dev.mateball.co.kr/result/69?type=agree&cardtype=group→ 헤더가 노출되지 않음📸 Screenshot