Skip to content

Fix: 모바일 자체 뒤로가기 제어 로직#44

Merged
Monixc merged 2 commits into
mainfrom
fix/map-state-clear
Sep 12, 2025
Merged

Fix: 모바일 자체 뒤로가기 제어 로직#44
Monixc merged 2 commits into
mainfrom
fix/map-state-clear

Conversation

@Monixc

@Monixc Monixc commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

작업 내용

  • useRunModals 훅에서 뒤로가기 및 종료 시 공통으로 사용되는 로직을 cleanupAndGoBack 함수로 통합
  • Run 페이지에서 하드웨어 뒤로가기 버튼 제어 추가
  • useFocusEffect를 통해 위치 추적 및 상태 초기화 로직을 유지

참고 사항

- useRunModals 훅에서 뒤로가기 및 종료 시 공통으로 사용되는 로직을 cleanupAndGoBack 함수로 통합
- Run 페이지에서 하드웨어 뒤로가기 버튼 제어 추가
- useFocusEffect를 통해 위치 추적 및 상태 초기화 로직을 유지
@Monixc Monixc requested a review from ksy90101 as a code owner September 12, 2025 05:40
@vercel

vercel Bot commented Sep 12, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
runova-web Ignored Ignored Preview Sep 12, 2025 5:42am

@gemini-code-assist gemini-code-assist 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.

Summary of Changes

Hello @Monixc, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 모바일 환경에서 앱의 뒤로가기 및 종료 동작을 보다 일관되고 효율적으로 관리하기 위한 개선 사항을 포함합니다. 중복되는 정리 로직을 단일 함수로 통합하고, 안드로이드 기기의 하드웨어 뒤로가기 버튼에 대한 명시적인 제어를 추가하여 사용자 경험을 향상시키고 코드 유지보수성을 높였습니다.

Highlights

  • 뒤로가기 로직 통합: useRunModals 훅 내에서 위치 추적 초기화, 상태 초기화, courseId 파라미터 초기화 및 뒤로가기 기능을 포함하는 cleanupAndGoBack 함수를 새로 생성하여, 뒤로가기 확인, 종료 확인, 기록 저장 성공 시의 공통 로직을 통합했습니다.
  • 모바일 하드웨어 뒤로가기 버튼 제어: Run 페이지에 BackHandler를 사용하여 안드로이드 하드웨어 뒤로가기 버튼을 제어하는 로직을 추가했습니다. 이제 하드웨어 뒤로가기 버튼을 누르면 handleBackPress 함수가 호출됩니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Monixc Monixc merged commit 46ddbda into main Sep 12, 2025
3 checks passed

@gemini-code-assist gemini-code-assist 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.

Code Review

이번 PR은 useRunModals 훅의 공통 로직을 cleanupAndGoBack 함수로 추출하여 코드 중복을 효과적으로 줄이고, Run 페이지에 하드웨어 뒤로가기 버튼 제어 기능을 추가한 점이 좋습니다. 전반적으로 코드의 가독성과 유지보수성이 향상되었습니다. 다만, 상태 초기화 로직에서 약간의 중복이 발견되어 이에 대한 개선 제안을 포함했습니다.

Comment thread src/hooks/useRunModals.ts
Comment on lines 59 to 60
resetLocationTracking();
resetRunState();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

resetLocationTracking()resetRunState()를 연달아 호출하고 있습니다. run.store.ts를 보면 resetRunStateinitialLocationTrackingState를 포함한 전체 상태를 초기화하고, resetLocationTracking은 위치 추적 관련 상태를 초기화하고 구독을 해제합니다. 이로 인해 일부 상태(e.g., routeCoordinates, isTracking)가 중복으로 초기화되고 있습니다.

resetLocationTracking은 구독 해제만 담당하도록 하고, 상태 초기화는 resetRunState에서만 담당하도록 역할을 분리하면 코드가 더 명확해지고 중복을 제거할 수 있을 것 같습니다. 이는 run.store.ts 파일의 수정이 필요할 수 있는 제안입니다.

Comment thread src/pages/Run/index.tsx
Comment on lines +58 to +59
resetLocationTracking();
resetRunState();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

useRunModals.ts에서와 동일하게, 여기서도 resetLocationTracking()resetRunState()가 함께 호출되어 상태 초기화 로직이 중복 실행될 수 있습니다. run.store.ts의 관련 액션들을 리팩토링하여 역할을 명확히 분리하는 것을 고려해보시면 좋을 것 같습니다. 예를 들어, resetLocationTracking은 구독 해제와 같은 "정리(cleanup)" 작업만 수행하고, 모든 상태 초기화는 resetRunState가 담당하도록 하는 것입니다.

@Monixc Monixc deleted the fix/map-state-clear branch September 12, 2025 05:43
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.

1 participant