// Tiny browser-local (localStorage) preference helpers shared by the // dashboard's /settings.html and the per-agent page — both need the // exact same key name to actually talk to each other via the browser's // shared per-origin storage (settings.html is where the operator sets // the preference; every per-agent page's terminal reads it), so the // get/set pair — and the key itself — live here once rather than as // independent copies in each package that could drift out of sync. const EXPAND_DETAILS_KEY = 'hive-agent-expand-details'; // Whether a per-agent terminal's otherwise-collapsed `
` panels // (long tool-results, Write/Edit diffs, …) should default open. Pure // client-side — no backend field, nothing round-trips through // `/api/*`. Read live (not cached) by the shared terminal factory's // `expandDetails` option — see docs/web-ui/shape.md::Shared terminal // pane — so a preference change on /settings.html applies to the next // rendered row in any already-open agent tab without a reload. export function getExpandDetailsPref() { try { return localStorage.getItem(EXPAND_DETAILS_KEY) === '1'; } catch { return false; } } export function setExpandDetailsPref(v) { try { if (v) localStorage.setItem(EXPAND_DETAILS_KEY, '1'); else localStorage.removeItem(EXPAND_DETAILS_KEY); } catch { /* localStorage unavailable — preference is session-only */ } }