From f04d7eea6ed5a0bca3b30a4325d5cfcd7ac4ae88 Mon Sep 17 00:00:00 2001 From: Nick Beckley Date: Thu, 26 Nov 2026 16:42:54 +0000 Subject: [PATCH] Retain Names reference state when Context changes books within a series --- Docs/Codex/NamesWorkspace.md | 2 ++ PlotLine/wwwroot/js/context-names.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Docs/Codex/NamesWorkspace.md b/Docs/Codex/NamesWorkspace.md index 9681e89b..5fd6bc22 100644 --- a/Docs/Codex/NamesWorkspace.md +++ b/Docs/Codex/NamesWorkspace.md @@ -31,3 +31,5 @@ The pre-existing Names tab now mounts the same shared workspace. Its adapter onl ## Query plan stability Authenticated Development acceptance exposed a timeout when a cached catalogue plan was reused across different prefix/default/locale/usage filters on a small cast. Forward-only migration 333 recompiles the final catalogue statement for the current parameters, without changing matching, metadata, ordering or pagination. Migration 325 remains immutable. Qualification now alternates narrow and broad searches, locale/era criteria and assigned/available filters with a two-character cast, in addition to the 500-character fixture. The benchmark restores the latest procedure after measuring historical SQL, so tests do not leave the database on an earlier definition. + +Context Names state is keyed by series and pane, so switching books within the same series retains the author's search and selection. Requests still use the current authorised Context book; moving to another series uses independent state. diff --git a/PlotLine/wwwroot/js/context-names.js b/PlotLine/wwwroot/js/context-names.js index 46e82c57..707ee02e 100644 --- a/PlotLine/wwwroot/js/context-names.js +++ b/PlotLine/wwwroot/js/context-names.js @@ -4,7 +4,7 @@ window.PlotDirectorContextLifecycles.names={ mount(node,{paneId}){ const host=node.querySelector('[data-context-names]'),root=host?.querySelector('[data-names-workspace]');if(!root)return; - const book=host.dataset.book,key=book+':'+paneId; + const book=host.dataset.book,key=root.dataset.project+':'+paneId; root.dataset.searchUrl='/Writing/Context/Names/Search?contextBookId='+encodeURIComponent(book); root.dataset.detailsUrl='/Writing/Context/Names/Details?contextBookId='+encodeURIComponent(book); // A pane owns its reference-tool state. No manuscript-focus commands or SignalR connections.