Skip to content

Comments

Added SavedStateController across platforms to support default ViewModelProviderFactory#2554

Merged
terrakok merged 17 commits intojb-mainfrom
CMP-6641
Nov 10, 2025
Merged

Added SavedStateController across platforms to support default ViewModelProviderFactory#2554
terrakok merged 17 commits intojb-mainfrom
CMP-6641

Conversation

@terrakok
Copy link
Member

@terrakok terrakok commented Nov 5, 2025

Implement HasDefaultViewModelProviderFactory across platforms.

Fixes https://youtrack.jetbrains.com/issue/CMP-6641

Release Notes

Fixes - SavedState

  • All platforms have HasDefaultViewModelProviderFactory implementation now, and it provides an ability to use createSavedStateHandle() function without a navigation library.

Introduced SavedStateRegistry integration to handle the state saving/restoration mechanism across platforms. This includes support for `SavedStateRegistryOwner` in Skiko, UIKit, and Desktop implementations.
…ecycle.State` updates via `ViewControllerLifecycleDelegate` and `SavedStateRegistry` support in `UIKitArchitectureComponentsOwner`.
…ved state management across platforms. Replaced platform-specific implementations with `DefaultArchitectureComponentsOwner`.
…omponentsOwner` in lifecycle-related tests
Refactored `DefaultArchitectureComponentsOwner` methods to replace direct lifecycle event handling with `initSavedStateController` and `onLifecycleState` calls. Added state saving logic during scene closure.
… and consistency across lifecycle state handling. Update references in tests and related files.
… in constructor. Remove redundant `initSavedStateController` calls across platforms. Update tests and related files for consistency.
…or consistency with lifecycle dependencies
Copy link
Member

@MatkovIvan MatkovIvan left a comment

Choose a reason for hiding this comment

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

LGTM in general, just a few minor nitpicks + a need for more tests

GraphicsComponents,
Screen.Example("Example1") { Example1() },
Screen.Example("ImageViewer") { ImageViewer() },
Screen.Example("ViewModelExample") { ViewModelExample() },
Copy link
Member

Choose a reason for hiding this comment

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

Since the sample is inside NavHost I suspect that it works even without this fix

@terrakok terrakok merged commit e2447f1 into jb-main Nov 10, 2025
15 checks passed
@terrakok terrakok deleted the CMP-6641 branch November 10, 2025 22:40
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.

3 participants