Skip to content

Conversation

@Haruma-K
Copy link
Owner

@Haruma-K Haruma-K commented May 5, 2025

  • PageContainer, ModalContainer, SheetContainerをリファクタリング
  • PushやPopなどの処理の流れを整理
  • 複数の Page や Modal を同時に破棄した際に、終了処理が一部漏れることがあった問題を修正

  • Refactored PageContainer, ModalContainer, and SheetContainer
  • Streamlined the flow of operations such as Push and Pop
  • Fixed an issue where certain termination processes might not be called when dismissing multiple Pages or Modals at once

@Haruma-K Haruma-K requested a review from Copilot May 5, 2025 14:18
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors the lifecycle management for Sheets, Pages, and Modals while addressing a bug where termination processes could be partially skipped when dismissing multiple screens. Key changes include introducing dedicated context and lifecycle handler classes, consolidating transition logic using a shared ScreenContainerTransitionHandler, and updating the demo presenter to improve transition handling.

  • Introduced context classes (e.g., SheetHideContext, PagePushContext, ModalPopContext) and corresponding lifecycle handlers.
  • Refined transition flow by replacing exception throws with Assert-based checks and centralizing interaction state management.
  • Fixed the issue of missed termination callbacks during simultaneous screen dismissals and added a wait frame in the demo presenter.

Reviewed Changes

Copilot reviewed 20 out of 29 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Assets/UnityScreenNavigator/Runtime/Core/Sheet/SheetHideContext.cs Added a context class for sheet hide transitions.
Assets/UnityScreenNavigator/Runtime/Core/Sheet/SheetContainer.cs Refactored sheet registration and transition logic with integrated lifecycle and transition handling.
Assets/UnityScreenNavigator/Runtime/Core/Shared/ScreenContainerTransitionHandler.cs Introduced a dedicated transition handler for managing container transitions.
Assets/UnityScreenNavigator/Runtime/Core/Shared/IScreenContainer.cs Added an interface abstraction for screen containers.
Assets/UnityScreenNavigator/Runtime/Core/Page/PagePushContext.cs Provided a push context structure for page transitions.
Assets/UnityScreenNavigator/Runtime/Core/Page/PagePopContext.cs Provided a pop context structure for page transitions.
Assets/UnityScreenNavigator/Runtime/Core/Page/PageLifecycleHandler.cs Updated page lifecycle operations to follow the new refactored patterns.
Assets/UnityScreenNavigator/Runtime/Core/Modal/ModalPushContext.cs Provided a push context structure for modal transitions.
Assets/UnityScreenNavigator/Runtime/Core/Modal/ModalPopContext.cs Provided a pop context structure for modal transitions.
Assets/UnityScreenNavigator/Runtime/Core/Modal/ModalLifecycleHandler.cs Refactored modal lifecycle management including backdrop handling.
Assets/Demo/Core/Scripts/Presentation/Loading/LoadingPagePresenter.cs Updated LoadingPagePresenter to introduce a one-frame wait before calling the home loading page shown callback.
Files not reviewed (9)
  • Assets/Demo/Core/DemoEntryPoint.unity: Language not supported
  • Assets/UnityScreenNavigator/Runtime/Core/Modal/ModalLifecycleHandler.cs.meta: Language not supported
  • Assets/UnityScreenNavigator/Runtime/Core/Modal/ModalPopContext.cs.meta: Language not supported
  • Assets/UnityScreenNavigator/Runtime/Core/Modal/ModalPushContext.cs.meta: Language not supported
  • Assets/UnityScreenNavigator/Runtime/Core/Page/PageLifecycleHandler.cs.meta: Language not supported
  • Assets/UnityScreenNavigator/Runtime/Core/Page/PagePopContext.cs.meta: Language not supported
  • Assets/UnityScreenNavigator/Runtime/Core/Page/PagePushContext.cs.meta: Language not supported
  • Assets/UnityScreenNavigator/Runtime/Core/Shared/IScreenContainer.cs.meta: Language not supported
  • Assets/UnityScreenNavigator/Runtime/Core/Shared/ScreenContainerTransitionHandler.cs.meta: Language not supported

{
view.StartCoroutine(WaitAndCallHomeLoadingPageShown());
}

Copy link

Copilot AI May 5, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider adding a comment explaining why waiting one frame (via WaitAndCallHomeLoadingPageShown) is necessary before invoking the HomeLoadingPageShown callback.

Suggested change
// This coroutine waits for one frame before invoking the HomeLoadingPageShown callback.
// The delay ensures that any pending UI updates or state changes are completed
// before the callback is triggered, preventing potential race conditions or errors.

Copilot uses AI. Check for mistakes.
@Haruma-K Haruma-K merged commit 8261008 into master May 5, 2025
1 check 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