Modern Apps git

← Modern-Apps.git

openassistant: convert raw Scaffolds to shared scaffolds

Commit
fe2fae002dacb4911eb3cb2831a7d8db7ebc8c1b
Author
vayun-mathur <[email protected]>
When
2026-08-16 03:39 UTC (3 months ago)
Parents
ac558d1
ChatScreen -> AppScaffold (center-aligned bold title, actions, conditional
conversations menu navigationIcon, input row as bottomBar; under MainNavigation,
no imePadding added). SettingsScreen -> DetailLazyColumn (back nav + backup
actions). Removes ad-hoc double-padding.

Diff

openassistant/src/main/java/com/vayunmathur/openassistant/ui/LiteRTChatUi.kt
diff --git a/openassistant/src/main/java/com/vayunmathur/openassistant/ui/LiteRTChatUi.kt b/openassistant/src/main/java/com/vayunmathur/openassistant/ui/LiteRTChatUi.ktindex 76b4c7b594..29cc80b7c3 100644--- a/openassistant/src/main/java/com/vayunmathur/openassistant/ui/LiteRTChatUi.kt+++ b/openassistant/src/main/java/com/vayunmathur/openassistant/ui/LiteRTChatUi.kt@@ -229,19 +229,18 @@ fun ChatScreen(         if (state.messages.isNotEmpty()) listState.animateScrollToItem(state.messages.size - 1)     } -    Scaffold(-        snackbarHost = { SnackbarHost(snackbarHostState) },-        topBar = {+    AppScaffold(+        title = {             val newConv = stringResource(R.string.new_conversation)-            CenterAlignedTopAppBar(-                title = { Text(state.title ?: newConv, fontWeight = FontWeight.Bold) },-                actions = {-                    IconButton({ actions.openSettings() }) { IconSettings() }-                    if (state.showNewChatButton) IconButton({ actions.newConversation() }) { IconAdd() }-                },-                navigationIcon = { if (state.showConversationsButton) IconButton({ actions.openConversations() }) { IconMenu() } }-            )+            Text(state.title ?: newConv, fontWeight = FontWeight.Bold)+        },+        alignment = AppBarAlignment.Center,+        actions = {+            IconButton({ actions.openSettings() }) { IconSettings() }+            if (state.showNewChatButton) IconButton({ actions.newConversation() }) { IconAdd() }         },+        navigationIcon = { if (state.showConversationsButton) IconButton({ actions.openConversations() }) { IconMenu() } },+        snackbarHost = { SnackbarHost(snackbarHostState) },         bottomBar = {             ChatInput(                 Modifier.padding(bottom = WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding()),@@ -255,7 +254,7 @@ fun ChatScreen(                 onCancelMedia = { actions.cancelMedia() },                 onRemoveImage = { actions.removeImage(it) }             )-        }+        },     ) { padding ->         SelectionContainer {             LazyColumn(state = listState, modifier = Modifier.padding(padding).fillMaxSize(), contentPadding = PaddingValues(16.dp), verticalArrangement = Arrangement.spacedBy(16.dp)) {
openassistant/src/main/java/com/vayunmathur/openassistant/ui/SettingsPage.kt
diff --git a/openassistant/src/main/java/com/vayunmathur/openassistant/ui/SettingsPage.kt b/openassistant/src/main/java/com/vayunmathur/openassistant/ui/SettingsPage.ktindex 0792f49ff5..0f751a19d9 100644--- a/openassistant/src/main/java/com/vayunmathur/openassistant/ui/SettingsPage.kt+++ b/openassistant/src/main/java/com/vayunmathur/openassistant/ui/SettingsPage.kt@@ -1,7 +1,6 @@ package com.vayunmathur.openassistant.ui  import androidx.compose.foundation.layout.*-import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import com.vayunmathur.library.ui.* import androidx.compose.runtime.*@@ -12,7 +11,6 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import com.vayunmathur.library.ui.BackupButtons-import com.vayunmathur.library.ui.IconNavigation import com.vayunmathur.library.ui.IconDelete import com.vayunmathur.library.room.SqlCipherDbCodec import com.vayunmathur.library.util.DatabaseHelper@@ -88,24 +86,11 @@ fun SettingsScreen( ) {     val memories = state.memories -    Scaffold(-        topBar = {-            TopAppBar(-                title = { Text(stringResource(R.string.settings_title)) },-                navigationIcon = {-                    IconNavigation { actions.back() }-                },-                actions = backupButtons-            )-        }-    ) { padding ->-        LazyColumn(-            modifier = Modifier-                .padding(padding)-                .fillMaxSize(),-            contentPadding = PaddingValues(16.dp),-            verticalArrangement = Arrangement.spacedBy(8.dp)-        ) {+    DetailLazyColumn(+        title = stringResource(R.string.settings_title),+        onNavigateBack = { actions.back() },+        actions = backupButtons,+    ) {             item {                 Text(                     text = stringResource(R.string.system_prompt),@@ -154,7 +139,6 @@ fun SettingsScreen(                     MemoryItem(memory, onDelete = { actions.deleteMemory(memory) })                 }             }-        }     } }