refactor: scope cast compatibility modules

This commit is contained in:
mARTin-B78 2026-09-04 13:38:40 +02:00
parent 542f44fbb8
commit ee4208ec51
6 changed files with 38 additions and 9 deletions

View File

@ -8,6 +8,10 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
## [Unreleased]
### Changed
- **Audiobook-cast namespace migration.** Cast serialization, page stamping, and speaker normalization now use a private
scope with compatibility exports and the existing `window.TTVC.audiobook.cast` API.
- **SillyTavern namespace migration.** Character-card parsing, import, and export helpers now use a private scope with
compatibility exports and a `window.TTVC.sillyTavern` API.
- **Seed-finder namespace migration.** Seed sample generation, caching, and batch controls now use a private scope with
compatibility exports and a `window.TTVC.seedFinder` API.
- **Character-column namespace migration.** Character-table metadata, persisted column visibility, and completeness

View File

@ -1 +1 @@
1.24.94
1.24.95

View File

@ -81,6 +81,8 @@ Done incrementally as global-scope ordered files (no ES-module change needed)
- ✅ Shared utility helpers use a private scope with explicit compatibility exports and a `window.TTVC.utils` API.
- ✅ Character-table metadata and column/completeness helpers use a private scope with a namespace API.
- ✅ Seed-finder generation and caching helpers use a private scope with compatibility exports and a namespace API.
- ✅ Audiobook cast serialization and speaker normalization use a private scope with the existing cast namespace API.
- ✅ SillyTavern character-card import/export helpers use a private scope with a namespace API.
- ✅ `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/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="color-scheme" content="light dark">
<meta name="theme-color" content="#2563EB">
<meta name="app-version" content="1.24.94">
<meta name="app-version" content="1.24.95">
<link rel="manifest" href="/manifest.webmanifest">
<link rel="icon" href="/static/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/static/icon.svg">
@ -27,12 +27,12 @@
<!-- ── Core styles (local — no CDN dependency for first paint) ────────── -->
<link rel="stylesheet" href="/static/vendor/mdi/materialdesignicons.min.css">
<link rel="stylesheet" href="/static/style.css?v=1.24.94">
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.94">
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.94">
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.94">
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.94">
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.94">
<link rel="stylesheet" href="/static/style.css?v=1.24.95">
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.95">
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.95">
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.95">
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.95">
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.95">
<!-- ── Flag icons — non-blocking (loaded async, icons appear after JS) ── -->
@ -397,7 +397,7 @@ window.toggleNavTree = function(treeId, chevronId) {
</script>
<!-- loader.js: fetches sections → loads JS modules → removes skeleton -->
<script src="/static/loader.js?v=1.24.94"></script>
<script src="/static/loader.js?v=1.24.95"></script>
</body>
</html>

View File

@ -2,6 +2,8 @@
// Live casting remains in audiobook.js; these deterministic export/migration
// helpers have no casting-state side effects and can be loaded independently.
(function (root) {
function _abCastMarkdown(data) {
const payload = data || {};
const segments = Array.isArray(payload.segments) ? payload.segments : [];
@ -3495,3 +3497,11 @@ window.TTVC.audiobook.cast = {
dropPhantomSpeakers: _audiobookDropPhantomSpeakers,
consolidateSpeakerAliases: _audiobookConsolidateSpeakerAliases,
};
Object.assign(root, {
_abCastMarkdown, _abStampSegmentPages, audiobookCastView,
_audiobookMergeAdjacentSameSpeaker, _audiobookMergeAdjacentDialogue,
_audiobookMergeSplitSentences, _audiobookDedupNearbyDuplicates,
_audiobookDropPhantomSpeakers, _audiobookConsolidateSpeakerAliases,
});
})(window);

View File

@ -1,4 +1,5 @@
// ── SillyTavern character-card compatibility ──────────────────────────────────
(function (root) {
//
// Import and export characters in SillyTavern / TavernAI "Character Card" format
// so a cast built here can be moved to/from SillyTavern (and the wider ecosystem
@ -188,3 +189,15 @@ window.stFromRecord = stFromRecord;
window.stImportCards = stImportCards;
window.stImportDialog = stImportDialog;
window.stExportRecord = stExportRecord;
root.TTVC = root.TTVC || {};
root.TTVC.sillyTavern = root.TTVC.sillyTavern || {};
Object.assign(root.TTVC.sillyTavern, {
parseFile: stParseFile,
toSheet: stToSheet,
fromRecord: stFromRecord,
importCards: stImportCards,
importDialog: stImportDialog,
exportRecord: stExportRecord,
});
})(window);