refactor: remove verified dead code across data, UI, and resources (#680)
* refactor: remove unused dead code across data, UI, and resources * fix: resolve dangling references left by dead-code removal Restore empty object Motion (braces required) and remove the 12 stale test usages that still called the now-deleted production symbols: - ServerStoreTest: removeServer/switchToServer tests - ServerEndpointTest: isCleartext assertions - ConnectViewModelTest: onHostChange/onPortChange tests + 3 dropped R.string refs - SettingsViewModelTest: renameProfile tests + clearNavigateToLogin - E2eIntegrationTest: previewSkill tests + onHostChange/onPortChange calls Verified locally: compileDebugUnitTestKotlin + 48 tests pass. * fix: remove unused imports flagged by ktlint Drops 4 no-longer-referenced imports left by the dead-code removal: - HermesApiService: SkillScanResponse (scanHubSkill removed) - ServerEndpointTest: assertFalse, assertTrue (isCleartext assertions dropped) - SettingsViewModelTest: assertFalse (rename tests removed) --------- Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
1 parent
58420d7b2a
commit
2e97ee9a84
29 files changed
+10
-550
No files matched your search
@@ -234,10 +234,6 @@ class SessionsViewModel : ViewModel(), ToastHost {
|
||||
}
|
||||
}
|
||||
|
||||
fun exitSelecting() {
|
||||
_uiState.update { it.copy(isSelecting = false, selectedIds = emptySet()) }
|
||||
}
|
||||
|
||||
fun toggleSessionSelection(id: String) {
|
||||
_uiState.update {
|
||||
val updated = it.selectedIds.toMutableSet()
|
||||
@@ -258,14 +254,6 @@ class SessionsViewModel : ViewModel(), ToastHost {
|
||||
|
||||
// ── Rename ───────────────────────────────────────────────────────────
|
||||
|
||||
fun startRenaming(sessionId: String) {
|
||||
_uiState.update { it.copy(renamingSessionId = sessionId) }
|
||||
}
|
||||
|
||||
fun cancelRenaming() {
|
||||
_uiState.update { it.copy(renamingSessionId = null) }
|
||||
}
|
||||
|
||||
fun renameSession(
|
||||
sessionId: String,
|
||||
newTitle: String,
|
||||
@@ -308,27 +296,6 @@ class SessionsViewModel : ViewModel(), ToastHost {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Copy prompt ──────────────────────────────────────────────────────
|
||||
|
||||
fun copySessionPrompt(sessionId: String) {
|
||||
viewModelScope.launch {
|
||||
val result =
|
||||
safeApiCall {
|
||||
ApiClient.hermesApi.getSessionPrompt(sessionId)
|
||||
}
|
||||
when (result) {
|
||||
is NetworkResult.Success -> {
|
||||
val promptText = result.data.prompt ?: "No prompt available"
|
||||
_uiState.update { it.copy(toastMessage = promptText) }
|
||||
}
|
||||
|
||||
is NetworkResult.Failure -> {
|
||||
_uiState.update { it.copy(toastMessage = "Failed to get prompt: ${result.error.message}") }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ── Delete (single) ──────────────────────────────────────────────────
|
||||
|
||||
fun requestDeleteSession(sessionId: String) {
|
||||
|
||||
Reference in new issue
Block a user