From 0e615d52debf0991b48cef4b846ce5a2f918aa84 Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Fri, 4 Sep 2026 12:47:30 +0200 Subject: [PATCH] refactor: scope studio module --- CHANGELOG.md | 2 ++ VERSION | 2 +- docs/ARCHITECTURE.md | 1 + static/index.html | 16 ++++++++-------- static/js/studio.js | 20 ++++++++++++++++++++ 5 files changed, 32 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b545a9e..8f279eb 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 +- **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 private scope with explicit compatibility exports and the existing cast namespace. - **Rehearser voice-design namespace migration.** Character development and backend-refresh controls now use a private diff --git a/VERSION b/VERSION index 210789c..0e70316 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.24.71 +1.24.72 diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index ec7ca60..c701594 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -61,6 +61,7 @@ Done incrementally as global-scope ordered files (no ES-module change needed) - ✅ Rehearser voice-picker uses a private scope with explicit preview, search, and assignment compatibility exports. - ✅ 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. - ✅ `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 e205f87..64487a8 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/studio.js b/static/js/studio.js index e8936c1..512be60 100644 --- a/static/js/studio.js +++ b/static/js/studio.js @@ -11,6 +11,8 @@ // the same element ids would collide; physically relocating the existing // node (same id, same listeners) does not. +(function (root) { + const STUDIO_RESUME_KEY = 'ttsvc_studio_resume'; let _stuActive = 1; @@ -595,3 +597,21 @@ function studioOnShow() { showStudioPhase(_stuActive); } window.studioOnShow = studioOnShow; + +Object.assign(root, { + STUDIO_RESUME_KEY, _stuActive, _stuReadResume, _stuSaveResume, _stuHomes, + _stuBorrow, _stuReturnAll, _stuIsActive, _stuAllowNextNav, _STU_BORROWED_FROM, + _stuNavGuardInstalled, _stuInstallNavGuardOnce, _stuCallSuppressingNav, + _stuEnterPhase, _stuSyncModeToggle, _stuCastView, _stuShowCastView, + _stuCastFootObserver, _stuCastFootHealthTimer, _stuCastIsRunning, + _stuSyncCastFallbackControls, _stuRelocateCastFoot, _stuTryRelocateCastFoot, + _stuRestoreCastFoot, showStudioPhase, studioOnShow, +}); +root.TTVC = root.TTVC || {}; +root.TTVC.studio = root.TTVC.studio || {}; +Object.assign(root.TTVC.studio, { + state: { get activePhase() { return _stuActive; }, get active() { return _stuIsActive; } }, + showPhase: showStudioPhase, + onShow: studioOnShow, +}); +})(window);