Skip to content

Commit

Permalink
Todos cleanup (#90)
Browse files Browse the repository at this point in the history
* Remove font todo

* Resolve Timer.Size concerns

- Timer.Size is used as an accessibility id for timer buttons, and to map timer length settings to the appropriate timer models

* Tag core data testing todo with #89

* Tag snapshot test todo with #85

* Decide rest setting defaults
  • Loading branch information
isiahmanns authored May 24, 2023
1 parent d3874c0 commit 4427c9b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 26 deletions.
1 change: 0 additions & 1 deletion Hourglass/Hourglass/Data Models/TimerModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ extension Timer {
}
}

// TODO: - May not be needed
enum Size {
case small
case medium
Expand Down
24 changes: 6 additions & 18 deletions Hourglass/Hourglass/Managers/DataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,12 @@ class DataManager: DataManaging {
store: CoreDataStore,
timerEventProvider: TimerEventProviding) {
let timerModels = [
Timer.Model(length: settingsManager.getTimerLength(for: .timerFocusSmall),
category: .focus,
size: .small),
Timer.Model(length: settingsManager.getTimerLength(for: .timerFocusMedium),
category: .focus,
size: .medium),
Timer.Model(length: settingsManager.getTimerLength(for: .timerFocusLarge),
category: .focus,
size: .large),
Timer.Model(length: settingsManager.getTimerLength(for: .timerRestSmall),
category: .rest,
size: .small),
Timer.Model(length: settingsManager.getTimerLength(for: .timerRestMedium),
category: .rest,
size: .medium),
Timer.Model(length: settingsManager.getTimerLength(for: .timerRestLarge),
category: .rest,
size: .large)
Timer.Model(length: settingsManager.getTimerLength(for: .timerFocusSmall), category: .focus, size: .small),
Timer.Model(length: settingsManager.getTimerLength(for: .timerFocusMedium), category: .focus, size: .medium),
Timer.Model(length: settingsManager.getTimerLength(for: .timerFocusLarge), category: .focus, size: .large),
Timer.Model(length: settingsManager.getTimerLength(for: .timerRestSmall), category: .rest, size: .small),
Timer.Model(length: settingsManager.getTimerLength(for: .timerRestMedium), category: .rest, size: .medium),
Timer.Model(length: settingsManager.getTimerLength(for: .timerRestLarge), category: .rest, size: .large)
]

self.init(timerModels: timerModels,
Expand Down
1 change: 0 additions & 1 deletion Hourglass/Hourglass/Managers/TimerModelStateManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ class TimerModelStateManager {
}

private func configureSettingsObservations() {
// TODO: - Sort by length and use array indices, to match UI logic
let focusTimers = timerModels.filterByCategory(.focus)
let restTimers = timerModels.filterByCategory(.rest)

Expand Down
3 changes: 1 addition & 2 deletions Hourglass/Hourglass/Utilities/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ enum Constants {
static let timerRestLarge = 20

// Timer threshold defaults
// TODO: - Decide these values!
static let restWarningThreshold: Int = 15
static let restWarningThreshold: Int = 30
static let enforceRestThreshold: Int = -1
static let getBackToWorkIsEnabled: Bool = false

Expand Down
2 changes: 1 addition & 1 deletion Hourglass/Hourglass/Views/AboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct AboutView: View {
VStack(alignment: .leading, spacing: 20) {
VStack(alignment: .leading, spacing: 0) {
Text("Hourglass")
.font(.poppins) // TODO: - Rename API with sizes
.font(.poppins)
Text("Version 1.0")
}

Expand Down
3 changes: 1 addition & 2 deletions Hourglass/Hourglass/Views/StatisticsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct StatisticsView: View {

var body: some View {
let timeChunks: [TimeBlock.Chunk] = timeBlocks.flatMap(\.chunks)
// TODO: - Write snapshot tests using test data sets
// TODO: - Write snapshot tests using test data sets (#89)
//let timeChunks = [TimeBlock.Chunk]()
//let timeChunks = TestData.timeChunks
//let timeChunks = Array(TestData.timeChunks.prefix(25))
Expand Down Expand Up @@ -307,7 +307,6 @@ private extension TimeBlock {
Calendar.current.dateComponents([.year, .month, .day, .hour, .minute, .second], from: end!)
}

// TODO: - Test this with Core Data
var doesIncludeNextDay: Bool {
startDate.day! < endDate.day!
}
Expand Down
2 changes: 1 addition & 1 deletion Hourglass/HourglassTests/ViewModelTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import XCTest
@testable import Hourglass

// TODO: - Snapshot test is a better solution to create a state for the button and verify its appearance pixel for pixel.
// TODO: - Snapshot tests to validate timer button state pixel for pixel. (#85)

final class ViewModelTests: XCTestCase {

Expand Down

0 comments on commit 4427c9b

Please sign in to comment.