@@ -37,19 +37,18 @@ export function createAndFillInContextMenuActions(menu: IMenu, options: IMenuAct
3737 fillInActions ( groups , target , useAlternativeActions , primaryGroup ? actionGroup => actionGroup === primaryGroup : actionGroup => actionGroup === 'navigation' ) ;
3838}
3939
40- export function createAndFillInActionBarActions ( menu : IMenu , options : IMenuActionOptions | undefined , target : IAction [ ] | { primary : IAction [ ] ; secondary : IAction [ ] } , primaryGroup ?: string | ( ( actionGroup : string ) => boolean ) , primaryMaxCount ?: number , shouldInlineSubmenu ?: ( action : SubmenuAction , group : string , groupSize : number ) => boolean , useSeparatorsInPrimaryActions ?: boolean ) : void {
40+ export function createAndFillInActionBarActions ( menu : IMenu , options : IMenuActionOptions | undefined , target : IAction [ ] | { primary : IAction [ ] ; secondary : IAction [ ] } , primaryGroup ?: string | ( ( actionGroup : string ) => boolean ) , shouldInlineSubmenu ?: ( action : SubmenuAction , group : string , groupSize : number ) => boolean , useSeparatorsInPrimaryActions ?: boolean ) : void {
4141 const groups = menu . getActions ( options ) ;
4242 const isPrimaryAction = typeof primaryGroup === 'string' ? ( actionGroup : string ) => actionGroup === primaryGroup : primaryGroup ;
4343
4444 // Action bars handle alternative actions on their own so the alternative actions should be ignored
45- fillInActions ( groups , target , false , isPrimaryAction , primaryMaxCount , shouldInlineSubmenu , useSeparatorsInPrimaryActions ) ;
45+ fillInActions ( groups , target , false , isPrimaryAction , shouldInlineSubmenu , useSeparatorsInPrimaryActions ) ;
4646}
4747
4848function fillInActions (
4949 groups : ReadonlyArray < [ string , ReadonlyArray < MenuItemAction | SubmenuItemAction > ] > , target : IAction [ ] | { primary : IAction [ ] ; secondary : IAction [ ] } ,
5050 useAlternativeActions : boolean ,
5151 isPrimaryAction : ( actionGroup : string ) => boolean = actionGroup => actionGroup === 'navigation' ,
52- primaryMaxCount : number = Number . MAX_SAFE_INTEGER ,
5352 shouldInlineSubmenu : ( action : SubmenuAction , group : string , groupSize : number ) => boolean = ( ) => false ,
5453 useSeparatorsInPrimaryActions : boolean = false
5554) : void {
@@ -101,16 +100,10 @@ function fillInActions(
101100 // inlining submenus with length 0 or 1 is easy,
102101 // larger submenus need to be checked with the overall limit
103102 const submenuActions = action . actions ;
104- if ( ( submenuActions . length <= 1 || target . length + submenuActions . length - 2 <= primaryMaxCount ) && shouldInlineSubmenu ( action , group , target . length ) ) {
103+ if ( submenuActions . length <= 1 && shouldInlineSubmenu ( action , group , target . length ) ) {
105104 target . splice ( index , 1 , ...submenuActions ) ;
106105 }
107106 }
108-
109- // overflow items from the primary group into the secondary bucket
110- if ( primaryBucket !== secondaryBucket && primaryBucket . length > primaryMaxCount ) {
111- const overflow = primaryBucket . splice ( primaryMaxCount , primaryBucket . length - primaryMaxCount ) ;
112- secondaryBucket . unshift ( ...overflow , new Separator ( ) ) ;
113- }
114107}
115108
116109export interface IMenuEntryActionViewItemOptions {
0 commit comments