feat(frontend): add forge link tile to H0M3 hub

H0M3 had tiles for every operator surface except the forge. Add a
Forge tile that links straight to the hive-forge web UI. It mirrors
the Matrix tile's gating: hidden by default, revealed by home.js only
when state.forge_present is true, with the href filled from
state.forge_public_url (the gateway-served vhost) or the direct :3000
port fallback — the same precedence the dashboard uses for forge links.
Operators without a forge never see a dead link.
This commit is contained in:
iris 2026-06-10 13:13:32 +02:00 committed by mara
commit 986b3df9b0
2 changed files with 24 additions and 0 deletions

View file

@ -27,6 +27,18 @@ async function init() {
if (tile) tile.hidden = false;
}
// Forge tile: reveal + point at the live forge only when the
// hive-forge container is up. Prefer the gateway-served public URL
// (set when forge.behindGateway=true), fall back to the direct :3000
// port — same precedence the dashboard uses for forge links.
if (state.forge_present) {
const tile = $('home-tile-forge');
if (tile) {
tile.href = state.forge_public_url || `http://${location.hostname}:3000`;
tile.hidden = false;
}
}
const ident = $('hive-identity');
if (ident && (state.swarm_name || state.hive_name)) {
const parts = [state.swarm_name, state.hive_name].filter(Boolean);

View file

@ -68,6 +68,18 @@
<span class="home-tile-desc">operator-local prefs · browser notifications</span>
</a>
<!-- Forge tile: hidden until home.js confirms the hive-forge
container is up (state.forge_present); home.js also fills the
href from state.forge_public_url (or the :3000 fallback), so
operators without a forge never see a dead link. -->
<a class="home-tile" id="home-tile-forge" href="#" target="_blank" rel="noopener" hidden>
<span class="home-tile-head">
<span class="home-tile-icon" aria-hidden="true"></span>
<span class="home-tile-label">Forge</span>
</span>
<span class="home-tile-desc">issues · pull requests · agent-config repos</span>
</a>
<!-- Matrix tile: hidden until home.js confirms the matrix GUI is
enabled (state.matrix_gui_enabled), mirroring the dashboard
tab gating so operators without it don't see a dead link. -->