Refactor: Consolidate navigation items into ScreenRegistry (#310)
* Refactor: Consolidate navigation items into ScreenRegistry * fix(#310): remove unused imports, fix ktlint import ordering * feat(#289): add ScreenRegistry for centralized screen configuration * fix(#310): fix ktlint when-condition blank lines in Navigation.kt * fix(#289): derive availableNavItems from ScreenRegistry * fix(#310): use addEntryProvider instead of reified entry for dynamic screen registration * fix(#310): remove double top padding from kanban, channels, achievements screens --------- Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
1 parent
c1af989220
commit
740b4fe601
6 files changed
+225
-323
No files matched your search
@@ -2,7 +2,7 @@ package com.m57.hermescontrol.ui.settings
|
||||
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.m57.hermescontrol.R
|
||||
import com.m57.hermescontrol.ScreenRegistry
|
||||
import com.m57.hermescontrol.data.local.AuthManager
|
||||
import com.m57.hermescontrol.data.remote.ApiClient
|
||||
import com.m57.hermescontrol.data.remote.NetworkResult
|
||||
@@ -163,28 +163,9 @@ class SettingsViewModel : ViewModel() {
|
||||
|
||||
/** All screens available for bottom-nav selection (name → display label). */
|
||||
val availableNavItems: List<Pair<String, Int>> =
|
||||
listOf(
|
||||
"ChatScreen" to R.string.screen_chat,
|
||||
"SkillsScreen" to R.string.screen_skills,
|
||||
"CronJobsScreen" to R.string.screen_cron,
|
||||
"SystemScreen" to R.string.screen_system,
|
||||
"SettingsScreen" to R.string.screen_settings,
|
||||
"ProfilesScreen" to R.string.screen_profiles,
|
||||
"WebhooksScreen" to R.string.screen_webhooks,
|
||||
"GatewayScreen" to R.string.screen_gateway,
|
||||
"HistoryScreen" to R.string.screen_history,
|
||||
"ToolsetsScreen" to R.string.screen_toolsets,
|
||||
"PluginsScreen" to R.string.screen_plugins,
|
||||
"ConfigScreen" to R.string.screen_config,
|
||||
"McpServersScreen" to R.string.screen_mcp_servers,
|
||||
"ModelScreen" to R.string.screen_models,
|
||||
"PairingScreen" to R.string.screen_pairing,
|
||||
"KeysScreen" to R.string.screen_keys,
|
||||
"ChannelsScreen" to R.string.screen_channels,
|
||||
"LogsScreen" to R.string.screen_logs,
|
||||
"KanbanScreen" to R.string.screen_kanban,
|
||||
"AchievementsScreen" to R.string.screen_achievements,
|
||||
)
|
||||
ScreenRegistry.ALL_SCREENS.map { screen ->
|
||||
screen.key::class.simpleName!! to screen.labelRes
|
||||
}
|
||||
|
||||
/** Add a nav item to the bottom bar (max 5). Auto-saves. */
|
||||
fun addNavItem(name: String) {
|
||||
|
||||
Reference in new issue
Block a user