mara, #3778: the toggle lived on the separate hive-dashboard's /settings.html even though it's agent-terminal-only. Moved it into SettingsMenu (shared with swarm-ui) behind an opt-in showExpandDetails prop — only the agent page passes it, matching her caution that the component is shared but this setting isn't. Also found and fixed a real regression while touching this: the Preact rewrite's classifyEvent.ts hardcodes defaultOpen: true only for the always-open markdown-bearing rows (send/ask/answer/recv) and never reads the preference at all for the rows it's actually meant to control (diffs, plain tool output, long errors) — so the toggle currently has zero effect on the live page. Wired getExpandDetailsPref() into those four sites; the always-open rows are untouched, matching the documented pre-rewrite behavior. Converted prefs.js to prefs.ts (TS couldn't resolve types for a plain .js import) — same public @hive/shared/prefs.js export path, matching how badge.js/icons.js etc. already map a .js export name to a .tsx/.ts source file.
15 lines
680 B
JavaScript
15 lines
680 B
JavaScript
// /settings.html — operator-local preferences page.
|
|
//
|
|
// Extracted from the dashboard S3TT1NGS tab. The browser-notification
|
|
// toggle: NOTIF.bind() wires the enable / mute / unmute buttons and
|
|
// persists state to localStorage. The dashboard's NOTIF.show() calls
|
|
// (approvals) read that same localStorage state + the
|
|
// browser-level permission, so firing still works from the dashboard
|
|
// even though the toggle UI now lives on its own page.
|
|
//
|
|
// initServerWarnings() renders the shared top-of-page warnings banner,
|
|
// matching the other stand-alone pages (FL0W / L0GS / H0M3).
|
|
import { NOTIF, initServerWarnings } from './common.js';
|
|
|
|
initServerWarnings();
|
|
NOTIF.bind();
|