Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"dependencies": {
"@atos/dispatch": "0.0.0",
"@atos/operations": "0.0.0",
"@atos/power": "0.0.0",
"@atos/scenario": "0.0.0",
"@atos/scenario-editor": "0.0.0",
Expand Down
33 changes: 33 additions & 0 deletions apps/web/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,39 @@ h1 {
background: #ffffff;
}

.deployment-footer {
display: flex;
flex-wrap: wrap;
gap: 8px;
align-items: center;
justify-content: center;
border-top: 1px solid #ccd6d1;
padding: 20px 0 0;
color: #4d635d;
font-size: 0.9rem;
font-weight: 700;
}

.deployment-footer a {
text-decoration: underline;
text-underline-offset: 3px;
}

.deployment-footer a:focus-visible {
outline: 3px solid #d4a72c;
outline-offset: 3px;
}

.sr-only {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
clip-path: inset(50%);
}

.workspace-panel h2 {
margin-bottom: 0;
color: #1d3832;
Expand Down
8 changes: 8 additions & 0 deletions apps/web/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe("ATOS web shell", () => {
"Capacity",
"Dispatch",
"Simulation",
"Operations",
]);
});

Expand All @@ -32,11 +33,18 @@ describe("ATOS web shell", () => {
expect(screen.getByRole("heading", { name: "DC Power Integrity" })).toBeInTheDocument();
expect(screen.getByRole("heading", { name: "Dispatch Planning Core" })).toBeInTheDocument();
expect(screen.getByRole("heading", { name: "Simulation Event Log" })).toBeInTheDocument();
expect(screen.getByRole("heading", { name: "Closed-Loop Operations" })).toBeInTheDocument();
expect(within(placeholderRegion).getByRole("heading", { name: "Capacity" })).toBeInTheDocument();
expect(within(placeholderRegion).queryByRole("heading", { name: "Layout" })).not.toBeInTheDocument();
expect(within(placeholderRegion).queryByRole("heading", { name: "Power" })).not.toBeInTheDocument();
expect(within(placeholderRegion).queryByRole("heading", { name: "Dispatch" })).not.toBeInTheDocument();
expect(within(placeholderRegion).queryByRole("heading", { name: "Simulation" })).not.toBeInTheDocument();
expect(within(placeholderRegion).queryByRole("heading", { name: "Operations" })).not.toBeInTheDocument();
expect(screen.getByRole("contentinfo", { name: /deployment freshness/i })).toHaveTextContent(/ATOS v/);
expect(screen.getByRole("link", { name: "GitHub" })).toHaveAttribute(
"href",
"https://github.com/recklessnode/ATOS",
);
});

