Skip to content

Commit fbd9288

Browse files
committed
feat(app): add update-available badge to menu bar icon
Small upward arrow in bottom-right of waveform icon when an update is detected and the app is idle. Complements the existing "Update Available" entry in the dropdown menu.
1 parent 740eff2 commit fbd9288

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

app/MeetingTranscriber/Sources/MeetingTranscriberApp.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ struct MeetingTranscriberApp: App {
194194
default: return .none
195195
}
196196
}
197+
if updateChecker.availableUpdate != nil { return .updateAvailable }
197198
return .none
198199
}
199200

app/MeetingTranscriber/Sources/MenuBarIcon.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ enum BadgeKind: CaseIterable {
1010
case userAction
1111
case done
1212
case error
13+
case updateAvailable
1314

1415
/// Whether this badge kind uses animation.
1516
var isAnimated: Bool {
@@ -74,6 +75,9 @@ enum MenuBarIcon {
7475
drawDiarizingAnimation(in: rect, frame: frame)
7576
case .processing:
7677
drawProtocolAnimation(in: rect, frame: frame)
78+
case .updateAvailable:
79+
drawRecordingAnimation(in: rect, frame: 0)
80+
drawUpdateArrow(in: rect)
7781
default:
7882
drawRecordingAnimation(in: rect, frame: frame)
7983
}
@@ -169,6 +173,29 @@ enum MenuBarIcon {
169173
}
170174
}
171175

176+
// MARK: - Update Available (small upward arrow badge in bottom-right)
177+
178+
private static func drawUpdateArrow(in rect: NSRect) {
179+
let size: CGFloat = 6.0
180+
let margin: CGFloat = 0.5
181+
let cx = rect.maxX - size / 2 - margin
182+
let cy = rect.minY + size / 2 + margin
183+
184+
// Arrow pointing up: triangle + stem
185+
let arrow = NSBezierPath()
186+
// Triangle head
187+
arrow.move(to: NSPoint(x: cx, y: cy + size / 2)) // top
188+
arrow.line(to: NSPoint(x: cx - size / 3, y: cy + 0.5)) // bottom-left
189+
arrow.line(to: NSPoint(x: cx + size / 3, y: cy + 0.5)) // bottom-right
190+
arrow.close()
191+
arrow.fill()
192+
193+
// Stem
194+
let stemWidth: CGFloat = 1.4
195+
let stem = NSRect(x: cx - stemWidth / 2, y: cy - size / 3, width: stemWidth, height: size / 2)
196+
NSBezierPath(roundedRect: stem, xRadius: stemWidth / 2, yRadius: stemWidth / 2).fill()
197+
}
198+
172199
// MARK: - Protocol Generation Animation (text lines appearing sequentially)
173200

174201
private static func drawProtocolAnimation(in rect: NSRect, frame: Int) {

0 commit comments

Comments
 (0)