diff --git a/src/main/kotlin/app/git/StatusManager.kt b/src/main/kotlin/app/git/StatusManager.kt index f6317db..8140e40 100644 --- a/src/main/kotlin/app/git/StatusManager.kt +++ b/src/main/kotlin/app/git/StatusManager.kt @@ -292,11 +292,13 @@ class StatusManager @Inject constructor( val addedCount = changesGrouped[StatusType.ADDED].countOrZero() val modifiedCount = changesGrouped[StatusType.MODIFIED].countOrZero() + val conflictingCount = changesGrouped[StatusType.CONFLICTING].countOrZero() return StatusSummary( modifiedCount = modifiedCount, deletedCount = deletedCount, addedCount = addedCount, + conflictingCount = conflictingCount, ) } @@ -338,4 +340,14 @@ enum class StatusType { CONFLICTING, } -data class StatusSummary(val modifiedCount: Int, val deletedCount: Int, val addedCount: Int) \ No newline at end of file +data class StatusSummary( + val modifiedCount: Int, + val deletedCount: Int, + val addedCount: Int, + val conflictingCount: Int, +) { + val total = modifiedCount + + deletedCount + + addedCount + + conflictingCount +} \ No newline at end of file diff --git a/src/main/kotlin/app/ui/log/Log.kt b/src/main/kotlin/app/ui/log/Log.kt index 424261c..cc0395e 100644 --- a/src/main/kotlin/app/ui/log/Log.kt +++ b/src/main/kotlin/app/ui/log/Log.kt @@ -590,6 +590,14 @@ fun LogStatusSummary(statusSummary: StatusSummary, modifier: Modifier) { color = MaterialTheme.colors.deleteFile, ) } + + if (statusSummary.conflictingCount > 0) { + SummaryEntry( + count = statusSummary.conflictingCount, + icon = Icons.Default.Warning, + color = MaterialTheme.colors.conflictFile, + ) + } } } diff --git a/src/main/kotlin/app/viewmodels/LogViewModel.kt b/src/main/kotlin/app/viewmodels/LogViewModel.kt index 29adabd..04a574f 100644 --- a/src/main/kotlin/app/viewmodels/LogViewModel.kt +++ b/src/main/kotlin/app/viewmodels/LogViewModel.kt @@ -58,8 +58,7 @@ class LogViewModel @Inject constructor( git = git, ) - val hasUncommitedChanges = - statusSummary.addedCount + statusSummary.deletedCount + statusSummary.modifiedCount > 0 + val hasUncommitedChanges = statusSummary.total > 0 val log = logManager.loadLog(git, currentBranch, hasUncommitedChanges) _logStatus.value = LogStatus.Loaded(hasUncommitedChanges, log, currentBranch, statusSummary) @@ -162,7 +161,7 @@ class LogViewModel @Inject constructor( git = git, ) } else - StatusSummary(0, 0, 0) + StatusSummary(0, 0, 0, 0) val previousLogStatusValue = _logStatus.value