it("renders the loaded six-tile fixture counts", () => {
Expand Down
6 changes: 5 additions & 1 deletion apps/web/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { useLayoutEffect } from "react";
import { getSixTileCitySummary } from "@atos/scenario";
import "./App.css";
import { DeploymentFooter } from "./DeploymentFooter";
import { DispatchWorkspace } from "./features/dispatch-workspace";
import { LayoutEditor } from "./features/layout-editor";
import { OperationsWorkspace } from "./features/operations-workspace";
import { PowerWorkspace } from "./features/power-workspace";
import { SimulationWorkspace } from "./features/simulation-workspace";
import { WORKSPACES } from "./workspaces";
Expand Down Expand Up @@ -68,9 +70,10 @@ export function App() {
<PowerWorkspace />
<DispatchWorkspace />
<SimulationWorkspace />
<OperationsWorkspace />

<section className="workspace-grid" aria-label="Workspace placeholders">
{WORKSPACES.filter((workspace) => !["layout", "power", "dispatch", "simulation"].includes(workspace.id)).map((workspace) => (
{WORKSPACES.filter((workspace) => !["layout", "power", "dispatch", "simulation", "operations"].includes(workspace.id)).map((workspace) => (
<article className="workspace-panel" id={workspace.id} key={workspace.id}>
<div>
<p className="workspace-status">{workspace.status}</p>
Expand All @@ -80,6 +83,7 @@ export function App() {
</article>
))}
</section>
<DeploymentFooter />
</main>
);
}
24 changes: 24 additions & 0 deletions apps/web/src/DeploymentFooter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { BUILD_METADATA, type BuildMetadata } from "./build-metadata";

type DeploymentFooterProps = {
metadata?: BuildMetadata;
};

export function DeploymentFooter({ metadata = BUILD_METADATA }: DeploymentFooterProps) {
return (
<footer className="deployment-footer" aria-label="Deployment freshness">
<span className="sr-only">Deployed version:</span>
<span>ATOS v{metadata.version}</span>
<span aria-hidden="true">·</span>
<span>commit {metadata.shortSha}</span>
<span aria-hidden="true">·</span>
<time dateTime={metadata.commitDate === "unknown date" ? undefined : metadata.commitDate}>
{metadata.commitDate}
</time>
<span aria-hidden="true">·</span>
<a href={metadata.repositoryUrl} rel="noreferrer" target="_blank">
GitHub
</a>
</footer>
);
}
47 changes: 47 additions & 0 deletions apps/web/src/build-metadata.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { render, screen } from "@testing-library/react";
import { describe, expect, it } from "vitest";
import { DeploymentFooter } from "./DeploymentFooter";
import { resolveBuildMetadata } from "./build-metadata";

describe("deployment freshness metadata", () => {
it("resolves build-time version, short SHA, commit date, and repository URL", () => {
const metadata = resolveBuildMetadata({
version: "0.5.0",
commitSha: "b0928ac123456789",
commitDate: "2026-07-11T12:34:56Z",
repositoryUrl: "https://github.com/recklessnode/ATOS",
source: "github-pages",
});

expect(metadata.version).toBe("0.5.0");
expect(metadata.shortSha).toBe("b0928ac");
expect(metadata.commitDate).toBe("07/11/2026");
expect(metadata.label).toContain("ATOS v0.5.0");
});

it("uses truthful local-development fallbacks", () => {
const metadata = resolveBuildMetadata({});

expect(metadata.version).toBe("0.0.0");
expect(metadata.shortSha).toBe("unknown");
expect(metadata.commitDate).toBe("unknown date");
expect(metadata.source).toBe("dev");
});

it("renders the persistent repository footer accessibly", () => {
render(<DeploymentFooter metadata={resolveBuildMetadata({
version: "0.5.0",
shortSha: "b0928ac",
commitDate: "2026-07-11T00:00:00Z",
})} />);

const footer = screen.getByRole("contentinfo", { name: /deployment freshness/i });
expect(footer).toHaveTextContent("ATOS v0.5.0");
expect(footer).toHaveTextContent("commit b0928ac");
expect(footer).toHaveTextContent("07/11/2026");
expect(screen.getByRole("link", { name: "GitHub" })).toHaveAttribute(
"href",
"https://github.com/recklessnode/ATOS",
);
});
});
53 changes: 53 additions & 0 deletions apps/web/src/build-metadata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
export type RawBuildMetadata = {
version?: string;
shortSha?: string;
commitSha?: string;
commitDate?: string;
repositoryUrl?: string;
source?: string;
};

export type BuildMetadata = {
version: string;
shortSha: string;
commitDate: string;
repositoryUrl: string;
label: string;
source: string;
};

export function resolveBuildMetadata(raw: RawBuildMetadata = {}): BuildMetadata {
const version = raw.version?.trim() || "0.0.0";
const commitSha = raw.shortSha?.trim() || raw.commitSha?.slice(0, 7) || "unknown";
const commitDate = readableDate(raw.commitDate);
const repositoryUrl = raw.repositoryUrl?.trim() || "https://github.com/recklessnode/ATOS";
const source = raw.source?.trim() || "dev";
return {
version,
shortSha: commitSha,
commitDate,
repositoryUrl,
source,
label: `ATOS v${version} · commit ${commitSha} · ${commitDate} · GitHub`,
};
}

export const BUILD_METADATA = resolveBuildMetadata(
typeof __ATOS_BUILD_METADATA__ === "undefined" ? {} : __ATOS_BUILD_METADATA__,
);

function readableDate(value: string | undefined): string {
if (!value || value === "unknown") {
return "unknown date";
}
const date = new Date(value);
if (Number.isNaN(date.getTime())) {
return "unknown date";
}
return new Intl.DateTimeFormat("en-US", {
year: "numeric",
month: "2-digit",
day: "2-digit",
timeZone: "UTC",
}).format(date);
}
Loading