Skip to content

feat: 404 페이지 추가 - #43

Merged
juengseulki merged 8 commits into
devfrom
feat/404-page
Jul 31, 2026
Merged

feat: 404 페이지 추가#43
juengseulki merged 8 commits into
devfrom
feat/404-page

Conversation

@juengseulki

@juengseulki juengseulki commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

📋 작업 내용

존재하지 않는 경로 접근 시 안내하는 전역 404(Not Found) 페이지를 추가했습니다.

  • App Router not-found.tsx 구현
  • 홈 이동 / 이전 페이지 이동 CTA
  • 페이지 제목 404 | MOVING 설정

🔥 변경 사항

  • src/app/not-found.tsx — metadata + NotFoundView 연결
  • src/components/common/NotFoundView.tsx — 중앙 정렬 404 UI (Client Component)
  • APP_ROUTES.HOME ("/") 추가
  • (merge) 반려 목록 EstimatesQueryStatus + fieldset 재시도 UI 정리

홈: router.push(APP_ROUTES.HOME)
이전: router.back()
공통 Text / Button 및 기존 Empty·Error 톤 재사용


✅ 체크리스트

  • 로컬에서 정상 동작을 확인했습니다.
  • 기존 기능에 영향을 주지 않는지 확인했습니다.
  • 불필요한 console.log를 제거했습니다.
  • lint를 통과했습니다.
  • README 또는 문서를 수정했습니다. (필요 시)
  • API 명세와 일치하는지 확인했습니다.

📷 스크린샷 (선택)

localhost_3000_123456

🔗 관련 이슈

Closes #


💬 To Reviewer

  • router.back() / router.push 때문에 NotFoundView만 Client Component입니다.
  • not-found.tsx는 서버에서 metadata.title = "404 | MOVING"을 설정합니다.
  • origin/dev merge 시 RejectedRequestsPage 충돌은 EstimatesQueryStatus + fieldset(재시도 중 비활성)으로 반영했습니다.

Summary by CodeRabbit

  • 새 기능

    • 견적 및 리뷰 관련 페이지에 고객 인증 확인을 적용했습니다.
    • 반려 요청 페이지에 기사님 인증 확인을 추가했습니다.
    • 전역 404 화면과 홈·이전 페이지 이동 기능을 추가했습니다.
  • 개선

    • 인증 확인 중 안내 메시지를 표시합니다.
    • 잘못된 견적·요청 ID는 기존처럼 404로 처리합니다.
    • 404 화면에서는 로그인 페이지로 자동 이동하지 않습니다.
    • 견적·리뷰 탭이 인증 준비 상태에 따라 표시됩니다.

jeungseulki and others added 4 commits July 30, 2026 18:07
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>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: be984021-825f-4f39-9b46-4b02c64ca24e

📥 Commits

Reviewing files that changed from the base of the PR and between e18ff95 and d61de77.

📒 Files selected for processing (6)
  • src/app/estimate/rejected/page.tsx
  • src/app/estimates/[estimateId]/page.tsx
  • src/app/estimates/pending/[estimateId]/page.tsx
  • src/app/estimates/requests/[estimateRequestId]/page.tsx
  • src/hooks/useAuthInit.ts
  • src/lib/constants/appRoutes.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/lib/constants/appRoutes.ts
  • src/app/estimates/pending/[estimateId]/page.tsx
  • src/hooks/useAuthInit.ts
  • src/app/estimates/[estimateId]/page.tsx
  • src/app/estimates/requests/[estimateRequestId]/page.tsx

📝 Walkthrough

Walkthrough

견적 및 리뷰 페이지에 CustomerAuthGate를 적용했습니다. 기사 전용 반려 요청 페이지에는 MoverAuthGate를 추가했습니다. 전역 404 화면과 인증 리디렉션 예외도 추가했습니다.

Changes

고객 인증 게이트

