git.iko.soy/opencode-android
on master help sign in
Stop failed-send draft clobber, scroll chat to newest on open, drop deprecated statusBarColor
commit6f4f52ce1ffd824f0abe528d7730f37e925316c1 authoriko <mail@iko.soy> dateMon 29 Jun 2026, 14:19 (3 months ago) parent80ddf73
3 files changed+8−3
app/src/main/java/soy/iko/opencode/ui/chat/ChatScreen.kt+6 app/src/main/java/soy/iko/opencode/ui/chat/ChatViewModel.kt+2−1 app/src/main/java/soy/iko/opencode/ui/theme/Theme.kt−2
app/src/main/java/soy/iko/opencode/ui/chat/ChatScreen.kt+6
@@ -150,6 +150,12 @@ fun ChatScreen(
150150 }
151151 }
152152
153+ // Jump to the latest message when the conversation first loads so the user
154+ // lands on recent context, not the oldest.
155+ LaunchedEffect(messages.isNotEmpty()) {
156+ if (messages.isNotEmpty()) listState.scrollToItem(messages.lastIndex)
157+ }
158+
153159 // Keep the newest content in view as parts stream in — only if already at the bottom.
154160 // Include the growing text length so we follow streaming within a single part, not
155161 // only when a brand-new message or part is added.
app/src/main/java/soy/iko/opencode/ui/chat/ChatViewModel.kt+2−1
@@ -209,7 +209,8 @@ class ChatViewModel(
209209 _running.value = false
210210 if (!ok) {
211211 _failedDraft.value = trimmed
212− updateDraft(trimmed)
212+ // Only restore the draft if the user hasn't typed anything new since.
213+ if (_draft.value.isBlank()) updateDraft(trimmed)
213214 _error.value = container.string(R.string.error_failed_to_send)
214215 }
215216 }
app/src/main/java/soy/iko/opencode/ui/theme/Theme.kt−2
@@ -11,7 +11,6 @@ import androidx.compose.material3.lightColorScheme
1111import androidx.compose.runtime.Composable
1212import androidx.compose.runtime.SideEffect
1313import androidx.compose.ui.graphics.Color
14−import androidx.compose.ui.graphics.toArgb
1514import androidx.compose.ui.platform.LocalContext
1615import androidx.compose.ui.platform.LocalView
1716import androidx.core.view.WindowCompat
@@ -47,7 +46,6 @@ fun OpencodeTheme(
4746 if (!view.isInEditMode) {
4847 SideEffect {
4948 val window = (view.context as Activity).window
50− window.statusBarColor = colorScheme.background.toArgb()
5149 WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme
5250 }
5351 }