@@ -15,7 +15,8 @@ final class StatusBarTextTests: XCTestCase {
1515 balance: 42, isLoading: false,
1616 hyperConfigured: true,
1717 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
18โ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
18+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
19+ zaiInPeakHours: false
1920 )
2021 XCTAssertEqual(title, "โก42 ยท \u{1F172}62% 8%")
2122 }
@@ -25,7 +26,8 @@ final class StatusBarTextTests: XCTestCase {
2526 balance: 42, isLoading: false,
2627 hyperConfigured: true,
2728 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
28โ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
29+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
30+ zaiInPeakHours: false
2931 )
3032 XCTAssertEqual(title, "โก42")
3133 }
@@ -35,7 +37,8 @@ final class StatusBarTextTests: XCTestCase {
3537 balance: nil, isLoading: false,
3638 hyperConfigured: false,
3739 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
38โ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
40+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
41+ zaiInPeakHours: false
3942 )
4043 XCTAssertEqual(title, "\u{1F172}62% 8%")
4144 }
@@ -45,7 +48,8 @@ final class StatusBarTextTests: XCTestCase {
4548 balance: nil, isLoading: true,
4649 hyperConfigured: false,
4750 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
48โ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
51+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
52+ zaiInPeakHours: false
4953 )
5054 XCTAssertEqual(title, "โฆ")
5155 }
@@ -55,7 +59,8 @@ final class StatusBarTextTests: XCTestCase {
5559 balance: nil, isLoading: false,
5660 hyperConfigured: false,
5761 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
58โ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
62+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
63+ zaiInPeakHours: false
5964 )
6065 XCTAssertEqual(title, "")
6166 }
@@ -68,7 +73,8 @@ final class StatusBarTextTests: XCTestCase {
6873 balance: nil, isLoading: true,
6974 hyperConfigured: false,
7075 claudeFiveHourPercent: 62, claudeSevenDayPercent: nil,
71โ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
76+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
77+ zaiInPeakHours: false
7278 )
7379 XCTAssertEqual(title, "\u{1F172}62%")
7480 }
@@ -78,7 +84,8 @@ final class StatusBarTextTests: XCTestCase {
7884 balance: 42, isLoading: true,
7985 hyperConfigured: true,
8086 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
81โ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
87+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
88+ zaiInPeakHours: false
8289 )
8390 XCTAssertEqual(title, "โก42 ยท \u{1F172}62% 8%")
8491 }
@@ -88,7 +95,8 @@ final class StatusBarTextTests: XCTestCase {
8895 balance: 42, isLoading: false,
8996 hyperConfigured: true,
9097 claudeFiveHourPercent: 0, claudeSevenDayPercent: 8,
91โ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
98+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
99+ zaiInPeakHours: false
92100 )
93101 XCTAssertEqual(title, "โก42 ยท \u{1F172}8%")
94102 }
@@ -98,7 +106,8 @@ final class StatusBarTextTests: XCTestCase {
98106 balance: 42, isLoading: false,
99107 hyperConfigured: true,
100108 claudeFiveHourPercent: 0, claudeSevenDayPercent: 0,
101โ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
109+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
110+ zaiInPeakHours: false
102111 )
103112 XCTAssertEqual(title, "โก42")
104113 }
@@ -108,7 +117,8 @@ final class StatusBarTextTests: XCTestCase {
108117 balance: nil, isLoading: false,
109118 hyperConfigured: false,
110119 claudeFiveHourPercent: 62, claudeSevenDayPercent: nil,
111โ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
120+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
121+ zaiInPeakHours: false
112122 )
113123 XCTAssertEqual(title, "\u{1F172}62%")
114124 }
@@ -118,7 +128,8 @@ final class StatusBarTextTests: XCTestCase {
118128 balance: nil, isLoading: false,
119129 hyperConfigured: false,
120130 claudeFiveHourPercent: nil, claudeSevenDayPercent: 8,
121โ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
131+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
132+ zaiInPeakHours: false
122133 )
123134 XCTAssertEqual(title, "\u{1F172}8%")
124135 }
@@ -132,7 +143,8 @@ final class StatusBarTextTests: XCTestCase {
132143 balance: 42, isLoading: false,
133144 hyperConfigured: false,
134145 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
135โ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
146+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
147+ zaiInPeakHours: false
136148 )
137149 XCTAssertEqual(title, "")
138150 }
@@ -142,7 +154,8 @@ final class StatusBarTextTests: XCTestCase {
142154 balance: nil, isLoading: true,
143155 hyperConfigured: false,
144156 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
145โ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
157+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
158+ zaiInPeakHours: false
146159 )
147160 XCTAssertEqual(title, "โฆ")
148161 }
@@ -152,7 +165,8 @@ final class StatusBarTextTests: XCTestCase {
152165 balance: nil, isLoading: false,
153166 hyperConfigured: false,
154167 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
155โ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil
168+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
169+ zaiInPeakHours: false
156170 )
157171 XCTAssertEqual(title, "\u{1F172}62% 8%")
158172 }
@@ -164,7 +178,8 @@ final class StatusBarTextTests: XCTestCase {
164178 balance: nil, isLoading: false,
165179 hyperConfigured: false,
166180 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
167โ zaiFiveHourPercent: 12, zaiWeeklyPercent: nil
181+ zaiFiveHourPercent: 12, zaiWeeklyPercent: nil,
182+ zaiInPeakHours: false
168183 )
169184 XCTAssertEqual(title, "\u{1F149}12%")
170185 }
@@ -174,7 +189,8 @@ final class StatusBarTextTests: XCTestCase {
174189 balance: 42, isLoading: false,
175190 hyperConfigured: true,
176191 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
177โ zaiFiveHourPercent: 12, zaiWeeklyPercent: nil
192+ zaiFiveHourPercent: 12, zaiWeeklyPercent: nil,
193+ zaiInPeakHours: false
178194 )
179195 XCTAssertEqual(title, "โก42 ยท \u{1F149}12%")
180196 }
@@ -184,7 +200,8 @@ final class StatusBarTextTests: XCTestCase {
184200 balance: nil, isLoading: false,
185201 hyperConfigured: false,
186202 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
187โ zaiFiveHourPercent: 12, zaiWeeklyPercent: nil
203+ zaiFiveHourPercent: 12, zaiWeeklyPercent: nil,
204+ zaiInPeakHours: false
188205 )
189206 XCTAssertEqual(title, "\u{1F172}62% 8% ยท \u{1F149}12%")
190207 }
@@ -194,7 +211,8 @@ final class StatusBarTextTests: XCTestCase {
194211 balance: 42, isLoading: false,
195212 hyperConfigured: true,
196213 claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
197โ zaiFiveHourPercent: 12, zaiWeeklyPercent: 3
214+ zaiFiveHourPercent: 12, zaiWeeklyPercent: 3,
215+ zaiInPeakHours: false
198216 )
199217 XCTAssertEqual(title, "โก42 ยท \u{1F172}62% 8% ยท \u{1F149}12% 3%")
200218 }
@@ -204,7 +222,8 @@ final class StatusBarTextTests: XCTestCase {
204222 balance: 42, isLoading: false,
205223 hyperConfigured: true,
206224 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
207โ zaiFiveHourPercent: 0, zaiWeeklyPercent: 0
225+ zaiFiveHourPercent: 0, zaiWeeklyPercent: 0,
226+ zaiInPeakHours: false
208227 )
209228 XCTAssertEqual(title, "โก42")
210229 }
@@ -214,7 +233,8 @@ final class StatusBarTextTests: XCTestCase {
214233 balance: nil, isLoading: true,
215234 hyperConfigured: false,
216235 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
217โ zaiFiveHourPercent: 12, zaiWeeklyPercent: nil
236+ zaiFiveHourPercent: 12, zaiWeeklyPercent: nil,
237+ zaiInPeakHours: false
218238 )
219239 XCTAssertEqual(title, "\u{1F149}12%")
220240 }
@@ -226,7 +246,8 @@ final class StatusBarTextTests: XCTestCase {
226246 balance: nil, isLoading: false,
227247 hyperConfigured: false,
228248 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
229โ zaiFiveHourPercent: nil, zaiWeeklyPercent: 3
249+ zaiFiveHourPercent: nil, zaiWeeklyPercent: 3,
250+ zaiInPeakHours: false
230251 )
231252 XCTAssertEqual(title, "\u{1F149}3%")
232253 }
@@ -236,7 +257,8 @@ final class StatusBarTextTests: XCTestCase {
236257 balance: nil, isLoading: false,
237258 hyperConfigured: false,
238259 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
239โ zaiFiveHourPercent: 12, zaiWeeklyPercent: 3
260+ zaiFiveHourPercent: 12, zaiWeeklyPercent: 3,
261+ zaiInPeakHours: false
240262 )
241263 XCTAssertEqual(title, "\u{1F149}12% 3%")
242264 }
@@ -246,7 +268,8 @@ final class StatusBarTextTests: XCTestCase {
246268 balance: nil, isLoading: false,
247269 hyperConfigured: false,
248270 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
249โ zaiFiveHourPercent: 12, zaiWeeklyPercent: 0
271+ zaiFiveHourPercent: 12, zaiWeeklyPercent: 0,
272+ zaiInPeakHours: false
250273 )
251274 XCTAssertEqual(title, "\u{1F149}12%")
252275 }
@@ -256,11 +279,48 @@ final class StatusBarTextTests: XCTestCase {
256279 balance: nil, isLoading: true,
257280 hyperConfigured: false,
258281 claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
259โ zaiFiveHourPercent: nil, zaiWeeklyPercent: 3
282+ zaiFiveHourPercent: nil, zaiWeeklyPercent: 3,
283+ zaiInPeakHours: false
260284 )
261285 XCTAssertEqual(title, "\u{1F149}3%")
262286 }
263287
288+ // MARK: - z.ai Peak Hours
289+
290+ func testPeakHoursAddsDiamondToZaiSegment() {
291+ let title = ViewModel.statusBarText(
292+ balance: 42, isLoading: false,
293+ hyperConfigured: true,
294+ claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
295+ zaiFiveHourPercent: 12, zaiWeeklyPercent: 3,
296+ zaiInPeakHours: true
297+ )
298+ XCTAssertEqual(title, "โก42 ยท \u{1F172}62% 8% ยท \u{1F149}12% 3%\u{1F536}")
299+ }
300+
301+ func testPeakHoursWithZaiOnly() {
302+ let title = ViewModel.statusBarText(
303+ balance: nil, isLoading: false,
304+ hyperConfigured: false,
305+ claudeFiveHourPercent: nil, claudeSevenDayPercent: nil,
306+ zaiFiveHourPercent: 12, zaiWeeklyPercent: nil,
307+ zaiInPeakHours: true
308+ )
309+ XCTAssertEqual(title, "\u{1F149}12%\u{1F536}")
310+ }
311+
312+ func testPeakHoursIgnoredWhenZaiNotConfigured() {
313+ let title = ViewModel.statusBarText(
314+ balance: 42, isLoading: false,
315+ hyperConfigured: true,
316+ claudeFiveHourPercent: 62, claudeSevenDayPercent: 8,
317+ zaiFiveHourPercent: nil, zaiWeeklyPercent: nil,
318+ zaiInPeakHours: true
319+ )
320+ // No z.ai segment, so peak marker has nothing to attach to.
321+ XCTAssertEqual(title, "โก42 ยท \u{1F172}62% 8%")
322+ }
323+
264324 // MARK: - Claude Window Percentages
265325
266326 func testFiveHourPercentRounds() {