From b30df3967ccb62b51f5cca3aea3478519abce45d Mon Sep 17 00:00:00 2001 From: Owm Date: Sun, 18 Oct 2026 22:49:05 +0530 Subject: [PATCH] tutorial_rotation Signed-off-by: Owm --- CHANGELOG.md | 1 + .../java/be/scri/ui/screens/tutorial/TutorialStepScreen.kt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b6f195bb..c5ce1ee56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -89,6 +89,7 @@ Emojis for the following are chosen based on [gitmoji](https://gitmoji.dev/). - The keyboard service no longer crashes when an editor starts input with no `EditorInfo` ([#699](https://github.com/scribe-org/Scribe-Android/issues/699)). - Downloading or checking for language data updates no longer crashes the app when the server returns a malformed timestamp ([#700](https://github.com/scribe-org/Scribe-Android/issues/700)). - Native dictionaries are re-extracted after an app update so autosuggestions no longer use dictionaries from a previous install ([#701](https://github.com/scribe-org/Scribe-Android/issues/701)). +- Tutorial practice text is now preserved across configuration changes such as device rotation ([#736](https://github.com/scribe-org/Scribe-Android/issues/736)). ### 🔒 Security diff --git a/app/src/main/java/be/scri/ui/screens/tutorial/TutorialStepScreen.kt b/app/src/main/java/be/scri/ui/screens/tutorial/TutorialStepScreen.kt index b794b2f56..3d6ae2ccb 100644 --- a/app/src/main/java/be/scri/ui/screens/tutorial/TutorialStepScreen.kt +++ b/app/src/main/java/be/scri/ui/screens/tutorial/TutorialStepScreen.kt @@ -35,6 +35,7 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember +import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -167,7 +168,7 @@ fun TutorialStepScreen( val successColor = if (isDarkTheme) Color(0xFF08A045) else Color(0xFF9BC53D) val errorColor = Color(0xFFE53935) - var userInput by remember(step) { mutableStateOf("") } + var userInput by rememberSaveable(step) { mutableStateOf("") } val validationState = when {