Files
failwell/macos/Sources/FailWell/Views/Router.swift
Julien Calixte 29a71a73b2 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.
2026-05-15 11:27:51 +02:00

38 lines
725 B
Swift

import Foundation
import Observation
@MainActor
@Observable
final class Router {
enum Screen: Hashable, Sendable {
case list
case detail(taskId: String)
case editor(taskId: String?)
case record(taskId: String)
case history(taskId: String)
case settings
}
var stack: [Screen] = [.list]
var showPalette: Bool = false
var current: Screen { stack.last ?? .list }
func push(_ screen: Screen) {
stack.append(screen)
}
func replace(with screen: Screen) {
stack = [screen]
}
func pop() {
guard stack.count > 1 else { return }
stack.removeLast()
}
func popToRoot() {
stack = [.list]
}
}