ready to merge and ready to discard as states
This commit is contained in:
@@ -183,11 +183,11 @@ final class SwitcherModel {
|
||||
}
|
||||
.enumerated()
|
||||
.map { i, row in
|
||||
(i: i, project: row.project, task: row.task, count: store.inbox.filter { $0.taskId == row.task.id }.count, visited: row.task.id == store.selectedTaskId ? Double.infinity : visits[row.task.id] ?? 0)
|
||||
(i: i, project: row.project, task: row.task, count: store.inbox.filter { $0.taskId == row.task.id }.count, rank: store.taskRank(row.task), visited: row.task.id == store.selectedTaskId ? Double.infinity : visits[row.task.id] ?? 0)
|
||||
}
|
||||
.sorted { a, b in
|
||||
if (a.count > 0) != (b.count > 0) {
|
||||
return a.count > 0
|
||||
if a.rank != b.rank {
|
||||
return a.rank < b.rank
|
||||
}
|
||||
if a.visited != b.visited {
|
||||
return a.visited < b.visited
|
||||
@@ -409,7 +409,7 @@ private struct SwitcherRowView: View {
|
||||
case .task(let project, let task, let count):
|
||||
let ts = store.taskState(task)
|
||||
let color = taskPalette[task.color]
|
||||
StateDot(filled: ts.kind == .working || ts.kind == .merging ? Palette.ok : ts.kind == .answer ? Palette.warn : nil)
|
||||
StateDot(filled: ts.kind == .working || ts.kind == .merging ? Palette.ok : ts.needsYou ? Palette.warn : nil)
|
||||
.help(ts.title)
|
||||
Text(taskTitle(project, task, color))
|
||||
.lineLimit(1)
|
||||
@@ -427,7 +427,7 @@ private struct SwitcherRowView: View {
|
||||
}
|
||||
Text(ts.label)
|
||||
.font(Fonts.font(11))
|
||||
.foregroundStyle(ts.kind == .answer ? Palette.warn : Palette.muted)
|
||||
.foregroundStyle(ts.needsYou ? Palette.warn : Palette.muted)
|
||||
.help(ts.title)
|
||||
case .project(let p):
|
||||
StateDot(filled: nil)
|
||||
|
||||
Reference in New Issue
Block a user