From 0af86b667e79c397c6bc30052c584e5c5051651b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20G=C3=B3mez?= Date: Tue, 31 Mar 2026 09:03:19 +0200 Subject: [PATCH] fix: make sure condensed view works in pop out windows --- .nsite/config.json | 19 ++++++++++++------- src/components/ReqViewer.tsx | 8 ++++---- src/lib/command-reconstructor.ts | 5 +++++ 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.nsite/config.json b/.nsite/config.json index c2fda89..44f0a99 100644 --- a/.nsite/config.json +++ b/.nsite/config.json @@ -17,7 +17,12 @@ "title": "grimoire", "description": "a nostr client for magicians", "publishAppHandler": false, - "profile": { "name": "grimoire", "about": "a nostr client for magicians", "picture": "https://grimoire.rocks/favicon.ico", "website": "https://grimoire.rocks" }, + "profile": { + "name": "grimoire", + "about": "a nostr client for magicians", + "picture": "https://grimoire.rocks/favicon.ico", + "website": "https://grimoire.rocks" + }, "appHandler": { "id": "k50nvf8d85", "kinds": [777, 10777, 30777], @@ -26,12 +31,12 @@ "icon": "https://grimoire.rocks/favicon.ico", "platforms": { "web": { - "patterns": [ - { - "url": "https://grimoire.rocks/", - "entities": ["npub", "nprofile", "nevent", "naddr"] - } - ] + "patterns": [ + { + "url": "https://grimoire.rocks/", + "entities": ["npub", "nprofile", "nevent", "naddr"] + } + ] } } } diff --git a/src/components/ReqViewer.tsx b/src/components/ReqViewer.tsx index 7c3a827..8f89f1c 100644 --- a/src/components/ReqViewer.tsx +++ b/src/components/ReqViewer.tsx @@ -1135,13 +1135,15 @@ export default function ReqViewer({ }, [events, exportFilename]); const handleViewModeUpdate = () => { + const newViewMode = viewMode == "compact" ? "list" : "compact"; + setViewMode(newViewMode); + + // Update global state if window exists (not available in pop-out mode) const windowState = state.windows[windowId]; if (!windowState) return; let { commandString } = windowState; - const newViewMode = viewMode == "compact" ? "list" : "compact"; - if (commandString && commandString.indexOf("--view") > -1) { if (newViewMode == "list") { commandString = commandString.replace("--view compact", "--view list"); @@ -1158,8 +1160,6 @@ export default function ReqViewer({ view: newViewMode, }, }); - - setViewMode(newViewMode); }; return ( diff --git a/src/lib/command-reconstructor.ts b/src/lib/command-reconstructor.ts index 890de6f..a79dec5 100644 --- a/src/lib/command-reconstructor.ts +++ b/src/lib/command-reconstructor.ts @@ -302,6 +302,11 @@ function reconstructReqCommand(props: any): string { parts.push("--search", filter.search); } + // View mode + if (props.view && props.view !== "list") { + parts.push("--view", props.view); + } + // Close on EOSE if (props.closeOnEose) { parts.push("--close-on-eose");