Skip to content

Comments

[refactor] 주소등록,계좌등록 뒤로가기 수정#491

Merged
geumyoung00 merged 2 commits intoKernel360:developfrom
miniseung:refactor/profile-header
Aug 6, 2025
Merged

[refactor] 주소등록,계좌등록 뒤로가기 수정#491
geumyoung00 merged 2 commits intoKernel360:developfrom
miniseung:refactor/profile-header

Conversation

@miniseung
Copy link
Collaborator

@miniseung miniseung commented Aug 6, 2025

🚀 풀 리퀘스트 제안

📋 작업 내용

주소 등록, 계좌 등록 뒤로가기 수정

🔧 변경 사항

  • 📃 README.md
  • 📦 package.json
  • 🔥 파일 삭제
  • 🧹 그 외 ex) .gitignore 등

주요 변경 사항을 요약해 주세요.

📸 스크린샷 (선택 사항)

수정된 화면 또는 기능을 시연할 수 있는 스크린샷을 첨부해 주세요.

📄 기타

추가적으로 전달하고 싶은 내용이나 특별한 요구 사항이 있으면 작성해 주세요.

Sourcery 요약

AddressHeader 및 AccountHeader 뒤로 가기 버튼 동작을 컨텍스트별 경로로 이동하도록 리팩터링

개선 사항:

  • AddressHeader 뒤로 가기 버튼을 생성/편집 페이지에서는 '/address'로, 그 외의 경우에는 '/profile'로 푸시하도록 업데이트
  • AccountHeader 뒤로 가기 버튼을 생성/편집 페이지에서는 '/account'로, 그 외의 경우에는 '/profile'로 푸시하도록 업데이트
Original summary in English

Summary by Sourcery

Refactor AddressHeader and AccountHeader back button behavior to navigate to context-specific routes

Enhancements:

  • Update AddressHeader back button to push '/address' on create/edit pages or '/profile' otherwise
  • Update AccountHeader back button to push '/account' on create/edit pages or '/profile' otherwise

@miniseung miniseung self-assigned this Aug 6, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Aug 6, 2025

검토자 가이드

계정 및 주소 헤더 컴포넌트의 뒤로 가기 버튼 동작을 리팩토링합니다. 일반적인 history.back() 호출을 대체하여 현재 경로에 따라 사용자를 목록 또는 프로필 페이지로 라우팅하는 컨텍스트 인식 핸들러를 도입합니다.

컨텍스트 인식 뒤로 가기 버튼 탐색을 위한 시퀀스 다이어그램

sequenceDiagram
    actor User
    participant HeaderComponent as Account/AddressHeader
    participant Router
    User->>HeaderComponent: Clicks back button
    HeaderComponent->>HeaderComponent: handleOnClick()
    alt On /create or /edit page
        HeaderComponent->>Router: push('/account' or '/address')
    else On management page
        HeaderComponent->>Router: push('/profile')
    end
Loading

파일 수준 변경 사항

변경 사항 세부 정보 파일
계정 및 주소 헤더에 대한 컨텍스트 인식 뒤로 가기 탐색
  • 탐색 로직을 캡슐화하기 위해 handleOnClick 함수 도입
  • 생성/편집 경로에 있을 때 '/account' 또는 '/address'로 조건부 routes.push
  • 생성/편집 경로에 있지 않을 때 '/profile'로 폴백 routes.push
  • 두 컴포넌트에서 onClick routes.back()을 handleOnClick으로 대체
apps/web/src/components/layout/header/account.tsx
apps/web/src/components/layout/header/address.tsx

팁 및 명령어

Sourcery와 상호 작용하기

  • 새로운 검토 트리거: 풀 리퀘스트에 @sourcery-ai review 댓글을 남기세요.
  • 논의 계속: Sourcery의 검토 댓글에 직접 답장하세요.
  • 검토 댓글에서 GitHub 이슈 생성: Sourcery에게 검토 댓글에 답장하여 이슈를 생성하도록 요청하세요. 또한 @sourcery-ai issue와 함께 검토 댓글에 답장하여 이슈를 생성할 수도 있습니다.
  • 풀 리퀘스트 제목 생성: 풀 리퀘스트 제목 어디에든 @sourcery-ai를 작성하여 언제든지 제목을 생성할 수 있습니다. 또한 풀 리퀘스트에 @sourcery-ai title 댓글을 남겨 언제든지 제목을 (재)생성할 수 있습니다.
  • 풀 리퀘스트 요약 생성: 풀 리퀘스트 본문 어디에든 @sourcery-ai summary를 작성하여 원하는 위치에 언제든지 PR 요약을 생성할 수 있습니다. 또한 풀 리퀘스트에 @sourcery-ai summary 댓글을 남겨 언제든지 요약을 (재)생성할 수 있습니다.
  • 검토자 가이드 생성: 풀 리퀘스트에 @sourcery-ai guide 댓글을 남겨 언제든지 검토자 가이드를 (재)생성할 수 있습니다.
  • 모든 Sourcery 댓글 해결: 풀 리퀘스트에 @sourcery-ai resolve 댓글을 남겨 모든 Sourcery 댓글을 해결하세요. 모든 댓글을 이미 처리하여 더 이상 보고 싶지 않을 때 유용합니다.
  • 모든 Sourcery 검토 해제: 풀 리퀘스트에 @sourcery-ai dismiss 댓글을 남겨 기존의 모든 Sourcery 검토를 해제하세요. 새로운 검토로 처음부터 시작하고 싶을 때 특히 유용합니다. 새로운 검토를 트리거하려면 @sourcery-ai review 댓글을 남기는 것을 잊지 마세요!

