@@ -40,6 +40,9 @@ struct SyncStatus {
4040 materialized : Vec < String > ,
4141 #[ serde( default ) ]
4242 last_materialize_at : Option < String > ,
43+ /// Soft edge cases from pass-materialize (missing/stale secrets) — not sync hard errors.
44+ #[ serde( default ) ]
45+ materialize_warnings : Vec < String > ,
4346}
4447
4548fn default_state ( ) -> String {
@@ -126,6 +129,10 @@ fn icon_kind(status: &SyncStatus, rebuilding: bool, lock: bool) -> IconKind {
126129 if status. error . as_ref ( ) . is_some_and ( |e| !e. is_empty ( ) ) || status. state == "error" {
127130 return IconKind :: Error ;
128131 }
132+ // Missing/stale materialize secrets — same attention glyph as error (no amber on template icons).
133+ if !status. materialize_warnings . is_empty ( ) {
134+ return IconKind :: Error ;
135+ }
129136 if status. state == "uploading" || ( lock && status. direction == "up" ) {
130137 return IconKind :: Up ;
131138 }
@@ -300,6 +307,7 @@ struct NativeTray {
300307 status_headline : MenuItem ,
301308 status_detail : MenuItem ,
302309 status_mat : MenuItem ,
310+ status_warn : MenuItem ,
303311 item_qtpass : MenuItem ,
304312 item_log : MenuItem ,
305313 item_quit : MenuItem ,
@@ -312,6 +320,7 @@ impl NativeTray {
312320 let status_headline = MenuItem :: new ( ui_contract:: status:: HEADLINE , false , None ) ;
313321 let status_detail = MenuItem :: new ( ui_contract:: status:: DETAIL , false , None ) ;
314322 let status_mat = MenuItem :: new ( ui_contract:: status:: MATERIALIZED , false , None ) ;
323+ let status_warn = MenuItem :: new ( ui_contract:: status:: WARNINGS , false , None ) ;
315324 let item_qtpass = MenuItem :: new ( Action :: OpenQtPass . label ( ) , true , None ) ;
316325 let item_log = MenuItem :: new ( Action :: OpenSyncLog . label ( ) , true , None ) ;
317326 let item_quit = MenuItem :: new ( Action :: Quit . label ( ) , true , None ) ;
@@ -321,6 +330,7 @@ impl NativeTray {
321330 let _ = menu. append ( & status_headline) ;
322331 let _ = menu. append ( & status_detail) ;
323332 let _ = menu. append ( & status_mat) ;
333+ let _ = menu. append ( & status_warn) ;
324334 let _ = menu. append ( & PredefinedMenuItem :: separator ( ) ) ;
325335 // Actions from shared contract order (QtPass, sync log, then Quit)
326336 debug_assert_eq ! ( Action :: ALL [ 0 ] , Action :: OpenQtPass ) ;
@@ -345,6 +355,7 @@ impl NativeTray {
345355 status_headline,
346356 status_detail,
347357 status_mat,
358+ status_warn,
348359 item_qtpass,
349360 item_log,
350361 item_quit,
@@ -366,12 +377,15 @@ impl NativeTray {
366377 }
367378
368379 let err = status. error . as_deref ( ) . filter ( |e| !e. is_empty ( ) ) ;
380+ let warn_n = status. materialize_warnings . len ( ) ;
369381 let headline = if rebuilding {
370382 "Rebuilding system…" . to_string ( )
371383 } else if lock {
372384 format ! ( "Syncing ({})…" , status. direction)
373385 } else if let Some ( e) = err {
374386 format ! ( "Error: {e}" )
387+ } else if warn_n > 0 {
388+ format ! ( "Warning: {warn_n} secret issue(s)" )
375389 } else {
376390 format ! ( "{} · {}" , status. state, status. direction)
377391 } ;
@@ -388,12 +402,31 @@ impl NativeTray {
388402 let last_mat = status. last_materialize_at . as_deref ( ) . unwrap_or ( "—" ) ;
389403 let mat_line = format ! ( "Materialized: {mats} @ {last_mat}" ) ;
390404
405+ let warn_line = if status. materialize_warnings . is_empty ( ) {
406+ "Secrets: ok" . to_string ( )
407+ } else {
408+ // Show first warning; tooltip gets the full set.
409+ let first = & status. materialize_warnings [ 0 ] ;
410+ if warn_n == 1 {
411+ format ! ( "⚠ {first}" )
412+ } else {
413+ format ! ( "⚠ {first} (+{})" , warn_n - 1 )
414+ }
415+ } ;
416+
391417 self . status_headline . set_text ( headline. clone ( ) ) ;
392418 self . status_detail . set_text ( detail) ;
393419 self . status_mat . set_text ( mat_line) ;
394- let _ = self
395- . tray
396- . set_tooltip ( Some ( format ! ( "pass sync: {headline}" ) ) ) ;
420+ self . status_warn . set_text ( warn_line) ;
421+ let tip = if status. materialize_warnings . is_empty ( ) {
422+ format ! ( "pass sync: {headline}" )
423+ } else {
424+ format ! (
425+ "pass sync: {headline}\n {}" ,
426+ status. materialize_warnings. join( "\n " )
427+ )
428+ } ;
429+ let _ = self . tray . set_tooltip ( Some ( tip) ) ;
397430 }
398431
399432 fn handle_menu ( & mut self ) {
0 commit comments