@@ -544,7 +544,7 @@ function StatusBar({ width, showProvider, view, findingCount, optimizeAvailable,
544544 { ! isOptimize && optimizeAvailable && findingCount != null && findingCount > 0 && (
545545 < > < Text dimColor > </ Text > < Text color = { ORANGE } bold > o</ Text > < Text dimColor > optimize</ Text > < Text color = "#F55B5B" > ({ findingCount } )</ Text > </ >
546546 ) }
547- { ! isOptimize && view !== 'compare' && compareAvailable && (
547+ { ! isOptimize && compareAvailable && (
548548 < > < Text dimColor > </ Text > < Text color = { ORANGE } bold > c</ Text > < Text dimColor > compare</ Text > </ >
549549 ) }
550550 { showProvider && ( < > < Text dimColor > </ Text > < Text color = { ORANGE } bold > p</ Text > < Text dimColor > provider</ Text > </ > ) }
@@ -664,15 +664,13 @@ function InteractiveDashboard({ initialProjects, initialPeriod, initialProvider,
664664 const switchPeriod = useCallback ( ( np : Period ) => {
665665 if ( np === period ) return
666666 setPeriod ( np )
667- setView ( v => v === 'compare' ? v : 'dashboard' )
668667 if ( debounceRef . current ) clearTimeout ( debounceRef . current )
669668 debounceRef . current = setTimeout ( ( ) => { reloadData ( np , activeProvider ) } , 600 )
670669 } , [ period , activeProvider , reloadData ] )
671670
672671 const switchPeriodImmediate = useCallback ( async ( np : Period ) => {
673672 if ( np === period ) return
674673 setPeriod ( np )
675- setView ( v => v === 'compare' ? v : 'dashboard' )
676674 if ( debounceRef . current ) clearTimeout ( debounceRef . current )
677675 await reloadData ( np , activeProvider )
678676 } , [ period , activeProvider , reloadData ] )
@@ -689,8 +687,8 @@ function InteractiveDashboard({ initialProjects, initialPeriod, initialProvider,
689687 reloadData ( period , next ) ; return
690688 }
691689 const idx = PERIODS . indexOf ( period )
692- if ( key . leftArrow && view !== 'optimize' ) switchPeriod ( PERIODS [ ( idx - 1 + PERIODS . length ) % PERIODS . length ] ! )
693- else if ( ( key . rightArrow || key . tab ) && view !== 'optimize' ) switchPeriod ( PERIODS [ ( idx + 1 ) % PERIODS . length ] ! )
690+ if ( key . leftArrow ) switchPeriod ( PERIODS [ ( idx - 1 + PERIODS . length ) % PERIODS . length ] ! )
691+ else if ( key . rightArrow || key . tab ) switchPeriod ( PERIODS [ ( idx + 1 ) % PERIODS . length ] ! )
694692 else if ( input === '1' ) switchPeriodImmediate ( 'today' )
695693 else if ( input === '2' ) switchPeriodImmediate ( 'week' )
696694 else if ( input === '3' ) switchPeriodImmediate ( '30days' )
@@ -711,7 +709,7 @@ function InteractiveDashboard({ initialProjects, initialPeriod, initialProvider,
711709 </ Box >
712710 </ Box >
713711 : < Panel title = "CodeBurn" color = { ORANGE } width = { dashWidth } > < Text dimColor > Loading { PERIOD_LABELS [ period ] } ...</ Text > </ Panel > }
714- { view !== 'compare' && < StatusBar width = { dashWidth } showProvider = { multipleProviders } view = "dashboard" findingCount = { 0 } optimizeAvailable = { false } compareAvailable = { false } /> }
712+ { view !== 'compare' && < StatusBar width = { dashWidth } showProvider = { multipleProviders } view = { view } findingCount = { 0 } optimizeAvailable = { false } compareAvailable = { false } /> }
715713 </ Box >
716714 )
717715 }
0 commit comments