swarm-ui: hives are a folded card on the agents page, and hide developer details also hides the components tab
The hives nav tab and route go, with no redirect; the roster is a card above the agents panel that starts folded and is read on the first open. The settings toggle is renamed from hide debug output to hide developer details, as it now also drops the components tab (the page still answers at /components); the stored preference keeps its key.
This commit is contained in:
parent
0cbfa806d3
commit
70917b7dd0
1 changed files with 110 additions and 49 deletions
17
frontend/packages/swarm-ui/src/shell/useHideDebug.ts
Normal file
17
frontend/packages/swarm-ui/src/shell/useHideDebug.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// The "hide developer details" preference as a value that follows its toggle:
|
||||
// this tab's, through `setHideDebugPref`, and another tab's, through the
|
||||
// `storage` event. The header uses it to hide the components tab.
|
||||
import { useEffect, useState } from "preact/hooks";
|
||||
import {
|
||||
getHideDebugPref,
|
||||
subscribeHideDebugPref,
|
||||
} from "@hive/shared/prefs.js";
|
||||
|
||||
export function useHideDebug(): boolean {
|
||||
const [hide, setHide] = useState(getHideDebugPref);
|
||||
useEffect(
|
||||
() => subscribeHideDebugPref(() => setHide(getHideDebugPref())),
|
||||
[],
|
||||
);
|
||||
return hide;
|
||||
}
|
||||
Loading…
Reference in a new issue