@@ -760,32 +760,35 @@ suite('ModernUIContribution', () => {
760760 } ) ;
761761 } ) ;
762762
763- test ( 'persists tab actions when action space is reserved ' , ( ) => {
763+ test ( 'shows reserved tab actions only for active tabs ' , ( ) => {
764764 const root = document . createElement ( 'div' ) ;
765765 root . className = 'monaco-workbench modern-ui-tabs' ;
766766 document . body . appendChild ( root ) ;
767767 store . add ( toDisposable ( ( ) => root . remove ( ) ) ) ;
768768
769769 const content = appendElement ( appendElement ( root , 'part editor' ) , 'content' ) ;
770- const createTab = ( groupClassName : string , titleClassName : string ) : HTMLElement => {
770+ const createTab = ( groupClassName : string , titleClassName : string , tabClassName : string ) : HTMLElement => {
771771 const title = appendElement ( appendElement ( content , groupClassName ) , titleClassName ) ;
772- const tab = appendElement ( appendElement ( title , 'tabs-container' ) , 'tab' ) ;
772+ const tab = appendElement ( appendElement ( title , 'tabs-container' ) , tabClassName ) ;
773773 return appendElement ( appendElement ( tab , 'tab-actions' ) , 'action-label' ) ;
774774 } ;
775775
776- const reservedActive = createTab ( 'editor-group-container active' , 'title tab-actions-reserve-space' ) ;
777- const reservedInactiveGroup = createTab ( 'editor-group-container' , 'title tab-actions-reserve-space' ) ;
778- const transientActive = createTab ( 'editor-group-container active' , 'title' ) ;
776+ const reservedActive = createTab ( 'editor-group-container active' , 'title tab-actions-reserve-space' , 'tab active' ) ;
777+ const reservedInactive = createTab ( 'editor-group-container active' , 'title tab-actions-reserve-space' , 'tab' ) ;
778+ const reservedActiveInInactiveGroup = createTab ( 'editor-group-container' , 'title tab-actions-reserve-space' , 'tab active' ) ;
779+ const reservedInactiveInInactiveGroup = createTab ( 'editor-group-container' , 'title tab-actions-reserve-space' , 'tab' ) ;
779780
780781 const targetWindow = getWindow ( root ) ;
781782 assert . deepStrictEqual ( {
782783 reservedActive : { opacity : targetWindow . getComputedStyle ( reservedActive ) . opacity , pointerEvents : targetWindow . getComputedStyle ( reservedActive . parentElement ! ) . pointerEvents } ,
783- reservedInactiveGroup : { opacity : targetWindow . getComputedStyle ( reservedInactiveGroup ) . opacity , pointerEvents : targetWindow . getComputedStyle ( reservedInactiveGroup . parentElement ! ) . pointerEvents } ,
784- transientActive : { opacity : targetWindow . getComputedStyle ( transientActive ) . opacity , pointerEvents : targetWindow . getComputedStyle ( transientActive . parentElement ! ) . pointerEvents } ,
784+ reservedInactive : { opacity : targetWindow . getComputedStyle ( reservedInactive ) . opacity , pointerEvents : targetWindow . getComputedStyle ( reservedInactive . parentElement ! ) . pointerEvents } ,
785+ reservedActiveInInactiveGroup : { opacity : targetWindow . getComputedStyle ( reservedActiveInInactiveGroup ) . opacity , pointerEvents : targetWindow . getComputedStyle ( reservedActiveInInactiveGroup . parentElement ! ) . pointerEvents } ,
786+ reservedInactiveInInactiveGroup : { opacity : targetWindow . getComputedStyle ( reservedInactiveInInactiveGroup ) . opacity , pointerEvents : targetWindow . getComputedStyle ( reservedInactiveInInactiveGroup . parentElement ! ) . pointerEvents } ,
785787 } , {
786788 reservedActive : { opacity : '1' , pointerEvents : 'auto' } ,
787- reservedInactiveGroup : { opacity : '0.5' , pointerEvents : 'auto' } ,
788- transientActive : { opacity : '0' , pointerEvents : 'none' } ,
789+ reservedInactive : { opacity : '0' , pointerEvents : 'none' } ,
790+ reservedActiveInInactiveGroup : { opacity : '0.5' , pointerEvents : 'auto' } ,
791+ reservedInactiveInInactiveGroup : { opacity : '0' , pointerEvents : 'none' } ,
789792 } ) ;
790793 } ) ;
791794
0 commit comments