Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ enum AgentPaneTheme {
// Static status indicators, or Reduce Motion (cx-sya4n): the page stops its status
// loops and draws a shape per state (`data-status-indicators`).
"statusIndicators": motion.reduceMotion || DesignSettings.shared.statusIndicator.animation == .static ? "static" : "animated",
// How agent work shows on the transcript's running rows (`data-working-look`).
"workingLook": StatusWorkingLook.tunable.value.rawValue,
]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,21 @@ extension MotionGate {
return sweep
}

/// Agent work's breath (1 -> `low` -> 1 over one `breath` period, eased), or nil when loops
/// are off. Slower and softer than the waiting pulse, so a list of working rows reads calm.
public func breathAnimation(low: Float) -> CAAnimation? {
guard let period = period(.breath) else { return nil }
let breath = CABasicAnimation(keyPath: "opacity")
breath.fromValue = 1
breath.toValue = low
breath.duration = period / 2
breath.autoreverses = true
breath.repeatCount = .infinity
breath.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
breath.isRemovedOnCompletion = false
return breath
}

/// An opacity pulse (1 -> `low` -> 1), or nil when loops are off.
public func pulseAnimation(low: Float) -> CAAnimation? {
guard let period = period(.pulse) else { return nil }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public nonisolated enum MotionLoop: String, Sendable, CaseIterable {
case flash
/// Unmeasured progress: a segment crosses its track once.
case sweep
/// Agent work's dot, one breath (bright, dim and back; `StatusWorkingLook.breathe`).
case breath

/// Seconds per period, never under `minimumPeriod` (a Debug Settings
/// override included).
Expand All @@ -82,6 +84,8 @@ public nonisolated enum MotionLoop: String, Sendable, CaseIterable {
case .pulse: Self.shortestFlashCycle
case .flash: Self.shortestFlashCycle * 2
case .sweep: Self.shortestFlashCycle
// A breath is calm: never quicker than one a second.
case .breath: Self.shortestFlashCycle * 2
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public nonisolated enum MotionTunables {
.pulse: (1.8, "One cycle of the agent-waiting pulse."),
.flash: (1, "Pane attention flash (two blinks; at least 1 s, the 2 Hz cap)."),
.sweep: (1.3, "One pass of an unmeasured progress bar's segment (the update card while checking)."),
.breath: (2.4, "One breath of the agent-working dot (working look Breathing Dot). Web pages breathe on their own --cmux-breath-period."),
]

static let loops: [MotionLoop: Tunable<Double>] = Dictionary(uniqueKeysWithValues: MotionLoop.allCases.map { loop in
Expand Down
Loading