// The workflow graph's expansion preference. The graph is expanded by default; // collapsing it is a deliberate choice and is remembered across reloads, so the // operator's next visit opens the graph the way they left it. export const GRAPH_EXPANDED_KEY = "pipelines.web.graphExpanded.v1"; /** True unless the operator collapsed the graph (a missing value means default). */ export function readGraphExpanded(storage = globalThis.localStorage) { try { return storage?.getItem(GRAPH_EXPANDED_KEY) !== "0"; } catch { return true; } } export function writeGraphExpanded(value, storage = globalThis.localStorage) { try { storage?.setItem(GRAPH_EXPANDED_KEY, value ? "1" : "0"); } catch { // Storage may be unavailable; the in-memory choice still applies. } }