Skip to content

Feat: rememberSaveableWrapper gives Python Compose's rememberSaveable - #176

Merged
b-re-w merged 1 commit into
developfrom
feat/remember-saveable
Oct 3, 2026
Merged

b-re-w merged 1 commit into
developfrom
feat/remember-saveable

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 3, 2026

Copy link
Copy Markdown
Member

Closes #174

Feature added: python.multiplatform.compose.rememberSaveableWrapper(initial: Any?): MutableState<>, following the original pycomposeui wrapper: Int, Long, Double, Boolean, String go to rememberSaveable { mutableStateOf }; any other type is refused naming it. Called through the binder inside a composition (the binder supplies the composer). pythonx-compose wraps it as remember_saveable with getValue()/setValue()/.value.

Test added: RememberSaveableRenderTest (3): every supported type survives performSave, scene teardown and restore from the saved map; with no registry the recreated scene shows initial values; a Python list is refused naming 'list'. Red before: 3/3 failed. Spec: SPEC B-9.

Verified: compose fixture 123 tests, first run 1 failure in the known intermittent #157 test, then 2 of 2 reruns green; artifact 37/0; :python-multiplatform-compose:compileReleaseKotlinAndroid OK. Core library untouched.

…#174)

As the original pycomposeui did: Int, Long, Double, Boolean and String initial
values go to rememberSaveable { mutable*StateOf }, anything else is refused by
type. Saved values come back through a SaveableStateRegistry. Red before: 3 of 3
RememberSaveableRenderTest failed (No module named 'python.multiplatform.compose').
@b-re-w
b-re-w merged commit 8c56f19 into develop Oct 3, 2026
@b-re-w
b-re-w deleted the feat/remember-saveable branch October 3, 2026 16:43
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.

1 participant