feat: 404 페이지 추가 - #43
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # src/components/estimate/RejectedRequestsPage.tsx
Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthrough견적 및 리뷰 페이지에 Changes고객 인증 게이트
전역 404 및 기사 인증
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Customer
participant EstimateRoute
participant CustomerAuthGate
participant EstimateClient
Customer->>EstimateRoute: 견적 페이지 요청
EstimateRoute->>CustomerAuthGate: 페이지 콘텐츠와 로딩 메시지 전달
CustomerAuthGate->>CustomerAuthGate: 고객 인증 확인
CustomerAuthGate->>EstimateClient: 인증 완료 후 콘텐츠 렌더링
sequenceDiagram
participant Mover
participant RejectedRequestsRoute
participant MoverAuthGate
participant LoginOrMoverHome
Mover->>RejectedRequestsRoute: 반려 요청 페이지 요청
RejectedRequestsRoute->>MoverAuthGate: 페이지 콘텐츠와 로딩 메시지 전달
MoverAuthGate->>MoverAuthGate: 세션 및 사용자 역할 확인
alt 비로그인 사용자
MoverAuthGate->>LoginOrMoverHome: redirect와 함께 로그인 페이지로 이동
else 고객 사용자
MoverAuthGate->>LoginOrMoverHome: 기사님 찾기 루트로 이동
else 인증된 기사
MoverAuthGate->>RejectedRequestsRoute: 자식 콘텐츠 렌더링
end
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/components/common/NotFoundView.tsx (1)
47-47: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win표준 Tailwind 스케일을 사용하세요.
max-w-[320px]와sm:min-w-[160px]는 각각max-w-80,sm:min-w-40으로 표현할 수 있습니다. 임의 값을 제거하면 기존 디자인 시스템 규칙을 유지할 수 있습니다.수정 예시
- <div className="flex w-full max-w-[320px] flex-col gap-12 sm:max-w-none sm:flex-row sm:justify-center sm:gap-16"> + <div className="flex w-full max-w-80 flex-col gap-12 sm:max-w-none sm:flex-row sm:justify-center sm:gap-16"> ... - className="sm:min-w-[160px]" + className="sm:min-w-40" ... - className="sm:min-w-[160px]" + className="sm:min-w-40"As per coding guidelines,
arbitrary value를 최소화규칙을 적용하세요.Also applies to: 52-52, 63-63
🤖 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/common/NotFoundView.tsx` at line 47, Update the responsive class names in NotFoundView’s affected container elements to replace arbitrary max/min width values with the standard Tailwind utilities max-w-80 and sm:min-w-40, including the occurrences at the referenced lines; preserve all other layout classes and behavior.Source: Coding guidelines
🤖 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/app/estimates/pending/page.tsx`:
- Around line 4-9: Export page-specific Metadata from PendingEstimatesPage,
adding the route’s title and description consistently with the other estimates
pages. Keep the existing CustomerAuthGate and PendingEstimatesPageClient
rendering unchanged.
In `@src/app/not-found.tsx`:
- Around line 16-18: Update the wrapper around NotFoundView in the 404 layout to
remain a flex container, preserving the existing vertical flex chain so
NotFoundView’s flex-1 can expand and center content within the viewport.
In `@src/components/common/NotFoundView.tsx`:
- Around line 64-66: Update the NotFoundView onClick handler to detect when
browser history has no previous entry and navigate to APP_ROUTES.HOME instead of
relying solely on router.back(); preserve router.back() when a previous history
entry exists.
---
Nitpick comments:
In `@src/components/common/NotFoundView.tsx`:
- Line 47: Update the responsive class names in NotFoundView’s affected
container elements to replace arbitrary max/min width values with the standard
Tailwind utilities max-w-80 and sm:min-w-40, including the occurrences at the
referenced lines; preserve all other layout classes and behavior.
🪄 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 Plus
Run ID: 3c8a842e-e50f-4b7a-9fb6-6b9962044718
📒 Files selected for processing (16)
src/app/estimates/[estimateId]/page.tsxsrc/app/estimates/pending/[estimateId]/page.tsxsrc/app/estimates/pending/page.tsxsrc/app/estimates/received/page.tsxsrc/app/estimates/rejected/page.tsxsrc/app/estimates/requests/[estimateRequestId]/page.tsxsrc/app/estimates/requests/page.tsxsrc/app/not-found.tsxsrc/app/reviews/me/page.tsxsrc/app/reviews/writable/page.tsxsrc/components/common/NotFoundView.tsxsrc/components/estimate/EstimatesShell.tsxsrc/components/estimate/RejectedRequestsPage.tsxsrc/components/review/ReviewsShell.tsxsrc/hooks/useAuthInit.tssrc/lib/constants/appRoutes.ts
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/components/auth/MoverAuthGate.tsx (2)
6-6: 📐 Maintainability & Code Quality | 🔵 Trivial로딩 UI를 도메인 전용 컴포넌트에서 분리하는 것을 검토하세요.
EstimatesQueryStatus는 이름상 견적(estimate) 도메인 전용 컴포넌트입니다. 이 파일은 기사 인증 가드입니다. 인증 가드가 견적 도메인 컴포넌트에 의존하면 도메인 경계가 흐려집니다. 다른 도메인에서도 이 로딩 UI를 재사용할 계획이라면, 컴포넌트를src/components/common/아래로 옮기고 이름을 도메인 중립적으로 바꾸세요. 예:QueryStatus또는AuthStatus.경로 지침은 새 컴포넌트 작성 전에
src/components/common/의 기존 컴포넌트 재사용을 확인하라고 명시합니다. 이 사례는 반대 방향의 문제입니다. 도메인 전용 컴포넌트가 도메인 밖에서 재사용되고 있습니다.Also applies to: 47-49
🤖 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/auth/MoverAuthGate.tsx` at line 6, Move the reusable loading UI currently provided by EstimatesQueryStatus out of the estimate domain into an existing suitable component under src/components/common/ if available, or create a domain-neutral replacement there named QueryStatus or AuthStatus. Update MoverAuthGate and all other references to use the new component, removing the cross-domain EstimatesQueryStatus dependency while preserving its current behavior.Source: Path instructions
24-52: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win공통 인증 가드 로직을 추출하세요.
CustomerAuthGate와MoverAuthGate는 인증 확인, 로그인 리다이렉트, 로딩 렌더링을 동일하게 구현합니다. 역할 조건과 리다이렉트 대상만 인자로 받는 공통useAuthGuard또는AuthGate로 추출하세요.🤖 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/auth/MoverAuthGate.tsx` around lines 24 - 52, Extract the duplicated authentication checking, login redirect, loading rendering, and role-based redirect logic shared by CustomerAuthGate and MoverAuthGate into a reusable useAuthGuard hook or AuthGate component. Parameterize the role predicate and unauthorized redirect destination, then update both gates to use it while preserving their existing routes, loading messages, and child rendering behavior.
🤖 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.
Nitpick comments:
In `@src/components/auth/MoverAuthGate.tsx`:
- Line 6: Move the reusable loading UI currently provided by
EstimatesQueryStatus out of the estimate domain into an existing suitable
component under src/components/common/ if available, or create a domain-neutral
replacement there named QueryStatus or AuthStatus. Update MoverAuthGate and all
other references to use the new component, removing the cross-domain
EstimatesQueryStatus dependency while preserving its current behavior.
- Around line 24-52: Extract the duplicated authentication checking, login
redirect, loading rendering, and role-based redirect logic shared by
CustomerAuthGate and MoverAuthGate into a reusable useAuthGuard hook or AuthGate
component. Parameterize the role predicate and unauthorized redirect
destination, then update both gates to use it while preserving their existing
routes, loading messages, and child rendering behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 1831841d-7c4f-492e-b7d2-04fd8e89ceb0
📒 Files selected for processing (4)
src/app/estimates/rejected/page.tsxsrc/components/auth/MoverAuthGate.tsxsrc/components/common/NotFoundView.tsxsrc/components/estimate/EstimatesShell.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
- src/app/estimates/rejected/page.tsx
- src/components/estimate/EstimatesShell.tsx
Co-authored-by: Cursor <cursoragent@cursor.com>
📋 작업 내용
존재하지 않는 경로 접근 시 안내하는 전역 404(Not Found) 페이지를 추가했습니다.
not-found.tsx구현404 | MOVING설정🔥 변경 사항
src/app/not-found.tsx— metadata + NotFoundView 연결src/components/common/NotFoundView.tsx— 중앙 정렬 404 UI (Client Component)APP_ROUTES.HOME("/") 추가EstimatesQueryStatus+fieldset재시도 UI 정리홈:
router.push(APP_ROUTES.HOME)이전:
router.back()공통
Text/Button및 기존 Empty·Error 톤 재사용✅ 체크리스트
📷 스크린샷 (선택)
🔗 관련 이슈
Closes #
💬 To Reviewer
router.back()/router.push때문에NotFoundView만 Client Component입니다.not-found.tsx는 서버에서metadata.title = "404 | MOVING"을 설정합니다.origin/devmerge 시RejectedRequestsPage충돌은 EstimatesQueryStatus + fieldset(재시도 중 비활성)으로 반영했습니다.Summary by CodeRabbit
새 기능
개선