@@ -231,8 +231,8 @@ extension CronSettings {
231231 if let thinking , ! thinking . isEmpty { StatusPill ( text : " think \( thinking ) " , tint : . secondary ) }
232232 if let timeoutSeconds { StatusPill ( text : " \( timeoutSeconds ) s " , tint : . secondary ) }
233233 if job . supportsAnnounceDelivery {
234- let delivery = job . delivery
235- if let delivery {
234+ if let delivery = job . delivery {
235+ self . advancedDeliveryPills ( delivery )
236236 if delivery . mode == . announce {
237237 StatusPill ( text : " announce " , tint : . secondary )
238238 if let channel = delivery . channel , ! channel . isEmpty {
@@ -242,21 +242,6 @@ extension CronSettings {
242242 } else {
243243 StatusPill ( text : " no delivery " , tint : . secondary )
244244 }
245- if let threadId = delivery . threadId ? . value {
246- StatusPill . verbatim (
247- " threadId \( String ( describing : threadId ) ) " ,
248- tint : . secondary )
249- }
250- if let to = delivery . completionDestination ? [ " to " ] ? . value as? String {
251- StatusPill . verbatim ( " completionDestination \( to ) " , tint : . secondary )
252- }
253- if let failure = delivery . failureDestination {
254- let target = failure [ " to " ] ? . value as? String
255- ?? failure [ " channel " ] ? . value as? String
256- ?? failure [ " accountId " ] ? . value as? String
257- let suffix = target . map { " \( $0 ) " } ?? " "
258- StatusPill . verbatim ( " failureDestination " + suffix , tint : . secondary )
259- }
260245 }
261246 }
262247 }
@@ -286,4 +271,23 @@ extension CronSettings {
286271 }
287272 }
288273 }
274+
275+ @ ViewBuilder
276+ private func advancedDeliveryPills ( _ delivery : CronDelivery ) -> some View {
277+ if let threadId = delivery . threadId ? . value {
278+ StatusPill . verbatim (
279+ " threadId \( String ( describing : threadId ) ) " ,
280+ tint : . secondary )
281+ }
282+ if let to = delivery . completionDestination ? [ " to " ] ? . value as? String {
283+ StatusPill . verbatim ( " completionDestination \( to ) " , tint : . secondary )
284+ }
285+ if let failure = delivery . failureDestination {
286+ let target = failure [ " to " ] ? . value as? String
287+ ?? failure [ " channel " ] ? . value as? String
288+ ?? failure [ " accountId " ] ? . value as? String
289+ let suffix = target . map { " \( $0 ) " } ?? " "
290+ StatusPill . verbatim ( " failureDestination " + suffix , tint : . secondary )
291+ }
292+ }
289293}
0 commit comments