@@ -274,9 +274,35 @@ export function AppHeader({
274274 return { data : [ ] as Record < string , unknown > [ ] } ;
275275 } ) ;
276276 if ( activityResult . data ?. length ) {
277- const items = ( activityResult . data as Record < string , unknown > [ ] ) . filter (
278- ( a ) : a is ActivityItem & Record < string , unknown > => typeof a . type === 'string'
279- ) ;
277+ // Raw sys_activity rows use plugin-audit's column names
278+ // (summary / actor_name / object_name / timestamp). Map them onto
279+ // ActivityItem's shape (description / user / objectName) — casting the
280+ // raw row straight through left every field undefined, so the popover
281+ // Activity tab rendered blank rows (only the relative time showed).
282+ // Mirrors the mapping in `useHomeInbox` so the bell and Home never diverge.
283+ const items : ActivityItem [ ] = ( activityResult . data as Record < string , unknown > [ ] )
284+ . filter ( ( r ) => typeof r . type === 'string' && String ( r . summary ?? '' ) . trim ( ) )
285+ . map ( ( r ) => {
286+ let when = r . timestamp as string | undefined ;
287+ if ( ! when || when === 'NOW()' || Number . isNaN ( Date . parse ( when ) ) ) {
288+ when = r . created_at as string | undefined ;
289+ }
290+ const raw = String ( r . type ) ;
291+ const type : ActivityItem [ 'type' ] =
292+ raw === 'commented' || raw === 'mentioned' ? 'comment'
293+ : raw === 'deleted' ? 'delete'
294+ : raw === 'created' ? 'create'
295+ : 'update' ;
296+ return {
297+ id : String ( r . id ) ,
298+ type,
299+ objectName : ( r . object_name as string ) ?? '' ,
300+ recordId : ( r . record_id as string ) ?? undefined ,
301+ user : ( r . actor_name as string ) ?? '' ,
302+ description : ( r . summary as string ) ?? '' ,
303+ timestamp : when ?? '' ,
304+ } ;
305+ } ) ;
280306 if ( items . length ) setApiActivities ( items ) ;
281307 }
282308 } catch { /* fallback below */ } finally {
0 commit comments