YMRohit commited on
Commit
cc2fa0d
·
verified ·
1 Parent(s): 47ed5dd

Sync build+expert Local toggles so both pages show the same comparisons

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -1434,6 +1434,16 @@ APP_JS = r"""
1434
  setupTemp('#km-xtemp','#km-xtemp-v');
1435
  syncModePair('#km-local','#km-pro');
1436
  syncModePair('#km-xlocal','#km-xpro');
 
 
 
 
 
 
 
 
 
 
1437
  renderPickers();
1438
  renderClassics();
1439
  renderReplayChoices();
 
1434
  setupTemp('#km-xtemp','#km-xtemp-v');
1435
  syncModePair('#km-local','#km-pro');
1436
  syncModePair('#km-xlocal','#km-xpro');
1437
+ // The build and expert pages each have their own "Local (offline)" toggle. Local mode is the ONLY
1438
+ // path that computes the max-autotune number, so a page in Modal mode shows just 2 comparisons.
1439
+ // Keep both toggles in lockstep so build and expert always run the same way and show the same
1440
+ // set of comparison numbers (the guard stops the change events from ping-ponging).
1441
+ (function(){
1442
+ const a=$('#km-local'), b=$('#km-xlocal');
1443
+ if(!a||!b)return;
1444
+ a.addEventListener('change',()=>{ if(b.checked!==a.checked){ b.checked=a.checked; b.dispatchEvent(new Event('change')); } });
1445
+ b.addEventListener('change',()=>{ if(a.checked!==b.checked){ a.checked=b.checked; a.dispatchEvent(new Event('change')); } });
1446
+ })();
1447
  renderPickers();
1448
  renderClassics();
1449
  renderReplayChoices();