diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f279eb..5ae0b2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi ## [Unreleased] ### Changed +- **Character library namespace migration.** SQLite-backed character persistence, identity merging, image updates, and + rendering now use a private scope with explicit compatibility exports and a `window.TTVC.characters` API. - **Studio namespace migration.** Four-phase navigation, DOM borrowing, resume state, and cast-footer coordination now use a private scope with explicit compatibility exports and a tested `window.TTVC.studio` surface. - **Rehearser cast namespace migration.** Cast view rendering, filtering, sorting, and delegated controls now use a diff --git a/TODO.md b/TODO.md index c5adda5..f5ecdac 100644 --- a/TODO.md +++ b/TODO.md @@ -124,9 +124,9 @@ architecture change: the larger Audiobook/Rehearser/style split. voice design, I/O, library, stage, and recording blocks plus Audiobook casting, preview, export, and feature styles are isolated. Core Reader state and compatibility event wiring remain ordered in the legacy entry points. - [x] Extract Rehearser stage display and cast-sidebar controls into `rehearser-stage.js`. -- [ ] Replace broad globals with namespaces such as `window.TTVC.audiobook`; pure leaves, Audiobook state/core modules, - Reader, and Rehearser state modules now use private scopes with explicit compatibility exports. Remaining utility and - library modules still require the same responsibility-by-responsibility migration. +- [ ] Replace broad globals with namespaces such as `window.TTVC.audiobook`; pure leaves, Audiobook/Reader/Rehearser + feature modules, Studio, and character-library persistence now use private scopes with explicit compatibility exports. + Remaining utility and legacy library UI modules still require the same responsibility-by-responsibility migration. - [x] Generate the feature-module list for `loader.js` and `scripts/minify.mjs` from one shared manifest; larger responsibility splits remain. - [x] Add a dependency-free frontend syntax and top-level declaration collision gate (`npm run check:frontend`); diff --git a/VERSION b/VERSION index 0e70316..3dacc6b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.24.72 +1.24.73 diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index c701594..acbd066 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -62,6 +62,7 @@ Done incrementally as global-scope ordered files (no ES-module change needed) - ✅ Rehearser voice-design uses a private scope with explicit development and backend-refresh compatibility exports. - ✅ Rehearser cast rendering uses a private scope with explicit view/filter/sort compatibility exports. - ✅ Studio navigation and DOM-borrowing coordination use a private scope with explicit compatibility exports. +- ✅ Character library persistence and rendering use a private scope with explicit identity/image 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. diff --git a/static/index.html b/static/index.html index 64487a8..f73127b 100644 --- a/static/index.html +++ b/static/index.html @@ -10,7 +10,7 @@ - + @@ -27,12 +27,12 @@ - - - - - - + + + + + + @@ -397,7 +397,7 @@ window.toggleNavTree = function(treeId, chevronId) { - + diff --git a/static/js/characters-library.js b/static/js/characters-library.js index 716ed91..6af6a30 100644 --- a/static/js/characters-library.js +++ b/static/js/characters-library.js @@ -4,6 +4,8 @@ // All function signatures are unchanged from the IndexedDB version so callers // (audiobook.js, character-sheets.js, etc.) need no edits. +(function (root) { + // Fields a user can edit, mirroring CS_SCALAR_FIELDS plus the labelled basics. const CL_EDIT_FIELDS = [ ['name', 'Name'], ['aliases', 'Aliases / also known as'], ['first_name', 'First name'], ['last_name', 'Last name'], ['title', 'Title / role'], @@ -535,3 +537,23 @@ window.clUpsert = clUpsert; window.clGetAll = clGetAll; window.clPut = clPut; window.clGetAllByTagOrBook = clGetAllByTagOrBook; + +Object.assign(root, { + CL_EDIT_FIELDS, clGetAll, clGet, clPut, clDelete, clKey, clHslToHex, clNameHue, + clNormalizeColor, CL_IDENTITY_FIELDS, CL_ALIAS_MAX_TOKENS, CL_ALIAS_MAX_CHARS, + CL_ALIAS_STOPWORDS, clSplitIdentityTokens, clIdentityNames, clMergeAliases, + clSameIdentity, _clStr, _clSanitize, clMergeSheet, clMergeTags, clUpsert, + clSetImage, clGetAllByTagOrBook, clUpsertMany, _clIdbGetAll, _clRecords, + clRender, clAllProductions, clApplyFilter, clCardHtml, clEdit, clDeleteRec, +}); +root.TTVC = root.TTVC || {}; +root.TTVC.characters = root.TTVC.characters || {}; +Object.assign(root.TTVC.characters, { + list: clGetAll, + get: clGet, + upsert: clUpsert, + upsertMany: clUpsertMany, + setImage: clSetImage, + render: clRender, +}); +})(window);