refactor: scope routing module

This commit is contained in:
mARTin-B78 2026-09-04 13:00:10 +02:00
parent 28c72c76dd
commit b747553bf6
5 changed files with 39 additions and 9 deletions

View File

@ -8,6 +8,8 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
## [Unreleased] ## [Unreleased]
### Changed ### Changed
- **Routing namespace migration.** Route configuration, sound selection, speed previews, routing tests, and routing-log
rendering now use a private scope with live compatibility accessors and a `window.TTVC.routing` API.
- **Voice-source namespace migration.** Source URL management, filtering, source metadata normalization, and library - **Voice-source namespace migration.** Source URL management, filtering, source metadata normalization, and library
import helpers now use a private scope with explicit compatibility exports and a `window.TTVC.voiceSources` API. import helpers now use a private scope with explicit compatibility exports and a `window.TTVC.voiceSources` API.
- **Voice-clone namespace migration.** Clone audio loading/upload, microphone monitoring, design presets, and voice-design - **Voice-clone namespace migration.** Clone audio loading/upload, microphone monitoring, design presets, and voice-design

View File

@ -1 +1 @@
1.24.77 1.24.78

View File

@ -67,6 +67,7 @@ Done incrementally as global-scope ordered files (no ES-module change needed)
- ✅ TTS preview and performance-history helpers use a private scope with explicit preview/history compatibility exports. - ✅ TTS preview and performance-history helpers use a private scope with explicit preview/history compatibility exports.
- ✅ Voice-clone audio, recording, and design controls use a private scope with explicit compatibility exports. - ✅ Voice-clone audio, recording, and design controls use a private scope with explicit compatibility exports.
- ✅ Voice-source discovery and import helpers use a private scope with explicit source-list/import compatibility exports. - ✅ Voice-source discovery and import helpers use a private scope with explicit source-list/import compatibility exports.
- ✅ TTS routing configuration and routing-log UI use a private scope with live route/sound compatibility accessors.
- ✅ `static/css/resource-diagnostics.css` — isolated Performance/resource diagnostic panel styles. - ✅ `static/css/resource-diagnostics.css` — isolated Performance/resource diagnostic panel styles.
- ✅ `static/css/background-jobs.css` — isolated background-job history and retry-panel styles. - ✅ `static/css/background-jobs.css` — isolated background-job history and retry-panel styles.
- ✅ `static/css/voice-design.css` — isolated Voice Design form, samples, and preview-match styles. - ✅ `static/css/voice-design.css` — isolated Voice Design form, samples, and preview-match styles.

View File

@ -10,7 +10,7 @@
<meta name="format-detection" content="telephone=no"> <meta name="format-detection" content="telephone=no">
<meta name="color-scheme" content="light dark"> <meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#2563EB"> <meta name="theme-color" content="#2563EB">
<meta name="app-version" content="1.24.77"> <meta name="app-version" content="1.24.78">
<link rel="manifest" href="/manifest.webmanifest"> <link rel="manifest" href="/manifest.webmanifest">
<link rel="icon" href="/static/icon.svg" type="image/svg+xml"> <link rel="icon" href="/static/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/static/icon.svg"> <link rel="apple-touch-icon" href="/static/icon.svg">
@ -27,12 +27,12 @@
<!-- ── Core styles (local — no CDN dependency for first paint) ────────── --> <!-- ── Core styles (local — no CDN dependency for first paint) ────────── -->
<link rel="stylesheet" href="/static/vendor/mdi/materialdesignicons.min.css"> <link rel="stylesheet" href="/static/vendor/mdi/materialdesignicons.min.css">
<link rel="stylesheet" href="/static/style.css?v=1.24.77"> <link rel="stylesheet" href="/static/style.css?v=1.24.78">
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.77"> <link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.78">
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.77"> <link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.78">
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.77"> <link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.78">
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.77"> <link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.78">
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.77"> <link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.78">
<!-- ── Flag icons — non-blocking (loaded async, icons appear after JS) ── --> <!-- ── Flag icons — non-blocking (loaded async, icons appear after JS) ── -->
@ -397,7 +397,7 @@ window.toggleNavTree = function(treeId, chevronId) {
</script> </script>
<!-- loader.js: fetches sections → loads JS modules → removes skeleton --> <!-- loader.js: fetches sections → loads JS modules → removes skeleton -->
<script src="/static/loader.js?v=1.24.77"></script> <script src="/static/loader.js?v=1.24.78"></script>
</body> </body>
</html> </html>

View File

@ -1,5 +1,7 @@
// ── TTS routing ────────────────────────────────────────────────────────── // ── TTS routing ──────────────────────────────────────────────────────────
(function (root) {
let _ttsRoutes = []; let _ttsRoutes = [];
// Any / Auto first (they are the routing-specific values), then every language // Any / Auto first (they are the routing-specific values), then every language
// from the shared list in utils.js — the old hardcoded eight could not express // from the shared list in utils.js — the old hardcoded eight could not express
@ -643,3 +645,28 @@ $('routing-sound-list')?.addEventListener('click', e => {
} }
}); });
Object.assign(root, {
ROUTE_LANGS, _routingSetStatus, routeSelectOptions, enhanceRouteLangSelects,
ROUTE_BACKENDS, _routeSounds, routeSoundOptions, loadRouteSounds,
_routeSoundPickerTarget, _routeSoundPlayingButton, routeSoundUrl,
setRouteSoundField, renderRouteSoundBrowser, openRouteSoundBrowser,
closeRouteSoundBrowser, playRouteSound, ROUTE_SPEED_PREVIEW_TEXT,
previewRouteSpeed, _routeSpeedPreviewButton, useRouteSound, routeBackendOptions,
refreshRoutingVoiceOptions, newRoute, renderRoutingList, readRoutingForm,
loadRoutingTab, saveRoutingTab, renderRouteTestResult, routingLogTime,
routingLogBadge, routingLogMeta, _routingLogItems, _routingLogFilter,
routingLogPassesFilter, renderCurrentRoutingLog, renderRoutingLog, loadRoutingLog,
clearRoutingLog, testRouting, uploadRouteSoundForRow,
});
Object.defineProperty(root, '_ttsRoutes', { configurable: true, get: () => _ttsRoutes, set: v => { _ttsRoutes = v; } });
root.TTVC = root.TTVC || {};
root.TTVC.routing = root.TTVC.routing || {};
Object.assign(root.TTVC.routing, {
get routes() { return _ttsRoutes; },
get sounds() { return _routeSounds; },
load: loadRoutingTab,
save: saveRoutingTab,
test: testRouting,
render: renderRoutingList,
});
})(window);