fix: preserve lazy navigation intent

This commit is contained in:
mARTin-B78 2026-09-04 10:34:50 +02:00
parent 8d7511cdbf
commit 5c8683821e
3 changed files with 11 additions and 2 deletions

View File

@ -8,6 +8,8 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
## [Unreleased]
### Changed
- **Lazy-navigation race protection.** A restored-section callback can no longer replace a newer user navigation
request while section-specific modules are still loading, including under CPU throttling.
- **Constrained workload coverage.** Added a 4× CPU-throttled 500-character browser workload regression that
records bounded DOM/audio/heap/image-cache metrics while preserving pagination.
- **Bounded library image lifecycle.** Profile, concept-art, and voice-library images now use a viewport-aware

View File

@ -1 +1 @@
1.24.19
1.24.20

View File

@ -437,7 +437,14 @@
window._enginesSidebarCat = localStorage.getItem('ttsvc_engines_cat') || 'llm';
var _startSection = window._navRequestedSection || hashSection() || ((_savedSection && SECTIONS.includes(_savedSection)) ? _savedSection : 's-voices');
if (typeof window.ensureFeatureModules === 'function') {
window.ensureFeatureModules(_startSection).then(function () { showSection(_startSection); }, function () { showSection(_startSection); });
var activateStart = function () {
// A first user click can arrive while the restored section's lazy group
// is still loading. Do not let that delayed startup callback overwrite
// the newer navigation intent (especially visible under CPU throttling).
if (window._navRequestedSection && window._navRequestedSection !== _startSection) return;
showSection(_startSection);
};
window.ensureFeatureModules(_startSection).then(activateStart, activateStart);
} else showSection(_startSection);
window.addEventListener('hashchange', function () {