Skip to content

Commit 1de381b

Browse files
authored
Merge pull request #37 from aapis/feature/ux-updates
Small UX updates
2 parents 7662cb1 + af6d536 commit 1de381b

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

KlockWork-iOS/KlockWork-iOS.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@
817817
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
818818
CODE_SIGN_ENTITLEMENTS = "KlockWork-iOS/KlockWork_iOS.entitlements";
819819
CODE_SIGN_STYLE = Automatic;
820-
CURRENT_PROJECT_VERSION = 15;
820+
CURRENT_PROJECT_VERSION = 16;
821821
DEAD_CODE_STRIPPING = YES;
822822
DEVELOPMENT_ASSET_PATHS = "\"KlockWork-iOS/Preview Content\"";
823823
DEVELOPMENT_TEAM = 6DT7L2N5X6;
@@ -859,7 +859,7 @@
859859
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
860860
CODE_SIGN_ENTITLEMENTS = "KlockWork-iOS/KlockWork_iOS.entitlements";
861861
CODE_SIGN_STYLE = Automatic;
862-
CURRENT_PROJECT_VERSION = 15;
862+
CURRENT_PROJECT_VERSION = 16;
863863
DEAD_CODE_STRIPPING = YES;
864864
DEVELOPMENT_ASSET_PATHS = "\"KlockWork-iOS/Preview Content\"";
865865
DEVELOPMENT_TEAM = 6DT7L2N5X6;

KlockWork-iOS/KlockWork-iOS/Entities/Filter/RecordFilter.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ extension RecordFilter {
7171
if self.records.count > 0 {
7272
let sortedRecords = Array(self.records)
7373
.sliced(by: [.year, .month, .day], for: \.timestamp!)
74-
.sorted(by: {$0.key < $1.key})
74+
.sorted(by: {$0.key > $1.key})
7575
let grouped = Dictionary(grouping: sortedRecords, by: {$0.key})
7676

7777
for group in grouped {

KlockWork-iOS/KlockWork-iOS/SharedViews/Tabs.swift

+12-3
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,11 @@ extension Tabs.Content {
537537
Rectangle()
538538
.foregroundStyle(Color.fromStored(self.entity.project?.colour ?? Theme.rowColourAsDouble))
539539
.frame(width: 15)
540-
Rectangle()
541-
.foregroundStyle(Color.fromStored(self.entity.colour ?? Theme.rowColourAsDouble))
542-
.frame(width: 15)
540+
if self.records.isEmpty {
541+
Rectangle()
542+
.foregroundStyle(Color.fromStored(self.entity.colour ?? Theme.rowColourAsDouble))
543+
.frame(width: 15)
544+
}
543545

544546
HStack(spacing: 0) {
545547
if self.records.isEmpty {
@@ -994,6 +996,7 @@ extension Tabs.Content {
994996
}
995997

996998
struct SingleTaskChecklistItem: View {
999+
@EnvironmentObject private var state: AppState
9971000
public let task: LogTask
9981001
@State private var isCompleted: Bool = false
9991002
@State private var isCancelled: Bool = false
@@ -1038,12 +1041,18 @@ extension Tabs.Content {
10381041
private func actionOnSave() -> Void {
10391042
if self.isCompleted {
10401043
self.task.completedDate = Date()
1044+
1045+
// Create a record indicating when the task was completed
1046+
CoreDataTasks(moc: self.state.moc).complete(self.task)
10411047
} else {
10421048
self.task.completedDate = nil
10431049
}
10441050

10451051
if self.isCancelled {
10461052
self.task.cancelledDate = Date()
1053+
1054+
// Create a record indicating when the task was cancelled
1055+
CoreDataTasks(moc: self.state.moc).cancel(self.task)
10471056
} else {
10481057
self.task.cancelledDate = nil
10491058
}

0 commit comments

Comments
 (0)