@@ -1227,32 +1227,22 @@ export class Stack {
12271227 /**
12281228 * @private
12291229 * @method processOverlappingPaths
1230- * @description Processes overlapping paths using a chained approach
1230+ * @description Processes overlapping paths by including all paths from each group
12311231 * @param {Object } pathAnalysis - Analysis result from analyzeReferencePaths
12321232 * @returns {this } - Returns stack instance
12331233 */
12341234 private processOverlappingPaths ( pathAnalysis : any ) : Stack {
12351235 // Start with independent paths (if any)
12361236 if ( pathAnalysis . independentPaths . length > 0 ) {
1237- this . q . includeSpecificReferences = pathAnalysis . independentPaths
1237+ this . q . includeSpecificReferences = [ ...pathAnalysis . independentPaths ]
1238+ } else {
1239+ this . q . includeSpecificReferences = [ ]
12381240 }
12391241
1240- // Process each overlapping group by using the most specific path
1242+ // Process each overlapping group by including ALL paths from each group
12411243 pathAnalysis . overlappingGroups . forEach ( ( group : string [ ] ) => {
1242- // Sort group by length (longest/most specific first)
1243- const sortedGroup = group . sort ( ( a , b ) => b . length - a . length )
1244-
1245- // Use the most specific path from each group
1246- const mostSpecificPath = sortedGroup [ 0 ]
1247-
1248- // If this is the first group and we have no independent paths,
1249- // set the includeSpecificReferences
1250- if ( ! this . q . includeSpecificReferences ) {
1251- this . q . includeSpecificReferences = [ mostSpecificPath ]
1252- } else {
1253- // Add the most specific path to existing references
1254- this . q . includeSpecificReferences . push ( mostSpecificPath )
1255- }
1244+ // Add all paths from the group to includeSpecificReferences
1245+ this . q . includeSpecificReferences . push ( ...group )
12561246 } )
12571247
12581248 return this
0 commit comments