Skip to content

fix: Dialog 혹은 BottomSheet를 통해 navigation 하는 경우 해당 컴포넌트가 닫히기 전 화면이 먼저 전환되는 문제 임시 해결#94

Merged
seoyoon513 merged 1 commit intodevelopfrom
BOOK-205-fix/#93
Aug 1, 2025
Merged

fix: Dialog 혹은 BottomSheet를 통해 navigation 하는 경우 해당 컴포넌트가 닫히기 전 화면이 먼저 전환되는 문제 임시 해결#94
seoyoon513 merged 1 commit intodevelopfrom
BOOK-205-fix/#93

Conversation

@seoyoon513
Copy link
Copy Markdown
Contributor

@seoyoon513 seoyoon513 commented Aug 1, 2025

🔗 관련 이슈

📙 작업 설명

  • feature:screen에 delayedNavigator 확장함수 추가
  • 주요 문제가 있었던 화면(검색, 기록등록)에 적용

🧪 테스트 내역

  • 주요 기능 정상 동작 확인
  • 브라우저/기기에서 동작 확인
  • 엣지 케이스 테스트 완료
  • 기존 기능 영향 없음

📸 스크린샷 또는 시연 영상

Reed_._.mp4

💬 추가 설명 or 리뷰 포인트

  • 매끄럽게 잘 동작하는 부분에는 해당 확장함수를 따로 적용하지 않았슴다
  • 나중에 더 세련된 방법으로 고칩시다!!

Summary by CodeRabbit

  • 신규 기능

    • 화면 전환 시 약간의 지연 효과가 추가되어 더욱 부드러운 네비게이션 경험을 제공합니다.
  • 버그 수정

    • 일부 화면에서 즉시 이동하던 네비게이션이 비동기 방식으로 처리되어 사용자 경험이 개선되었습니다.

@github-actions github-actions Bot added the 🐞 fix Something isn't working label Aug 1, 2025
@github-actions github-actions Bot requested a review from easyhooon August 1, 2025 11:58
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 1, 2025

Walkthrough

Dialog나 BottomSheet를 통한 네비게이션 시 화면 전환이 먼저 발생하는 문제를 임시로 해결하기 위해, 네비게이션 함수에 지연(delay)을 주는 확장 함수(delayedGoTo, delayedPop)가 추가되었습니다. 해당 확장 함수들이 관련 이벤트 핸들러에 적용되어 비동기적으로 화면 전환이 이루어지도록 변경되었습니다.

Changes

Cohort / File(s) Change Summary
RecordRegisterPresenter 비동기 네비게이션 적용
feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterPresenter.kt
기존의 navigator.pop() 호출을 코루틴 내에서 navigator.delayedPop()으로 변경하여 두 이벤트(OnExitDialogConfirm, OnRecordSavedDialogDismiss)에서 비동기 지연 네비게이션 적용, 관련 import 추가
지연 네비게이션 확장 함수 추가
feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/extensions.kt
NavigatordelayedGoTodelayedPop suspend 확장 함수 추가, 각각 지정된 시간(기본 200ms) 지연 후 네비게이션 동작 수행
SearchPresenter 비동기 네비게이션 적용
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/SearchPresenter.kt
navigator.goTo(...)를 코루틴 내에서 navigator.delayedGoTo(...)로 변경, 관련 import 추가하여 비동기 지연 네비게이션 적용

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Presenter
    participant Navigator

    User->>Presenter: Dialog/BottomSheet 이벤트 발생
    Presenter->>Presenter: scope.launch { navigator.delayedPop() / delayedGoTo() }
    Note right of Presenter: (Coroutine 내에서 delay)
    Presenter->>Navigator: delayedPop() 또는 delayedGoTo()
    Navigator->>Navigator: delay (200ms)
    Navigator->>Navigator: pop() 또는 goTo()
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Assessment against linked issues

