refactor: scope audiobook state modules
This commit is contained in:
parent
2aca152fe8
commit
cc4fc4ae2e
@ -8,6 +8,8 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
|
|||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
- **Stateful Audiobook namespace migration.** Casting/recast orchestration and preview/export now keep internal helpers
|
||||||
|
private and publish their public compatibility surface explicitly through `window.TTVC.audiobook`.
|
||||||
- **Pure leaf namespace migration.** Rehearser parsing/training and Audiobook parsing/segmentation helpers now keep
|
- **Pure leaf namespace migration.** Rehearser parsing/training and Audiobook parsing/segmentation helpers now keep
|
||||||
declarations private and publish explicit compatibility exports alongside their `window.TTVC` APIs.
|
declarations private and publish explicit compatibility exports alongside their `window.TTVC` APIs.
|
||||||
- **P1 architecture audit.** Marked the incremental frontend modularization complete: all planned Audiobook/Rehearser
|
- **P1 architecture audit.** Marked the incremental frontend modularization complete: all planned Audiobook/Rehearser
|
||||||
|
|||||||
@ -48,6 +48,7 @@ Done incrementally as global-scope ordered files (no ES-module change needed)
|
|||||||
- ✅ `audiobook-cast.js` — cast Markdown export, legacy page-stamping migration, deterministic speaker/sentence/duplicate/alias normalization helpers, and the live cast-view renderer.
|
- ✅ `audiobook-cast.js` — cast Markdown export, legacy page-stamping migration, deterministic speaker/sentence/duplicate/alias normalization helpers, and the live cast-view renderer.
|
||||||
- ✅ `audiobook-pipeline.js` — LLM casting, unknown-speaker recast, automatic repair, and cast-view orchestration.
|
- ✅ `audiobook-pipeline.js` — LLM casting, unknown-speaker recast, automatic repair, and cast-view orchestration.
|
||||||
- ✅ `audiobook-preview-export.js` — editable cast preview, Rehearser handoff, chapter-aware export, and export browsing.
|
- ✅ `audiobook-preview-export.js` — editable cast preview, Rehearser handoff, chapter-aware export, and export browsing.
|
||||||
|
- ✅ Stateful Audiobook modules use private scopes with explicit legacy exports; their public APIs are namespace-tested.
|
||||||
- ✅ `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.
|
||||||
|
|||||||
@ -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.57">
|
<meta name="app-version" content="1.24.58">
|
||||||
<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.57">
|
<link rel="stylesheet" href="/static/style.css?v=1.24.58">
|
||||||
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.57">
|
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.58">
|
||||||
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.57">
|
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.58">
|
||||||
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.57">
|
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.58">
|
||||||
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.57">
|
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.58">
|
||||||
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.57">
|
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.58">
|
||||||
|
|
||||||
|
|
||||||
<!-- ── 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.57"></script>
|
<script src="/static/loader.js?v=1.24.58"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
// Audiobook LLM casting and recast orchestration.
|
// Audiobook LLM casting and recast orchestration.
|
||||||
// Loaded after cast helpers and before audiobook.js; dependencies resolve at call time.
|
// Loaded after cast helpers and before audiobook.js; dependencies resolve at call time.
|
||||||
|
(function (root) {
|
||||||
|
|
||||||
// Every long-running audiobook action opens with a "already running?" guard.
|
// Every long-running audiobook action opens with a "already running?" guard.
|
||||||
// They all used to `return` in silence, so clicking Recast / Verify / Export
|
// They all used to `return` in silence, so clicking Recast / Verify / Export
|
||||||
@ -1060,9 +1061,16 @@ async function audiobookCast(overrideUrl, overrideModel, resume) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
window.TTVC=window.TTVC||{};
|
root._abBusyGuard = _abBusyGuard;
|
||||||
window.TTVC.audiobook=window.TTVC.audiobook||{};
|
root.audiobookRecastUnknown = audiobookRecastUnknown;
|
||||||
Object.assign(window.TTVC.audiobook,{
|
root.audiobookAutoRepairEnabled = audiobookAutoRepairEnabled;
|
||||||
|
root.audiobookAutoRepairCast = audiobookAutoRepairCast;
|
||||||
|
root.audiobookRecastUntilThreshold = audiobookRecastUntilThreshold;
|
||||||
|
root.audiobookOpenCastView = audiobookOpenCastView;
|
||||||
|
root.audiobookCast = audiobookCast;
|
||||||
|
root.TTVC=root.TTVC||{};
|
||||||
|
root.TTVC.audiobook=root.TTVC.audiobook||{};
|
||||||
|
Object.assign(root.TTVC.audiobook,{
|
||||||
startCast:audiobookCast,
|
startCast:audiobookCast,
|
||||||
openCastView:audiobookOpenCastView,
|
openCastView:audiobookOpenCastView,
|
||||||
recastUnknown:audiobookRecastUnknown,
|
recastUnknown:audiobookRecastUnknown,
|
||||||
@ -1072,4 +1080,5 @@ Object.assign(window.TTVC.audiobook,{
|
|||||||
openCastView:audiobookOpenCastView,
|
openCastView:audiobookOpenCastView,
|
||||||
autoRepair:audiobookAutoRepairCast,
|
autoRepair:audiobookAutoRepairCast,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
})(window);
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
// Audiobook cast preview, Rehearser handoff, and chapter export UI.
|
// Audiobook cast preview, Rehearser handoff, and chapter export UI.
|
||||||
// Loaded after the casting pipeline and before audiobook.js; dependencies resolve at call time.
|
// Loaded after the casting pipeline and before audiobook.js; dependencies resolve at call time.
|
||||||
|
(function (root) {
|
||||||
|
|
||||||
// ── Editable attribution preview ─────────────────────────────────────────────
|
// ── Editable attribution preview ─────────────────────────────────────────────
|
||||||
|
|
||||||
@ -771,9 +772,18 @@ async function audiobookBrowseExports() {
|
|||||||
$('reh-tb-browse-exports')?.addEventListener('click', audiobookBrowseExports);
|
$('reh-tb-browse-exports')?.addEventListener('click', audiobookBrowseExports);
|
||||||
|
|
||||||
|
|
||||||
window.TTVC=window.TTVC||{};
|
root.audiobookOpenCurrentInRehearser = audiobookOpenCurrentInRehearser;
|
||||||
window.TTVC.audiobook=window.TTVC.audiobook||{};
|
root.audiobookShowPreview = audiobookShowPreview;
|
||||||
Object.assign(window.TTVC.audiobook,{
|
root.audiobookApplyPreviewAndOpen = audiobookApplyPreviewAndOpen;
|
||||||
|
root.audiobookBuildScript = audiobookBuildScript;
|
||||||
|
root.audiobookOpenInRehearser = audiobookOpenInRehearser;
|
||||||
|
root.audiobookIsChapter = audiobookIsChapter;
|
||||||
|
root.audiobookLineVoice = audiobookLineVoice;
|
||||||
|
root.audiobookExport = audiobookExport;
|
||||||
|
root.audiobookBrowseExports = audiobookBrowseExports;
|
||||||
|
root.TTVC=root.TTVC||{};
|
||||||
|
root.TTVC.audiobook=root.TTVC.audiobook||{};
|
||||||
|
Object.assign(root.TTVC.audiobook,{
|
||||||
preview:{
|
preview:{
|
||||||
show:audiobookShowPreview,
|
show:audiobookShowPreview,
|
||||||
apply:audiobookApplyPreviewAndOpen,
|
apply:audiobookApplyPreviewAndOpen,
|
||||||
@ -783,5 +793,5 @@ Object.assign(window.TTVC.audiobook,{
|
|||||||
export:audiobookExport,
|
export:audiobookExport,
|
||||||
browse:audiobookBrowseExports,
|
browse:audiobookBrowseExports,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
})(window);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user