refactor: scope character columns

This commit is contained in:
mARTin-B78 2026-09-04 13:35:10 +02:00
parent d2a8dd43b4
commit 10f618c179
5 changed files with 28 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
- **Character-column namespace migration.** Character-table metadata, persisted column visibility, and completeness
helpers now use a private scope with compatibility exports and a `window.TTVC.characterColumns` API.
- **Constrained character pagination.** Character-library pages now stop at 25 rendered characters on every device, - **Constrained character pagination.** Character-library pages now stop at 25 rendered characters on every device,
preserving incremental loading while keeping the large-cast DOM below the measured 5,000-node budget. preserving incremental loading while keeping the large-cast DOM below the measured 5,000-node budget.
- **Character pagination budget.** Character-library pages render bounded batches, - **Character pagination budget.** Character-library pages render bounded batches,

View File

@ -1 +1 @@
1.24.92 1.24.93

View File

@ -79,6 +79,7 @@ Done incrementally as global-scope ordered files (no ES-module change needed)
- ✅ Character-library rendering, detail, avatar, and generation actions use a private scope with compatibility exports and a namespace API. - ✅ Character-library rendering, detail, avatar, and generation actions use a private scope with compatibility exports and a namespace API.
- ✅ Voice-inspector selection state uses a private scope with a compatibility export and namespace API. - ✅ Voice-inspector selection state uses a private scope with a compatibility export and namespace API.
- ✅ Shared utility helpers use a private scope with explicit compatibility exports and a `window.TTVC.utils` API. - ✅ 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.
- ✅ `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.92"> <meta name="app-version" content="1.24.93">
<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.92"> <link rel="stylesheet" href="/static/style.css?v=1.24.93">
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.92"> <link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.93">
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.92"> <link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.93">
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.92"> <link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.93">
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.92"> <link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.93">
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.92"> <link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.93">
<!-- ── 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.92"></script> <script src="/static/loader.js?v=1.24.93"></script>
</body> </body>
</html> </html>

View File

@ -2,6 +2,8 @@
// Kept separate from the character renderer so table layout can evolve // Kept separate from the character renderer so table layout can evolve
// without making library-characters.js responsible for every table concern. // without making library-characters.js responsible for every table concern.
(function (root) {
const _CHAR_PROFILE_COMPLETENESS_FIELDS = [ const _CHAR_PROFILE_COMPLETENESS_FIELDS = [
'gender', 'age_estimate', 'race_species', 'languages', 'nationality_background', 'gender', 'age_estimate', 'race_species', 'languages', 'nationality_background',
'social_class', 'profession', 'title', 'archetype', 'physical', 'clothing', 'social_class', 'profession', 'title', 'archetype', 'physical', 'clothing',
@ -47,3 +49,17 @@ function _charProfileCompleteness(sheet) {
}).length; }).length;
return { filled: filled, total: _CHAR_PROFILE_COMPLETENESS_FIELDS.length }; return { filled: filled, total: _CHAR_PROFILE_COMPLETENESS_FIELDS.length };
} }
Object.assign(root, {
_CHAR_PROFILE_COMPLETENESS_FIELDS, _CHAR_TABLE_COLUMN_DEFS,
_charTableHiddenColumns, _applyCharTableColumns, _charProfileCompleteness,
});
root.TTVC = root.TTVC || {};
root.TTVC.characterColumns = root.TTVC.characterColumns || {};
Object.assign(root.TTVC.characterColumns, {
definitions: _CHAR_TABLE_COLUMN_DEFS,
hidden: _charTableHiddenColumns,
apply: _applyCharTableColumns,
completeness: _charProfileCompleteness,
});
})(window);