From ff23f223375cb39b6f8e176e701b2379b131528b Mon Sep 17 00:00:00 2001 From: syntaxbullet Date: Wed, 7 Jan 2026 13:21:36 +0100 Subject: [PATCH] feat: move status to footer and clean up home page --- src/web/router.test.ts | 5 ++- src/web/routes/home.ts | 9 ----- src/web/views/layout.ts | 17 ++++++++- tickets/2026-01-07-move-status-to-footer.md | 38 +++++++++++++++++++++ 4 files changed, 58 insertions(+), 11 deletions(-) create mode 100644 tickets/2026-01-07-move-status-to-footer.md diff --git a/src/web/router.test.ts b/src/web/router.test.ts index 39397a6..87b3d7b 100644 --- a/src/web/router.test.ts +++ b/src/web/router.test.ts @@ -7,7 +7,10 @@ describe("Web Router", () => { const res = await router(req); expect(res.status).toBe(200); expect(res.headers.get("Content-Type")).toBe("text/html"); - expect(await res.text()).toContain("Aurora Web"); + const text = await res.text(); + expect(text).toContain("Aurora Web"); + expect(text).toContain("Uptime:"); + expect(text).toContain('id="uptime-display"'); }); it("should return health check on /health", async () => { diff --git a/src/web/routes/home.ts b/src/web/routes/home.ts index c18e24a..060b8a1 100644 --- a/src/web/routes/home.ts +++ b/src/web/routes/home.ts @@ -1,20 +1,11 @@ import { BaseLayout } from "../views/layout"; -import { formatUptime } from "../utils/format"; export function homeRoute(): Response { - const uptime = formatUptime(process.uptime()); - const startTimestamp = Date.now() - (process.uptime() * 1000); - const content = `

Welcome

The Aurora web server is up and running!

-
-

Status

-

System operational.

-

Uptime: ${uptime}

-
`; const html = BaseLayout({ title: "Home", content }); diff --git a/src/web/views/layout.ts b/src/web/views/layout.ts index 1ac4645..5ab8431 100644 --- a/src/web/views/layout.ts +++ b/src/web/views/layout.ts @@ -1,4 +1,5 @@ import { escapeHtml } from "../utils/html"; +import { formatUptime } from "../utils/format"; interface LayoutProps { title: string; @@ -7,6 +8,12 @@ interface LayoutProps { export function BaseLayout({ title, content }: LayoutProps): string { const safeTitle = escapeHtml(title); + + // Calculate uptime for the footer + const uptimeSeconds = process.uptime(); + const startTimestamp = Date.now() - (uptimeSeconds * 1000); + const initialUptimeString = formatUptime(uptimeSeconds); + return ` @@ -30,7 +37,15 @@ export function BaseLayout({ title, content }: LayoutProps): string { ${content} diff --git a/tickets/2026-01-07-move-status-to-footer.md b/tickets/2026-01-07-move-status-to-footer.md new file mode 100644 index 0000000..184e8ab --- /dev/null +++ b/tickets/2026-01-07-move-status-to-footer.md @@ -0,0 +1,38 @@ +# 2026-01-07-move-status-to-footer + +**Status:** Done +**Created:** 2026-01-07 +**Tags:** ui, layout, enhancement + +## 1. Context & User Story +* **As a:** User of the Web Interface +* **I want to:** see the system status and uptime information in the footer of every page +* **So that:** the main content area is less cluttered and status information is globally available. + +## 2. Technical Requirements +### Data Model Changes +- [ ] N/A + +### API / Interface +- [x] **Home Page:** Remove the "Status" card from the main content. +- [x] **Layout:** Update `BaseLayout` (or `layout.ts`) to accept or calculate uptime/status information and render it in the `