@@ -11,6 +11,10 @@ function group(id: string, extra: Partial<DevframeViewGroup> = {}): DevframeDock
1111 return { id, type : 'group' , title : id . toUpperCase ( ) , icon : 'ph:folder-duotone' , ...extra } as DevframeDockEntry
1212}
1313
14+ function action ( id : string , extra : Partial < DevframeDockEntry > = { } ) : DevframeDockEntry {
15+ return { id, type : 'action' , action : { importFrom : '/action.js' } , title : id . toUpperCase ( ) , icon : 'ph:play-duotone' , ...extra } as DevframeDockEntry
16+ }
17+
1418function ids ( groups : DevframeDockEntriesGrouped ) : string [ ] {
1519 return groups . flatMap ( ( [ , items ] ) => items . map ( item => item . id ) )
1620}
@@ -129,10 +133,21 @@ describe('resolveGroupPreferredChild', () => {
129133 expect ( resolveGroupPreferredChild ( [ g , defaultMember , gated ] , g , 'g:gated' , whenContext ) ) . toBe ( defaultMember )
130134 } )
131135
136+ it ( 'falls back to defaultChildId when the remembered member is an action' , ( ) => {
137+ const rememberedAction = action ( 'g:run' , { groupId : 'g' } )
138+ expect ( resolveGroupPreferredChild ( [ ...entries , rememberedAction ] , g , 'g:run' ) ) . toBe ( defaultMember )
139+ } )
140+
132141 it ( 'resolves nothing for a popover-only group without memory' , ( ) => {
133142 const bare = group ( 'bare' ) as DevframeViewGroup
134143 expect ( resolveGroupPreferredChild ( [ bare , iframe ( 'bare:x' , { groupId : 'bare' } ) ] , bare , undefined ) ) . toBeUndefined ( )
135144 } )
145+
146+ it ( 'ignores a remembered action for a popover-only group' , ( ) => {
147+ const bare = group ( 'bare' ) as DevframeViewGroup
148+ const rememberedAction = action ( 'bare:run' , { groupId : 'bare' } )
149+ expect ( resolveGroupPreferredChild ( [ bare , rememberedAction ] , bare , 'bare:run' ) ) . toBeUndefined ( )
150+ } )
136151} )
137152
138153describe ( 'resolveRecentDockEntry' , ( ) => {
0 commit comments