Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
# Git Commit Status Indicator for Prompt Curtain
## Overview
Add a visual indicator to the prompt.mjs curtain UI showing whether the deployed site is on the latest git commit or behind, with the commit hash displayed.
## Visual Design
- **Location**: Below "X HANDLES SET" text on the login curtain
- **Font**: MatrixChunky8 (same as handles counter)
- **Colors**:
- 🟢 Green (`[0, 255, 0]`) = Site is up-to-date with latest commit
- 🟠 Orange (`[255, 165, 0]`) = Site is behind (shows how many commits)
- **Format Examples**:
- `✓ 37da247` (current)
- `↑ 2 behind (37da247)` (behind by 2 commits)
---
## Implementation Steps
### 1. Create Build-Time Version File
**File**: `system/public/version.json` (generated at build time)
Add to `netlify.toml` build command:
```toml
command = "rm -f public/index.html && echo '{\"commit\":\"'$COMMIT_REF'\",\"timestamp\":\"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'\"}' > public/version.json"
```
This creates a file like:
```json
{"commit":"37da2475abc123...","timestamp":"2026-01-11T22:34:06Z"}
```
### 2. Create Netlify Function: `/api/version`
**File**: `system/netlify/functions/version.mjs`
```javascript
// Fetches latest commit from GitHub and compares to deployed version
export default async (request) => {
const deployedCommit = process.env.COMMIT_REF || "unknown";
try {
// Fetch latest commit from GitHub (public, no auth needed)
const res = await fetch(
"https://api.github.com/repos/whistlegraph/aesthetic-computer/commits?per_page=50",
{ headers: { "User-Agent": "aesthetic-computer" } }
);
const commits = await res.json();
const latestCommit = commits[0]?.sha;
// Find how many commits behind
let behindBy = 0;
if (deployedCommit !== "unknown" && latestCommit) {
const idx = commits.findIndex(c => c.sha.startsWith(deployedCommit.slice(0, 7)));
behindBy = idx === -1 ? 50 : idx; // -1 means very old
}
const status = behindBy === 0 ? "current" : "behind";
return Response.json({
deploye…