From 98daa479ede981faf68351354d67c40c86a0a57a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zge=20G=C3=BCner?= Date: Thu, 13 Aug 2026 10:30:42 +0200 Subject: [PATCH 1/2] fix(search-config): save sessions as REUSABLE (global) by choice, default on MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Saving a Search Session defaulted to per-file unless every config was already global — so sessions were usually stuck to one file and 'not reusable'. Now the save asks scope (OK = reusable on all files / Cancel = this file only), defaulting to reusable. Global sessions already load + apply on any file (the store supports both); this just lets the user actually create one. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/renderer/renderer.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/renderer/renderer.ts b/src/renderer/renderer.ts index c1909b4..5378036 100644 --- a/src/renderer/renderer.ts +++ b/src/renderer/renderer.ts @@ -14479,8 +14479,12 @@ async function saveCurrentAsSearchConfigSession(): Promise { const name = await showTextInputModal('Save Search Session', 'Session Name', 'e.g., Error investigation, Auth flow...'); if (!name) return; - // Default: global if all configs are global, local otherwise - const allGlobal = state.searchConfigs.every(c => c.isGlobal); + // Scope: default REUSABLE (global → the session appears on and applies to ANY log file). + // Cancel = save it only for this file. (Was: global only if every config was already global, + // which meant sessions were usually stuck per-file and not reusable.) + const makeGlobal = window.confirm( + 'Save this Search Session as REUSABLE on ALL log files?\n\nOK = reusable (all files)\nCancel = only this file', + ); const session: SearchConfigSessionDef = { id: `scs-${Date.now()}`, @@ -14489,7 +14493,7 @@ async function saveCurrentAsSearchConfigSession(): Promise { const { ...def } = c; return def; }), - isGlobal: allGlobal, + isGlobal: makeGlobal, createdAt: Date.now(), }; From 125d51d55406b59ed4e9ff937b37b1c64556b2d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zge=20G=C3=BCner?= Date: Thu, 13 Aug 2026 10:36:57 +0200 Subject: [PATCH 2/2] feat(search-config): right-click 'Make reusable' to promote existing sessions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Complements the save-scope default: an existing per-file session can be flipped to reusable (global) — or back to file-only — from its right-click menu, without re-saving. Deletes from the current store + saves into the other. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/renderer/renderer.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/renderer/renderer.ts b/src/renderer/renderer.ts index 5378036..f1791b5 100644 --- a/src/renderer/renderer.ts +++ b/src/renderer/renderer.ts @@ -14571,7 +14571,21 @@ function showSearchConfigSessionContextMenu(e: MouseEvent, session: SearchConfig } }); + // Promote/demote scope so an existing session can be made reusable across files + // (or pinned back to this file) without re-saving. + const scopeItem = document.createElement('button'); + scopeItem.className = 'sc-context-menu-item'; + scopeItem.textContent = session.isGlobal ? 'Make file-only' : 'Make reusable (all files)'; + scopeItem.addEventListener('click', async () => { + menu.remove(); + await window.api.searchConfigSessionDelete(session.id, session.isGlobal); // remove from current store + session.isGlobal = !session.isGlobal; + const result = await window.api.searchConfigSessionSave(session); // save into the other store + if (result.success) await loadSearchConfigSessions(); + }); + menu.appendChild(renameItem); + menu.appendChild(scopeItem); menu.appendChild(deleteItem); document.body.appendChild(menu);