From babdd4af5dedc30a8c4700fee634a0c70fdedae6 Mon Sep 17 00:00:00 2001
From: "google-labs-jules[bot]"
<161369871+google-labs-jules[bot]@users.noreply.github.com>
Date: Fri, 20 Feb 2026 04:04:28 +0000
Subject: [PATCH] Add Home button to dashboard linking to landing page
Co-authored-by: PR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com>
---
build.mjs | 7 +++++++
dashboard/index.html | 30 +++++++++++++++++++-----------
src/dashboard.mjs | 2 ++
test/dashboard-security.test.mjs | 5 +++++
4 files changed, 33 insertions(+), 11 deletions(-)
diff --git a/build.mjs b/build.mjs
index 56135c7..7c05ad3 100644
--- a/build.mjs
+++ b/build.mjs
@@ -48,6 +48,13 @@ const distDashboard = path.join(DIST_DIR, 'dashboard');
fs.mkdirSync(distDashboard, { recursive: true });
fs.cpSync(DASHBOARD_SRC, distDashboard, { recursive: true });
+// Patch dashboard/index.html to point to correct landing page in production build
+// In dev, ../landing/ works. In dist, ../ works (since landing becomes index.html at root).
+const dashboardIndex = path.join(distDashboard, 'index.html');
+let dashboardHtml = fs.readFileSync(dashboardIndex, 'utf8');
+dashboardHtml = dashboardHtml.replace(/href="\.\.\/landing\/"/g, 'href="../"');
+fs.writeFileSync(dashboardIndex, dashboardHtml);
+
// 3. Copy docs/ -> dist/src/docs/
const distDocs = path.join(DIST_DIR, 'src', 'docs');
fs.mkdirSync(distDocs, { recursive: true });
diff --git a/dashboard/index.html b/dashboard/index.html
index b881525..6abfce3 100644
--- a/dashboard/index.html
+++ b/dashboard/index.html
@@ -14,18 +14,26 @@
-
-

-
- TORCH Agent Dashboard
-
-
+
+

+
+ TORCH Agent Dashboard
+
+
+
+ Connecting…
+
+
+
-
- Connecting…
-
+ Home
+
Live view of
diff --git a/src/dashboard.mjs b/src/dashboard.mjs
index f30fa24..94ad80f 100644
--- a/src/dashboard.mjs
+++ b/src/dashboard.mjs
@@ -160,8 +160,10 @@ export async function cmdDashboard(port = DEFAULT_DASHBOARD_PORT, host = '127.0.
// Security check: restrict access to allowed paths
const allowedPaths = [
path.join(packageRoot, 'dashboard'),
+ path.join(packageRoot, 'landing'),
path.join(packageRoot, 'assets'),
path.join(packageRoot, 'src', 'docs'),
+ path.join(packageRoot, 'src', 'prompts'),
path.join(packageRoot, 'src', 'constants.mjs'),
path.join(packageRoot, 'torch-config.json')
];
diff --git a/test/dashboard-security.test.mjs b/test/dashboard-security.test.mjs
index 7c95ef8..1d29044 100644
--- a/test/dashboard-security.test.mjs
+++ b/test/dashboard-security.test.mjs
@@ -43,6 +43,11 @@ test('Dashboard File Access Security', async (t) => {
assert.strictEqual(res.statusCode, 200);
});
+ await t.test('allows access to landing page', async () => {
+ const res = await get('/landing/index.html');
+ assert.strictEqual(res.statusCode, 200);
+ });
+
await t.test('blocks access to package.json', async () => {
const res = await get('/package.json');
assert.strictEqual(res.statusCode, 403);