refactor: scope rehearser library

This commit is contained in:
mARTin-B78 2026-09-04 12:40:56 +02:00
parent 0ee43421b7
commit 7ee5f65e00
5 changed files with 19 additions and 13 deletions

View File

@ -8,6 +8,8 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
## [Unreleased]
### Changed
- **Rehearser library namespace migration.** SQLite persistence and the IndexedDB migration adapter now use a private
scope with explicit database compatibility exports and the existing library namespace.
- **Reader namespace migration.** PDF/TXT document state, playback, search, synthesis, and library APIs now use a
private implementation scope with explicit compatibility exports and a tested `window.TTVC.reader` surface.
- **Audiobook parser compatibility boundary.** Speech-heuristic constants consumed by the scoped Audiobook core are now

View File

@ -1 +1 @@
1.24.65
1.24.66

View File

@ -55,6 +55,7 @@ Done incrementally as global-scope ordered files (no ES-module change needed)
- ✅ Rehearser core uses a private scope with explicit state, pagination, and cast-management compatibility exports.
- ✅ Audiobook core uses a private scope with explicit reader-side state and handoff compatibility exports.
- ✅ Reader uses a private scope with explicit document, playback, and search compatibility exports.
- ✅ Rehearser library persistence uses a private scope with explicit SQLite/IndexedDB compatibility exports.
- ✅ `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.65">
<meta name="app-version" content="1.24.66">
<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.65">
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.65">
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.65">
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.65">
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.65">
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.65">
<link rel="stylesheet" href="/static/style.css?v=1.24.66">
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.66">
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.66">
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.66">
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.66">
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.66">
<!-- ── 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.65"></script>
<script src="/static/loader.js?v=1.24.66"></script>
</body>
</html>

View File

@ -3,6 +3,8 @@
// isolated from parsing, casting, and stage playback. Functions stay global
// during the compatibility migration because audiobook.js/library.js call them.
(function (root) {
async function rehDbGetAll() {
const r = await fetch('/api/rehearsals');
if (!r.ok) throw new Error('rehDbGetAll failed: ' + r.status);
@ -56,7 +58,8 @@ function _rehIdbGetAll() {
if (r.ok) console.log(`[rehearser] migrated ${(await r.json()).imported} records from IndexedDB → SQLite`);
} catch (e) { console.warn('[rehearser] migration skipped:', e); }
})();
window.rehDbGetById = rehDbGetById;
window.TTVC = window.TTVC || {};
window.TTVC.rehearser = window.TTVC.rehearser || {};
window.TTVC.rehearser.library = { rehDbGetAll, rehDbGetById, rehDbPut, rehDbDelete };
Object.assign(root, { rehDbGetAll, rehDbGetById, rehDbAdd, rehDbPut, rehDbDelete, _rehSanitize, _rehIdbGetAll });
root.TTVC = root.TTVC || {};
root.TTVC.rehearser = root.TTVC.rehearser || {};
root.TTVC.rehearser.library = { rehDbGetAll, rehDbGetById, rehDbAdd, rehDbPut, rehDbDelete };
})(window);