@@ -39,6 +39,8 @@ function loadUIState() {
3939 return {
4040 notifySectionCollapsed : ! ! parsed . notifySectionCollapsed ,
4141 runnerSectionCollapsed : ! ! parsed . runnerSectionCollapsed ,
42+ notifyJournalSectionCollapsed : ! ! parsed . notifyJournalSectionCollapsed ,
43+ eventsSectionCollapsed : ! ! parsed . eventsSectionCollapsed ,
4244 notifySortMode : ! ! parsed . notifySortMode ,
4345 runnerSortMode : ! ! parsed . runnerSortMode ,
4446 lang : normalizeLang ( parsed . lang ) || "" ,
@@ -55,6 +57,8 @@ function saveUIState() {
5557 JSON . stringify ( {
5658 notifySectionCollapsed : ! ! ui . notifySectionCollapsed ,
5759 runnerSectionCollapsed : ! ! ui . runnerSectionCollapsed ,
60+ notifyJournalSectionCollapsed : ! ! ui . notifyJournalSectionCollapsed ,
61+ eventsSectionCollapsed : ! ! ui . eventsSectionCollapsed ,
5862 notifySortMode : ! ! ui . notifySortMode ,
5963 runnerSortMode : ! ! ui . runnerSortMode ,
6064 lang : ui . lang ,
@@ -69,6 +73,8 @@ const loadedUIState = loadUIState();
6973const ui = {
7074 notifySectionCollapsed : loadedUIState . notifySectionCollapsed ?? false ,
7175 runnerSectionCollapsed : loadedUIState . runnerSectionCollapsed ?? false ,
76+ notifyJournalSectionCollapsed : loadedUIState . notifyJournalSectionCollapsed ?? false ,
77+ eventsSectionCollapsed : loadedUIState . eventsSectionCollapsed ?? false ,
7278 notifySortMode : loadedUIState . notifySortMode ?? false ,
7379 runnerSortMode : loadedUIState . runnerSortMode ?? false ,
7480 lang : loadedUIState . lang || detectDefaultLang ( ) ,
@@ -1298,6 +1304,28 @@ function renderRunnerSection() {
12981304 syncSortModeButtons ( ) ;
12991305}
13001306
1307+ function renderNotifyJournalSection ( ) {
1308+ const toggle = el ( "notifyJournalSectionToggle" ) ;
1309+ const body = el ( "notifyJournalSectionBody" ) ;
1310+ if ( toggle ) {
1311+ toggle . textContent = ui . notifyJournalSectionCollapsed ? "+" : "-" ;
1312+ }
1313+ if ( body ) {
1314+ body . classList . toggle ( "hidden" , ui . notifyJournalSectionCollapsed ) ;
1315+ }
1316+ }
1317+
1318+ function renderEventsSection ( ) {
1319+ const toggle = el ( "eventsSectionToggle" ) ;
1320+ const body = el ( "eventsSectionBody" ) ;
1321+ if ( toggle ) {
1322+ toggle . textContent = ui . eventsSectionCollapsed ? "+" : "-" ;
1323+ }
1324+ if ( body ) {
1325+ body . classList . toggle ( "hidden" , ui . eventsSectionCollapsed ) ;
1326+ }
1327+ }
1328+
13011329function scheduleOptions ( max ) {
13021330 let opts = "" ;
13031331 for ( let i = 0 ; i <= max ; i ++ ) opts += `<option value="${ i } ">${ i } </option>` ;
@@ -2352,19 +2380,40 @@ async function loadNotifyJournal() {
23522380function updateGlobalRunningStatus ( ) {
23532381 const runningCount = Object . values ( runtime . status ) . filter ( ( s ) => s . running ) . length ;
23542382 const scheduledCount = Object . values ( runtime . status ) . filter ( ( s ) => s . scheduled && ! s . running ) . length ;
2383+ const status = el ( "runningStatus" ) ;
23552384 const spinner = el ( "globalSpinner" ) ;
23562385 const count = el ( "runningCount" ) ;
23572386
23582387 const hasActivity = runningCount > 0 || scheduledCount > 0 ;
2388+ const runningNow = runningCount > 0 ;
2389+ const displayCount = runningNow ? runningCount : scheduledCount ;
2390+
2391+ status ?. classList . toggle ( "hidden" , ! hasActivity ) ;
2392+ status ?. classList . toggle ( "is-active" , hasActivity ) ;
23592393
23602394 if ( hasActivity ) {
23612395 spinner ?. classList . remove ( "hidden" ) ;
2396+ spinner ?. classList . toggle ( "is-scheduled" , ! runningNow ) ;
2397+ if ( spinner ) {
2398+ spinner . textContent = String ( displayCount ) ;
2399+ const spinnerLabel = runningNow
2400+ ? `${ runningCount } ${ t ( "running_label" ) } `
2401+ : `${ scheduledCount } ${ t ( "scheduled_label" ) } ` ;
2402+ spinner . setAttribute ( "title" , spinnerLabel ) ;
2403+ spinner . setAttribute ( "aria-label" , spinnerLabel ) ;
2404+ }
23622405 const parts = [ ] ;
23632406 if ( runningCount > 0 ) parts . push ( `${ runningCount } ${ t ( "running_label" ) } ` ) ;
23642407 if ( scheduledCount > 0 ) parts . push ( `${ scheduledCount } ${ t ( "scheduled_label" ) } ` ) ;
2365- if ( count ) count . textContent = parts . join ( ", " ) ;
2408+ if ( count ) count . textContent = parts . join ( " • " ) ;
23662409 } else {
23672410 spinner ?. classList . add ( "hidden" ) ;
2411+ spinner ?. classList . remove ( "is-scheduled" ) ;
2412+ if ( spinner ) {
2413+ spinner . textContent = "" ;
2414+ spinner . removeAttribute ( "title" ) ;
2415+ spinner . removeAttribute ( "aria-label" ) ;
2416+ }
23682417 if ( count ) count . textContent = "" ;
23692418 }
23702419}
@@ -2644,6 +2693,18 @@ async function wireUI() {
26442693 renderRunnerSection ( ) ;
26452694 } ) ;
26462695
2696+ el ( "notifyJournalSectionToggle" ) ?. addEventListener ( "click" , ( ) => {
2697+ ui . notifyJournalSectionCollapsed = ! ui . notifyJournalSectionCollapsed ;
2698+ saveUIState ( ) ;
2699+ renderNotifyJournalSection ( ) ;
2700+ } ) ;
2701+
2702+ el ( "eventsSectionToggle" ) ?. addEventListener ( "click" , ( ) => {
2703+ ui . eventsSectionCollapsed = ! ui . eventsSectionCollapsed ;
2704+ saveUIState ( ) ;
2705+ renderEventsSection ( ) ;
2706+ } ) ;
2707+
26472708 el ( "sortNotifyBtn" ) ?. addEventListener ( "click" , ( ) => {
26482709 ui . notifySortMode = ! ui . notifySortMode ;
26492710 saveUIState ( ) ;
@@ -2785,6 +2846,8 @@ async function wireUI() {
27852846 try {
27862847 window . addEventListener ( "beforeunload" , handleBeforeUnload ) ;
27872848 applyLanguageToStaticDom ( ) ;
2849+ renderNotifyJournalSection ( ) ;
2850+ renderEventsSection ( ) ;
27882851 const st = await apiGet ( "/api/state" ) ;
27892852 setFromState ( st ) ;
27902853 await loadNotifyJournal ( ) ;
0 commit comments