@@ -1634,6 +1634,53 @@ test('background Apply validation uses the Missing Models workflow signature', a
16341634 ] ) ;
16351635} ) ;
16361636
1637+ test ( 'Apply selected model preserves Missing Models browser geometry during both refresh stages' , async ( ) => {
1638+ const applyOptimisticAnalysisData = eval (
1639+ `(${ extractMethod ( queueMethodsSource , 'applyOptimisticAnalysisData' ) } )`
1640+ ) ;
1641+ const refreshAnalysisInBackground = eval (
1642+ `(${ extractMethod ( queueMethodsSource , 'refreshAnalysisInBackground' ) } )`
1643+ ) ;
1644+ const contentElement = { } ;
1645+ const workflow = { nodes : [ { id : 7 , widgets_values : [ 'linked.safetensors' ] } ] } ;
1646+ const optimisticData = { missing_models : [ ] , resolved_models : [ { node_id : 7 , optimistic : true } ] } ;
1647+ const analyzedData = { missing_models : [ ] , resolved_models : [ { node_id : 7 , optimistic : false } ] } ;
1648+ const renderCalls = [ ] ;
1649+ const dialog = {
1650+ activeTab : 'missing' ,
1651+ contentElement,
1652+ activeMissingWorkflowSignature : 'linked-missing-signature' ,
1653+ cachedWorkflowSignature : null ,
1654+ cachedAnalysisData : null ,
1655+ applyResolvedSelectionAliasesToAnalysisData ( ) { } ,
1656+ getMissingWorkflowSignature ( ) {
1657+ return 'linked-missing-signature' ;
1658+ } ,
1659+ getCurrentWorkflow ( ) {
1660+ return workflow ;
1661+ } ,
1662+ cloneAnalysisData ( data ) {
1663+ return data ;
1664+ } ,
1665+ saveAnalysisCacheForActiveWorkflow ( ) { } ,
1666+ displayMissingModels ( ...args ) {
1667+ renderCalls . push ( args ) ;
1668+ } ,
1669+ reconnectActiveDownloads ( ) { } ,
1670+ async fetchJson ( ) {
1671+ return analyzedData ;
1672+ } ,
1673+ } ;
1674+
1675+ applyOptimisticAnalysisData . call ( dialog , optimisticData , workflow ) ;
1676+ await refreshAnalysisInBackground . call ( dialog , workflow ) ;
1677+
1678+ assert . deepEqual ( renderCalls , [
1679+ [ contentElement , optimisticData , { preserveBrowser : true } ] ,
1680+ [ contentElement , analyzedData , { preserveBrowser : true } ] ,
1681+ ] ) ;
1682+ } ) ;
1683+
16371684test ( 'background Loaded Models refresh keeps the current view until new data is ready' , async ( ) => {
16381685 const loadLoadedModels = eval ( `(${ extractMethod ( tabsLoadedMethodsSource , 'loadLoadedModels' ) } )` ) ;
16391686 const workflow = {
0 commit comments