@@ -971,35 +971,10 @@ export class MetricsCalculator {
971971 }
972972 } ) ;
973973
974- // For POS-tagged tree buttons that have predictions but are NOT in the
975- // BFS-reachable metrics set, create synthetic metrics entries so their
976- // word forms can still be generated. This handles words like "run" that
977- // exist only on topic pages the BFS doesn't reach.
978- const processedPredictionLabels = new Set < string > ( ) ;
979- Object . values ( tree . pages ) . forEach ( ( page : AACPage ) => {
980- page . grid . forEach ( ( row : ( AACButton | null ) [ ] ) => {
981- row . forEach ( ( btn : AACButton | null ) => {
982- if ( ! btn || ! btn . label || ! btn . predictions || btn . predictions . length === 0 ) return ;
983- const lower = btn . label . toLowerCase ( ) ;
984- if ( existingLabels . has ( lower ) ) return ; // Already in metrics
985- if ( processedPredictionLabels . has ( lower ) ) return ; // Already synthesized
986- processedPredictionLabels . add ( lower ) ;
987-
988- // Create a synthetic metrics entry using a high effort estimate
989- // (the user would need to navigate to this page to access the button)
990- const syntheticMetrics : ButtonMetrics = {
991- id : btn . id || `synthetic_${ lower } ` ,
992- label : btn . label ,
993- level : 3 , // Approximate depth for unreachable pages
994- effort : 20 , // High effort — deep navigation required
995- count : 1 ,
996- pos : btn . pos ,
997- } ;
998- buttons . push ( syntheticMetrics ) ;
999- existingLabels . set ( lower , syntheticMetrics ) ;
1000- } ) ;
1001- } ) ;
1002- } ) ;
974+ // Note: buttons on pages unreachable via BFS from the root page are
975+ // intentionally excluded. If there is no navigation path to a page,
976+ // those buttons are not accessible to the user and should not count
977+ // as available vocabulary.
1003978
1004979 // Iterate through all pages to find buttons with predictions
1005980 Object . values ( tree . pages ) . forEach ( ( page : AACPage ) => {
0 commit comments