Objective Addressed Explanation
확장 함수를 만들어 Dialog나 BottomSheet를 경유해서 화면 전환되는 부분에 일괄 적용 (#93)

Assessment against linked issues: Out-of-scope changes

(해당 변경사항 중 범위를 벗어나는 코드 변경은 발견되지 않았습니다.)

Suggested reviewers

  • seoyoon513
  • easyhooon

Poem

🐇
딜레이 한 스푼, 네비게이션 춤,
다이얼로그 닫히면 화면이 쿵!
코루틴 타고 살짝 대기,
사용자 경험이 더욱 반짝이.
Booket의 밤은 오늘도 평화롭다! ✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch BOOK-205-fix/#93

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@easyhooon easyhooon left a comment

Choose a reason for hiding this comment

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

매직넘버가 짱이야

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 44805e4 and 08d2674.

📒 Files selected for processing (3)
  • feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterPresenter.kt (3 hunks)
  • feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/extensions.kt (1 hunks)
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/SearchPresenter.kt (2 hunks)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#52
File: feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/screens/DelegatingNavigator.kt:0-0
Timestamp: 2025-07-16T15:54:19.322Z
Learning: In the Reed-Android project using Circuit architecture, DelegatingNavigator was restored because NavigableCircuitContent can only inject a single navigator, but the dual-navigator architecture (childNavigator for bottom navigation screens, rootNavigator for full-screen screens) requires a delegating component to work within Circuit's constraint.
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#52
File: feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/screens/DelegateNavigator.kt:0-0
Timestamp: 2025-07-16T16:11:27.044Z
Learning: In the Reed-Android project's DelegateNavigator implementation, the pop(), peek(), and peekBackStack() methods should always use childNavigator without branching logic, as they operate on the currently active navigation stack. Only goTo() and resetRoot() methods need to route between childNavigator and rootNavigator based on screen type using isMainTabScreen() function.
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#52
File: feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/screens/DelegateNavigator.kt:0-0
Timestamp: 2025-07-16T16:11:27.044Z
Learning: In the Reed-Android project's DelegateNavigator implementation, the pop(), peek(), and peekBackStack() methods should always use childNavigator without branching logic, as they operate on the currently active navigation stack. Only goTo() and resetRoot() methods need to route between childNavigator and rootNavigator based on screen type.
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#46
File: feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/component/InfiniteLazyColumn.kt:83-95
Timestamp: 2025-07-14T00:46:03.843Z
Learning: seoyoon513과 팀은 한국어 주석을 선호하며, 한국어 주석을 영어로 번역하라는 제안을 하지 않아야 함
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#75
File: feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomeUi.kt:0-0
Timestamp: 2025-07-29T06:07:11.727Z
Learning: seoyoon513 팀에서는 UI 구현 단계에서 더미 데이터를 하드코딩하여 화면을 먼저 구현하고, 이후 서버 연동 시점에 실제 데이터로 교체하는 개발 방식을 사용합니다.
📚 Learning: in the reed-android project's delegatenavigator implementation, the pop(), peek(), and peekbackstack...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#52
File: feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/screens/DelegateNavigator.kt:0-0
Timestamp: 2025-07-16T16:11:27.044Z
Learning: In the Reed-Android project's DelegateNavigator implementation, the pop(), peek(), and peekBackStack() methods should always use childNavigator without branching logic, as they operate on the currently active navigation stack. Only goTo() and resetRoot() methods need to route between childNavigator and rootNavigator based on screen type.

Applied to files:

  • feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterPresenter.kt
  • feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/extensions.kt
📚 Learning: in the reed-android project's delegatenavigator implementation, the pop(), peek(), and peekbackstack...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#52
File: feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/screens/DelegateNavigator.kt:0-0
Timestamp: 2025-07-16T16:11:27.044Z
Learning: In the Reed-Android project's DelegateNavigator implementation, the pop(), peek(), and peekBackStack() methods should always use childNavigator without branching logic, as they operate on the currently active navigation stack. Only goTo() and resetRoot() methods need to route between childNavigator and rootNavigator based on screen type using isMainTabScreen() function.

Applied to files:

  • feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterPresenter.kt
  • feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/extensions.kt
📚 Learning: in circuit architecture, presenters receive the screen object directly as a constructor parameter (e...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#88
File: feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailPresenter.kt:18-47
Timestamp: 2025-07-31T23:30:37.547Z
Learning: In Circuit architecture, presenters receive the Screen object directly as a constructor parameter (e.g., @Assisted private val screen: RecordDetailScreen), and screen parameters are accessed through this screen object (e.g., screen.recordId). Screen parameters should not be added as separate constructor parameters.

Applied to files:

  • feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterPresenter.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/SearchPresenter.kt
📚 Learning: in the reed-android project using circuit architecture, delegatingnavigator was restored because nav...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#52
File: feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/screens/DelegatingNavigator.kt:0-0
Timestamp: 2025-07-16T15:54:19.322Z
Learning: In the Reed-Android project using Circuit architecture, DelegatingNavigator was restored because NavigableCircuitContent can only inject a single navigator, but the dual-navigator architecture (childNavigator for bottom navigation screens, rootNavigator for full-screen screens) requires a delegating component to work within Circuit's constraint.

Applied to files:

  • feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterPresenter.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/SearchPresenter.kt
  • feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/extensions.kt
📚 Learning: in circuit architecture, screen parameters are not manually passed to presenter constructors. the @c...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#88
File: feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailPresenter.kt:18-47
Timestamp: 2025-07-31T23:30:37.547Z
Learning: In Circuit architecture, screen parameters are not manually passed to presenter constructors. The @CircuitInject annotation automatically handles the injection of the entire Screen object, making screen parameters accessible without explicitly adding them to the constructor or factory methods.

Applied to files:

  • feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterPresenter.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/SearchPresenter.kt
📚 Learning: reed-android 프로젝트에서는 `booket.android.feature` convention plugin을 사용하여 feature 모듈들의 공통 의존성을 관리한다. 이 p...
Learnt from: easyhooon
PR: YAPP-Github/Reed-Android#61
File: feature/webview/build.gradle.kts:17-21
Timestamp: 2025-07-20T12:34:23.786Z
Learning: Reed-Android 프로젝트에서는 `booket.android.feature` convention plugin을 사용하여 feature 모듈들의 공통 의존성을 관리한다. 이 plugin은 Circuit, Compose, 그리고 core 모듈들의 의존성을 자동으로 포함하므로, 각 feature 모듈의 build.gradle.kts에서는 특별한 의존성(예: libs.logger, libs.kakao.auth)만 별도로 선언하면 된다.

Applied to files:

  • feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterPresenter.kt
  • feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/SearchPresenter.kt
📚 Learning: in the reed-android project's termsagreementscreen.kt, the ontermdetailclick event is intentionally ...
Learnt from: seoyoon513
PR: YAPP-Github/Reed-Android#35
File: feature/login/src/main/kotlin/com/ninecraft/booket/feature/login/TermsAgreementScreen.kt:127-127
Timestamp: 2025-07-09T01:14:29.836Z
Learning: In the Reed-Android project's TermsAgreementScreen.kt, the OnTermDetailClick event is intentionally passed an empty string for the URL parameter because the actual URLs for terms detail pages haven't been decided yet. This is a temporary implementation that will be updated once the URLs are finalized.

Applied to files:

  • feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/extensions.kt
🧬 Code Graph Analysis (1)
feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/extensions.kt (1)
feature/main/src/main/kotlin/com/ninecraft/booket/feature/main/bottomnavigation/DelegateNavigator.kt (2)
  • goTo (17-23)
  • pop (25-27)
⏰ 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: ci-build
🔇 Additional comments (7)
feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/extensions.kt (1)

11-14: delayedPop 구현이 올바릅니다.

기존 pop() 메서드를 지연 호출하는 구현이 정확합니다. Dialog나 BottomSheet가 닫히는 시간을 확보하여 화면 전환 타이밍 문제를 해결하는데 도움이 될 것입니다.

feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/SearchPresenter.kt (2)

20-20: 적절한 import 추가.

새로 생성된 delayedGoTo 확장 함수를 올바르게 import했습니다.


195-198: BottomSheet 네비게이션 타이밍 문제 해결.

책 등록 성공 후 RecordScreen으로 이동하는 네비게이션을 비동기 지연 호출로 변경하여, BottomSheet가 완전히 닫힌 후 화면 전환이 이루어지도록 개선했습니다. 코루틴 스코프 사용도 적절합니다.

feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/register/RecordRegisterPresenter.kt (4)

21-21: 적절한 import 추가.

새로 생성된 delayedPop 확장 함수를 올바르게 import했습니다.


155-157: Dialog 종료 시 네비게이션 타이밍 개선.

종료 확인 Dialog가 완전히 닫힌 후 화면이 전환되도록 지연된 pop() 호출을 적용했습니다. 코루틴 스코프 사용도 적절합니다.


222-226: 선택적 적용이 적절합니다.

OnRecordSavedDialogConfirm에서는 즉시 네비게이션을 사용하고, OnRecordSavedDialogDismiss에서만 지연된 네비게이션을 사용하는 것이 합리적입니다. 사용자가 명시적으로 확인 버튼을 누른 경우와 단순 닫기의 차이를 잘 구분했습니다.


230-232: Dialog dismiss 시 네비게이션 타이밍 개선.

Dialog가 자동으로 닫힐 때 지연된 pop() 호출을 적용하여 화면 전환 타이밍 문제를 해결했습니다.

Comment on lines +6 to +9
suspend fun Navigator.delayedGoTo(screen: ReedScreen, delayMillis: Long = 200L) {
delay(delayMillis)
goTo(screen)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

임시 해결책으로는 적절하지만 개선 사항을 고려해보세요.

구현 자체는 올바르지만 다음 사항들을 고려해보시기 바랍니다:

  • 200ms 기본 지연 시간이 모든 Dialog/BottomSheet에 적합한지 검증 필요
  • 사용자 경험 관점에서 지연이 체감될 수 있음
  • Circuit의 Overlay 메커니즘을 활용한 더 나은 해결책 검토 권장
🤖 Prompt for AI Agents
In
feature/screens/src/main/kotlin/com/ninecraft/booket/feature/screens/extensions.kt
around lines 6 to 9, the current delayedGoTo function uses a fixed 200ms delay
which may not suit all Dialogs or BottomSheets and could negatively impact user
experience. Review and validate if the default delay is appropriate for all
cases, and consider replacing this approach by leveraging Circuit's Overlay
mechanism for a more robust and user-friendly navigation delay solution.

@seoyoon513 seoyoon513 merged commit 1e0643d into develop Aug 1, 2025
5 checks passed
@seoyoon513 seoyoon513 deleted the BOOK-205-fix/#93 branch August 1, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 fix Something isn't working

Projects

None yet

2 participants