diff --git a/frontend/packages/dashboard/src/builds.html b/frontend/packages/dashboard/src/builds.html index 596b50ff..45ad8276 100644 --- a/frontend/packages/dashboard/src/builds.html +++ b/frontend/packages/dashboard/src/builds.html @@ -16,25 +16,12 @@ meta inputs, and build log history on one page. Carved out of the old /core.html (rebuild queue + meta inputs) and /logs.html (BUILD tab) so the full build lifecycle is in one place. Same minimal - chrome as /core.html — a `← home` back-link + a createTabStrip + chrome as /core.html — a `← home` back-link + a sub-tab nav. Default sub-tab is the rebuild queue. -->
diff --git a/frontend/packages/dashboard/src/builds.js b/frontend/packages/dashboard/src/builds.js index b3c5fc0f..3d719914 100644 --- a/frontend/packages/dashboard/src/builds.js +++ b/frontend/packages/dashboard/src/builds.js @@ -1,6 +1,6 @@ // BU1LDS page entry (/builds.html). The build lifecycle hub — rebuild // queue, live build log, meta inputs, and build log history on one page. -// Three sub-tabs via the shared createTabStrip (default = Rebuild Queue): +// Three sub-tabs via (default = Rebuild Queue): // - R3BU1LD QU3U3: pending + running rebuilds + live build log inline // - M3T4 1NPUTS: nix flake input selector + meta-update trigger // - BUILD L0GS: all-agents build log history (lazy-loaded on tab show) @@ -14,7 +14,7 @@ import { $, fmtAgeSecs, openStream, openBuildLogStream, initServerWarnings } fro import { el } from '@hive/shared/dom.js'; import { bindAsyncForms } from '@hive/shared/forms.js'; import { fmtAgo, fmtElapsed, fmtDuration, truncate } from './util.js'; -import { createTabStrip } from '@hive/shared/tabs.js'; +import '@hive/shared/hive-tab-strip.js'; // ─── derived state ─────────────────────────────────────────────────────────── let metaInputsState = []; @@ -777,7 +777,12 @@ async function init() { initServerWarnings(); bindAsyncForms(() => refreshState()); - buildTabs = createTabStrip(document.getElementById('builds-tabbar'), { + buildTabs = document.getElementById('builds-tabbar').configure({ + tabs: [ + { id: 'rebuild', label: 'R3BU1LD QU3U3', badgeId: 'builds-tab-count-rebuild' }, + { id: 'meta', label: 'M3T4 1NPUTS' }, + { id: 'buildlogs', label: 'BUILD L0GS' }, + ], defaultId: 'rebuild', onShow: (id) => { if (id === 'buildlogs' && !buildLogsLoaded) { diff --git a/frontend/packages/dashboard/src/core.html b/frontend/packages/dashboard/src/core.html index f35b1fc9..b1ee18c8 100644 --- a/frontend/packages/dashboard/src/core.html +++ b/frontend/packages/dashboard/src/core.html @@ -16,7 +16,7 @@ /core.html) carved out of the dashboard's old SYST3M tab so the dashboard tab strip stays lean. Same minimal chrome as /logs.html — a `← home` back-link to the H0M3 hub + a - createTabStrip sub-tab nav. Three sub-tabs: kept state (tombstones), + sub-tab nav. Three sub-tabs: kept state (tombstones), container load, and infra containers (start/stop/restart the four hive infra containers). Rebuild queue + meta inputs have moved to /builds.html (the build lifecycle hub). Default tab: K3PT ST4T3. @@ -24,20 +24,8 @@ infra-containers-section) match what core.js's renderers target. -->
diff --git a/frontend/packages/dashboard/src/core.js b/frontend/packages/dashboard/src/core.js index ecc14621..7a4c467d 100644 --- a/frontend/packages/dashboard/src/core.js +++ b/frontend/packages/dashboard/src/core.js @@ -1,8 +1,7 @@ // C0R3 page entry (/core.html). The host/coordinator surface carved out // of the dashboard's old SYST3M tab into its own standalone page so the -// dashboard tab strip stays lean. Two sub-tabs via the shared -// createTabStrip (default = K3PT ST4T3): kept state (tombstones) and -// container load. +// dashboard tab strip stays lean. Two sub-tabs via +// (default = K3PT ST4T3): kept state (tombstones) and container load. // // Rebuild queue + meta inputs have moved to /builds.html (the build // lifecycle hub). This page is its own esbuild bundle with its own @@ -13,7 +12,7 @@ import { $, form, openStream, initServerWarnings } from './common.js'; import { el } from '@hive/shared/dom.js'; import { asyncBtn, bindAsyncForms } from '@hive/shared/forms.js'; -import { createTabStrip } from '@hive/shared/tabs.js'; +import '@hive/shared/hive-tab-strip.js'; // ─── derived state (own copies; this bundle has its own runtime) ────────── let tombstonesState = []; @@ -490,7 +489,12 @@ async function init() { // Hash-routed sub-tab strip; default K3PT ST4T3. Container-load // polling runs only while the LOAD sub-tab is open (cpu is a short // two-sample read each refresh on the server). - createTabStrip(document.getElementById('core-tabbar'), { + document.getElementById('core-tabbar').configure({ + tabs: [ + { id: 'kept', label: 'K3PT ST4T3' }, + { id: 'load', label: 'C0NT41N3R L04D' }, + { id: 'infra', label: '1NFR4' }, + ], defaultId: 'kept', onShow: (id) => { if (id === 'load') startContainerLoadPolling(); diff --git a/frontend/packages/dashboard/src/credentials.html b/frontend/packages/dashboard/src/credentials.html index 167166f7..c30ac25a 100644 --- a/frontend/packages/dashboard/src/credentials.html +++ b/frontend/packages/dashboard/src/credentials.html @@ -17,20 +17,8 @@ link points to the H0M3 hub (served at /). -->
diff --git a/frontend/packages/dashboard/src/credentials.js b/frontend/packages/dashboard/src/credentials.js index fda15724..5d2420c3 100644 --- a/frontend/packages/dashboard/src/credentials.js +++ b/frontend/packages/dashboard/src/credentials.js @@ -21,7 +21,7 @@ import { $, esc, fmtAgeSecs, renderServerWarnings } from './common.js'; import { el } from '@hive/shared/dom.js'; -import { createTabStrip } from '@hive/shared/tabs.js'; +import '@hive/shared/hive-tab-strip.js'; import { themedConfirm, themedToast } from '@hive/shared/modal.js'; let agents = []; @@ -507,7 +507,12 @@ async function init() { $('gh-form').addEventListener('submit', submitGithub); $('ef-form').addEventListener('submit', submitForgeAccount); - createTabStrip(document.getElementById('cred-tabbar'), { + document.getElementById('cred-tabbar').configure({ + tabs: [ + { id: 'matrix', label: 'MATRIX' }, + { id: 'github', label: 'GITHUB' }, + { id: 'forges', label: 'FORGES' }, + ], defaultId: 'matrix', }); diff --git a/frontend/packages/dashboard/src/logs.html b/frontend/packages/dashboard/src/logs.html index 037e1b01..ba1b08f7 100644 --- a/frontend/packages/dashboard/src/logs.html +++ b/frontend/packages/dashboard/src/logs.html @@ -19,24 +19,8 @@ moved to /builds.html (the build lifecycle hub). -->
diff --git a/frontend/packages/dashboard/src/logs.js b/frontend/packages/dashboard/src/logs.js index 959f5c18..3d377b30 100644 --- a/frontend/packages/dashboard/src/logs.js +++ b/frontend/packages/dashboard/src/logs.js @@ -19,7 +19,7 @@ import { } from './common.js'; import { el } from '@hive/shared/dom.js'; import { epochSec } from './util.js'; -import { createTabStrip } from '@hive/shared/tabs.js'; +import '@hive/shared/hive-tab-strip.js'; (() => { initServerWarnings(); @@ -368,7 +368,13 @@ import { createTabStrip } from '@hive/shared/tabs.js'; // needs are defined. Its initial show() paints the active pane and, if // the deep-linked tab is SYSTEM/AUDIT, kicks off the lazy fetch via onShow. // Default: AGENT (build logs moved to /builds.html). - logTabs = createTabStrip(document.getElementById('logs-tabbar'), { + logTabs = document.getElementById('logs-tabbar').configure({ + tabs: [ + { id: 'agent', label: 'AGENT' }, + { id: 'infra', label: 'INFRA' }, + { id: 'system', label: 'SYSTEM' }, + { id: 'audit', label: 'AUDIT' }, + ], defaultId: 'agent', onShow: (id) => { if (id === 'system') fetchSystem(); diff --git a/frontend/packages/shared/package.json b/frontend/packages/shared/package.json index 8f4cb466..b0dde490 100644 --- a/frontend/packages/shared/package.json +++ b/frontend/packages/shared/package.json @@ -10,6 +10,7 @@ "./terminal.js": "./src/terminal/terminal.js", "./tabs.js": "./src/tabs/tabs.js", "./tabs.css": "./src/tabs/tabs.css", + "./hive-tab-strip.js": "./src/tabs/hive-tab-strip.js", "./colors.css": "./src/colors.css", "./theme.css": "./src/theme.css", "./base.css": "./src/base.css", diff --git a/frontend/packages/shared/src/tabs/hive-tab-strip.js b/frontend/packages/shared/src/tabs/hive-tab-strip.js new file mode 100644 index 00000000..2692a5cb --- /dev/null +++ b/frontend/packages/shared/src/tabs/hive-tab-strip.js @@ -0,0 +1,60 @@ +// hive-tab-strip.js — , the markup-owning tab-strip custom +// element behind the logs/credentials/core/builds sub-page tabbars. Owns +// rendering the markup from a declarative `tabs` list +// instead of every page hand-writing the same +// boilerplate, then wires the existing createTabStrip() behaviour +// (@hive/shared/tabs.js) over what it just rendered — no behaviour +// duplication, this is markup only. +// +// Light-DOM (no shadow root): the existing .hive-tabbar/.hive-tab/ +// .tab-count CSS (tabs.css + dashboard.css) already targets plain classes +// on the tabbar/tab elements directly, and tab *panes* stay page-owned +// content this element never touches — no slotting/scoping need the way +// / have. +// +// Host keeps its own id/class/role (same as the