경험 사용자 지정

대시보드에 접속하여 다음을 수행할 수 있습니다:

  • Sourcery가 생성한 풀 리퀘스트 요약, 검토자 가이드 등 검토 기능을 활성화 또는 비활성화합니다.
  • 검토 언어를 변경합니다.
  • 사용자 지정 검토 지침을 추가, 제거 또는 편집합니다.
  • 기타 검토 설정을 조정합니다.

도움말

Original review guide in English

Reviewer's Guide

Refactor back button behavior in account and address header components by introducing a context-aware handler that routes users to listing or profile pages based on the current path, replacing the generic history.back() call.

Sequence diagram for context-aware back button navigation

sequenceDiagram
    actor User
    participant HeaderComponent as Account/AddressHeader
    participant Router
    User->>HeaderComponent: Clicks back button
    HeaderComponent->>HeaderComponent: handleOnClick()
    alt On /create or /edit page
        HeaderComponent->>Router: push('/account' or '/address')
    else On management page
        HeaderComponent->>Router: push('/profile')
    end
Loading

File-Level Changes

Change Details Files
Context-aware back navigation for account and address headers
  • Introduced handleOnClick function to encapsulate navigation logic
  • Conditional routes.push to '/account' or '/address' when on create/edit paths
  • Fallback routes.push to '/profile' when not on create/edit paths
  • Replaced onClick routes.back() with handleOnClick in both components
apps/web/src/components/layout/header/account.tsx
apps/web/src/components/layout/header/address.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

안녕하세요 @miniseung - 변경 사항을 검토했는데 훌륭해 보입니다!

AI 에이전트 프롬프트
이 코드 검토의 의견을 처리해 주세요:
## 개별 의견

### 의견 1
<location> `apps/web/src/components/layout/header/account.tsx:20` </location>
<code_context>
       : '계좌 관리';

+  const handleOnClick = () => {
+    if (pathname.includes('/create') || pathname.includes('/edit')) {
+      routes.push('/account');
+    } else {
+      routes.push('/profile');
+    }
</code_context>

<issue_to_address>
Using pathname.includes may lead to false positives if route names overlap.

This approach may incorrectly match routes containing '/create' or '/edit' as substrings. Consider a stricter path check if your routing is complex.
</issue_to_address>

Sourcery는 오픈 소스에 무료입니다 - 저희 리뷰가 마음에 드시면 공유를 고려해 주세요 ✨
제가 더 유용해질 수 있도록 도와주세요! 각 댓글에 👍 또는 👎를 클릭해 주시면 피드백을 사용하여 검토를 개선하겠습니다.
Original comment in English

Hey @miniseung - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `apps/web/src/components/layout/header/account.tsx:20` </location>
<code_context>
       : '계좌 관리';

+  const handleOnClick = () => {
+    if (pathname.includes('/create') || pathname.includes('/edit')) {
+      routes.push('/account');
+    } else {
+      routes.push('/profile');
+    }
</code_context>

<issue_to_address>
Using pathname.includes may lead to false positives if route names overlap.

This approach may incorrectly match routes containing '/create' or '/edit' as substrings. Consider a stricter path check if your routing is complex.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +20 to +22
if (pathname.includes('/create') || pathname.includes('/edit')) {
routes.push('/account');
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): pathname.includes를 사용하면 경로 이름이 겹칠 경우 오탐지가 발생할 수 있습니다.

이 접근 방식은 '/create' 또는 '/edit'과 같은 부분 문자열을 포함하는 경로를 잘못 일치시킬 수 있습니다. 라우팅이 복잡하다면 더 엄격한 경로 확인을 고려하세요.

Original comment in English

issue (bug_risk): Using pathname.includes may lead to false positives if route names overlap.

This approach may incorrectly match routes containing '/create' or '/edit' as substrings. Consider a stricter path check if your routing is complex.

@geumyoung00 geumyoung00 merged commit 77c61e3 into Kernel360:develop Aug 6, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants