Watch
0
0
Fork
You've already forked hyperhive
0

hive ui: the dashboard wears the swarm UI's chrome, and its own header, tab strip and menu mounts go

The dashboard mounts @hive/shared's AppShell, the header, nav and settings menu the swarm UI has, from a new shell.js: the hive's name for the brand, the tabs agents, rebuild queue and kept state routed by the URL hash, the theme, motion and solid-background settings in this page's own browser storage, and the shared links and user menus. The three tab panes stay plain DOM, kept hidden in index.html and moved into the shell's content column by shell.js. The tabs, the hash-to-tab parse and the menu entries sit in shell-routes.js, which npm test covers (the dashboard package gets a test script). The old header, the createTabStrip tabbar, the leet tab names, the identity headline and title code, the sticky-top wrapper, the links-menu.js and user-menu.js mounts and their CSS are removed. The docs say the plain tab names and the new chrome.
This commit is contained in:
iris 2026-11-21 10:21:21 +01:00
commit 7707a257e9

View file

@ -0,0 +1,29 @@
// The hive UI's tab routing and menu entries. Run by `npm test`.
import assert from "node:assert/strict";
import { test } from "node:test";
import { TABS, menuLinks, tabOfHash } from "../src/shell-routes.js";
test("a hash that names a tab shows that tab, with or without the #", () => {
assert.equal(tabOfHash("#rebuild"), "rebuild");
assert.equal(tabOfHash("kept"), "kept");
assert.equal(tabOfHash("#agents"), "agents");
});
test("no hash, or one that names no tab, shows the first tab", () => {
assert.equal(tabOfHash(""), TABS[0].href);
assert.equal(tabOfHash("#"), TABS[0].href);
assert.equal(tabOfHash("#nope"), TABS[0].href);
});
test("the API docs are always linked and open in place", () => {
assert.deepEqual(menuLinks(null), [
{ icon: "🧬", label: "api docs", url: "/api/docs/", external: false },
]);
});
test("the swarm is linked only when the state names its address", () => {
assert.equal(menuLinks({}).length, 1);
const links = menuLinks({ swarm_public_url: "https://swarm.example" });
assert.equal(links.length, 2);
assert.equal(links[1].url, "https://swarm.example");
});