nit: polish ModelLoadingScreen UI
This commit is contained in:
parent
1d508f367e
commit
f313362ced
|
|
@ -62,8 +62,8 @@ enum class Mode {
|
||||||
CONVERSATION
|
CONVERSATION
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class SystemPromptTab {
|
enum class SystemPromptTab(val label: String) {
|
||||||
PRESETS, CUSTOM, RECENTS
|
PRESETS("Presets"), CUSTOM("Custom"), RECENTS("Recents")
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class)
|
@OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class)
|
||||||
|
|
@ -106,9 +106,7 @@ fun ModelLoadingScreen(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if we're in a loading state
|
// Check if we're in a loading state
|
||||||
val isLoading = engineState !is State.Uninitialized &&
|
val isLoading = engineState !is State.Initialized && engineState !is State.ModelReady
|
||||||
engineState !is State.Initialized &&
|
|
||||||
engineState !is State.ModelReady
|
|
||||||
|
|
||||||
// Mode selection callbacks
|
// Mode selection callbacks
|
||||||
val handleBenchmarkSelected = {
|
val handleBenchmarkSelected = {
|
||||||
|
|
@ -348,9 +346,9 @@ fun ModelLoadingScreen(
|
||||||
Spacer(modifier = Modifier.width(8.dp))
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
Text(
|
Text(
|
||||||
text = when (engineState) {
|
text = when (engineState) {
|
||||||
|
is State.Initializing, State.Initialized -> "Initializing..."
|
||||||
is State.LoadingModel -> "Loading model..."
|
is State.LoadingModel -> "Loading model..."
|
||||||
is State.ProcessingSystemPrompt -> "Processing system prompt..."
|
is State.ProcessingSystemPrompt -> "Processing system prompt..."
|
||||||
is State.ModelReady -> "Preparing conversation..."
|
|
||||||
else -> "Processing..."
|
else -> "Processing..."
|
||||||
},
|
},
|
||||||
style = MaterialTheme.typography.titleMedium
|
style = MaterialTheme.typography.titleMedium
|
||||||
|
|
@ -394,15 +392,7 @@ private fun SystemPromptTabSelector(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
label = {
|
label = { Text(tab.label) }
|
||||||
Text(
|
|
||||||
when (tab) {
|
|
||||||
SystemPromptTab.PRESETS -> "Presets"
|
|
||||||
SystemPromptTab.CUSTOM -> "Custom"
|
|
||||||
SystemPromptTab.RECENTS -> "Recents"
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue