From 18e586d06f519712e4b1b7f1dc602bd5e549c4c3 Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Fri, 4 Sep 2026 13:42:02 +0200 Subject: [PATCH] refactor: scope conversation state --- CHANGELOG.md | 2 ++ VERSION | 2 +- docs/ARCHITECTURE.md | 1 + static/index.html | 16 ++++++++-------- static/js/conversation.js | 10 ++++++++++ 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfc4211..a3814ef 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 +- **Conversation/log namespace migration.** Settings log state and About rendering helpers now use a private scope with + compatibility exports and a `window.TTVC.conversation` API. - **i18n namespace migration.** Language dictionaries and mutable language state now use a private scope with compatibility exports and a `window.TTVC.i18n` API. - **Audiobook-cast namespace migration.** Cast serialization, page stamping, and speaker normalization now use a private diff --git a/VERSION b/VERSION index 1d5543b..6241735 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.24.96 +1.24.97 diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 616ea5e..411be82 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -84,6 +84,7 @@ Done incrementally as global-scope ordered files (no ES-module change needed) - ✅ 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. - ✅ i18n dictionaries and language state use a private scope with compatibility exports and a namespace API. +- ✅ Conversation settings/log state and About helpers use a private scope with compatibility exports and 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. diff --git a/static/index.html b/static/index.html index 1056dd9..902d7e5 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/conversation.js b/static/js/conversation.js index 7d60c8f..d9d0f5c 100644 --- a/static/js/conversation.js +++ b/static/js/conversation.js @@ -1,4 +1,5 @@ // ── Settings: Logs ──────────────────────────────────────────────────────── +(function (root) { let _logsLiveTimer = null; let _logsActiveLevel = ''; @@ -1289,3 +1290,12 @@ $('s-import-voices-file')?.addEventListener('change', async function () { try { if (localStorage.getItem(KEY) === '1') setCollapsed(true); } catch (_) {} })(); })(); + +Object.assign(root, { escLog, renderSettingsAbout }); +root.TTVC = root.TTVC || {}; +root.TTVC.conversation = root.TTVC.conversation || {}; +Object.assign(root.TTVC.conversation, { + loadSettingsLogs: root.loadSettingsLogs, + renderSettingsAbout, +}); +})(window);