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:
41
macos/Sources/FailWell/Models/TaskRecord.swift
Normal file
41
macos/Sources/FailWell/Models/TaskRecord.swift
Normal file
@@ -0,0 +1,41 @@
|
||||
import Foundation
|
||||
|
||||
struct TaskRecord: Codable, Hashable, Sendable {
|
||||
let taskId: String
|
||||
var start: Date
|
||||
var end: Date?
|
||||
var stepRecords: [String: TimeRange]
|
||||
var notes: String
|
||||
var breakTime: TimeRange?
|
||||
var currentStepId: String?
|
||||
|
||||
init(
|
||||
taskId: String,
|
||||
start: Date = Date(),
|
||||
end: Date? = nil,
|
||||
stepRecords: [String: TimeRange] = [:],
|
||||
notes: String = "",
|
||||
breakTime: TimeRange? = nil,
|
||||
currentStepId: String? = nil
|
||||
) {
|
||||
self.taskId = taskId
|
||||
self.start = start
|
||||
self.end = end
|
||||
self.stepRecords = stepRecords
|
||||
self.notes = notes
|
||||
self.breakTime = breakTime
|
||||
self.currentStepId = currentStepId
|
||||
}
|
||||
|
||||
var isActive: Bool {
|
||||
end == nil && currentStepId != nil
|
||||
}
|
||||
|
||||
var isPaused: Bool {
|
||||
breakTime != nil && breakTime?.end == nil
|
||||
}
|
||||
|
||||
var hasStarted: Bool {
|
||||
!stepRecords.isEmpty
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user