nit: minor UI patch; add missing comments

This commit is contained in:
Han Yin 2025-07-08 13:06:16 -07:00
parent 6f901e5203
commit 5b7619f000
3 changed files with 8 additions and 6 deletions

View File

@ -126,7 +126,7 @@ fun ModelSelectionScreen(
) { ) {
if (queryResults.isEmpty()) { if (queryResults.isEmpty()) {
if (searchQuery.isNotBlank()) { if (searchQuery.isNotBlank()) {
// Show "no results" message // If no results under current query, show "no results" message
EmptySearchResultsView( EmptySearchResultsView(
onClearSearch = { onClearSearch = {
textFieldState.clearText() textFieldState.clearText()
@ -136,7 +136,7 @@ fun ModelSelectionScreen(
} }
} else { } else {
LazyColumn( LazyColumn(
Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.spacedBy(12.dp), verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(vertical = 12.dp, horizontal = 16.dp), contentPadding = PaddingValues(vertical = 12.dp, horizontal = 16.dp),
) { ) {
@ -164,8 +164,10 @@ fun ModelSelectionScreen(
} }
} else { } else {
if (filteredModels.isEmpty()) { if (filteredModels.isEmpty()) {
// Empty model prompt
EmptyModelsView(activeFiltersCount, onManageModelsClicked) EmptyModelsView(activeFiltersCount, onManageModelsClicked)
} else { } else {
// Model cards
LazyColumn( LazyColumn(
Modifier.fillMaxSize(), // .padding(horizontal = 16.dp), Modifier.fillMaxSize(), // .padding(horizontal = 16.dp),
verticalArrangement = Arrangement.spacedBy(12.dp), verticalArrangement = Arrangement.spacedBy(12.dp),

View File

@ -108,6 +108,7 @@ fun ModelsManagementScreen(
Box(modifier = Modifier.fillMaxSize()) { Box(modifier = Modifier.fillMaxSize()) {
if (filteredModels.isEmpty()) { if (filteredModels.isEmpty()) {
// Import model prompt
val message = when (activeFiltersCount) { val message = when (activeFiltersCount) {
0 -> "Tap the \"+\" button to import a model!" 0 -> "Tap the \"+\" button to import a model!"
1 -> "No models match the selected filter" 1 -> "No models match the selected filter"
@ -121,10 +122,9 @@ fun ModelsManagementScreen(
} else { } else {
// Model cards // Model cards
LazyColumn( LazyColumn(
modifier = Modifier modifier = Modifier.fillMaxSize(),
.fillMaxSize()
.padding(horizontal = 16.dp),
verticalArrangement = Arrangement.spacedBy(12.dp), verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(vertical = 12.dp, horizontal = 16.dp),
) { ) {
items(items = filteredModels, key = { it.id }) { model -> items(items = filteredModels, key = { it.id }) { model ->
val isSelected = val isSelected =

View File

@ -43,7 +43,7 @@ class ConversationViewModel @Inject constructor(
// UI state: Input text field // UI state: Input text field
val inputFieldState = TextFieldState() val inputFieldState = TextFieldState()
// Token generation job // Ongoing coroutine jobs
private var tokenCollectionJob: Job? = null private var tokenCollectionJob: Job? = null
/** /**