feat(macos): add native menu bar app with notch overlay
Introduces a SwiftUI companion app for the Fail Well PWA: menu bar status item, popover with task list / record / history views, command palette, and a Dynamic Island-style notch overlay that shows the active step and timer beside the hardware notch and expands on hover to reveal pause/next controls.
This commit is contained in:
13
macos/Sources/FailWell/Services/EstimationComparator.swift
Normal file
13
macos/Sources/FailWell/Services/EstimationComparator.swift
Normal file
@@ -0,0 +1,13 @@
|
||||
import Foundation
|
||||
|
||||
enum EstimationComparator {
|
||||
/// Returns `true` when the actual duration deviates from the estimation by more than
|
||||
/// 10 % (with a 1-minute floor for very short steps). Mirrors `is10PercentOffThanEstimation`.
|
||||
static func is10PercentOff(estimation: Double, duration: Double) -> Bool {
|
||||
abs(duration - estimation) > max(estimation * 0.1, 1)
|
||||
}
|
||||
|
||||
static func is10PercentOff(estimation: Int, duration: Int) -> Bool {
|
||||
is10PercentOff(estimation: Double(estimation), duration: Double(duration))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user