Layer / File(s) Summary
견적 라우트 인증 게이트
src/app/estimates/...
견적 목록과 상세 화면을 인증 확인 후 렌더링하도록 변경했습니다. 잘못된 ID는 notFound()로 처리합니다.
리뷰 라우트 인증 게이트
src/app/reviews/*
리뷰 작성 및 내 리뷰 화면을 인증 확인 후 렌더링하도록 변경했습니다.
견적 및 리뷰 셸 인증 준비 상태
src/components/estimate/EstimatesShell.tsx, src/components/review/ReviewsShell.tsx
페이지 수준 인증 게이트를 사용하도록 변경했습니다. 인증 준비가 완료된 허용 경로에서만 탭을 표시합니다.

전역 404 및 기사 인증

Layer / File(s) Summary
전역 404 화면과 인증 리디렉션 예외
src/app/not-found.tsx, src/components/common/NotFoundView.tsx, src/hooks/useAuthInit.ts, src/lib/constants/appRoutes.ts
전역 404 화면과 홈 이동 및 조건부 뒤로 가기 동작을 추가했습니다. 404 화면에서는 로그인 리디렉션을 중단합니다.
기사 인증 게이트
src/components/auth/MoverAuthGate.tsx, src/app/estimate/rejected/page.tsx
비로그인 사용자를 로그인 경로로 이동시키고, 고객 사용자를 기사님 찾기 경로로 이동시킵니다. 인증된 기사만 반려 요청 화면을 렌더링합니다.

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: 인증 완료 후 콘텐츠 렌더링
Loading
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
Loading

Possibly related PRs

Suggested reviewers: 9g-g9, youngmis, soooob43

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 전역 404 페이지 추가라는 PR의 핵심 변경 사항을 정확하고 간결하게 설명합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/404-page

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between d5e2fe8 and 9ed1af5.

📒 Files selected for processing (16)
  • src/app/estimates/[estimateId]/page.tsx
  • src/app/estimates/pending/[estimateId]/page.tsx
  • src/app/estimates/pending/page.tsx
  • src/app/estimates/received/page.tsx
  • src/app/estimates/rejected/page.tsx
  • src/app/estimates/requests/[estimateRequestId]/page.tsx
  • src/app/estimates/requests/page.tsx
  • src/app/not-found.tsx
  • src/app/reviews/me/page.tsx
  • src/app/reviews/writable/page.tsx
  • src/components/common/NotFoundView.tsx
  • src/components/estimate/EstimatesShell.tsx
  • src/components/estimate/RejectedRequestsPage.tsx
  • src/components/review/ReviewsShell.tsx
  • src/hooks/useAuthInit.ts
  • src/lib/constants/appRoutes.ts

Comment thread src/app/estimates/pending/page.tsx
Comment thread src/app/not-found.tsx Outdated
Comment thread src/components/common/NotFoundView.tsx Outdated
jeungseulki and others added 2 commits July 31, 2026 15:58
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@yooseohyeon yooseohyeon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

작업하느라 수고하셨습니다! layout AuthGate가 notFound()를 가로채던 문제를 페이지로 내리고, 404에 마커를 두고 만료 리다이렉트 제외한 점 등이 좋았습니다!
전체적으로 잘해주셔서 큰 리뷰는 없습니다. 인라인 코멘트는 확인을 해보면 좋을 정도의 중요도가 낮은 내용들입니다.

Comment thread src/app/estimates/rejected/page.tsx Outdated
Comment thread src/components/common/NotFoundView.tsx Outdated
Co-authored-by: Cursor <cursoragent@cursor.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 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

공통 인증 가드 로직을 추출하세요.

CustomerAuthGateMoverAuthGate는 인증 확인, 로그인 리다이렉트, 로딩 렌더링을 동일하게 구현합니다. 역할 조건과 리다이렉트 대상만 인자로 받는 공통 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

📥 Commits

Reviewing files that changed from the base of the PR and between ee87fbc and e18ff95.

📒 Files selected for processing (4)
  • src/app/estimates/rejected/page.tsx
  • src/components/auth/MoverAuthGate.tsx
  • src/components/common/NotFoundView.tsx
  • src/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>
@juengseulki
juengseulki merged commit e5c4723 into dev Jul 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants