Edit JSON node settings in a dialog from a one-line preview

A free setting typed json and a declared object or array setting (a Switch
node's rules, HTTP headers) show one line of their value; clicking opens a
Monaco JSON editor in a dialog that saves only once the text parses.
Declared object settings were not shown at all before. Escape in a dialog
opened from a side panel no longer closes the panel too.
This commit is contained in:
2026-10-05 23:49:42 +02:00
parent 6fe59347e0
commit 5a145b8f59
6 changed files with 192 additions and 14 deletions
+3 -1
View File
@@ -228,7 +228,9 @@ export function SidePanel({
useEffect(() => {
if (!open) return
const onKey = (event: KeyboardEvent) => {
if (event.key === "Escape") onClose()
// A dialog opened from the panel closes on its own Escape and marks it
// handled; that one press should not take the panel with it.
if (event.key === "Escape" && !event.defaultPrevented) onClose()
}
window.addEventListener("keydown", onKey)
return () => window.removeEventListener("keydown", onKey)