1 Commits

Author SHA1 Message Date
Alexander Whitestone
eb083d3937 fix: add error state fallback for perpetual INITIALIZING screen
When main.js fails to load (network error, CORS, etc.), users were
stuck on "INITIALIZING" forever with no error or recovery option.

Changes:
- Add inline 8s timeout that shows error state if main.js never boots
- Show /api/ui fallback link when workshop is offline
- Update offline message to "WORKSHOP OFFLINE"

Fixes #7

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 19:01:09 -04:00
2 changed files with 1 additions and 32 deletions

View File

@@ -1,10 +0,0 @@
{
"status": "ok",
"services": {
"api": true,
"agent_loop": false,
"websocket": false
},
"uptime": null,
"version": "20260322.230710"
}

View File

@@ -17,17 +17,14 @@ Generates:
""" """
import html import html
import json
import os import os
import re import re
from datetime import datetime, timezone from datetime import datetime, timezone
from pathlib import Path from pathlib import Path
SITE_URL = "https://alexanderwhitestone.com" SITE_URL = "https://alexanderwhitestone.com"
ROOT_DIR = Path(__file__).parent.parent BLOG_DIR = Path(__file__).parent.parent / "blog"
BLOG_DIR = ROOT_DIR / "blog"
POSTS_DIR = BLOG_DIR / "posts" POSTS_DIR = BLOG_DIR / "posts"
HEALTH_DIR = ROOT_DIR / "api" / "health"
PAGE_STYLE = """\ PAGE_STYLE = """\
* { margin: 0; padding: 0; box-sizing: border-box; } * { margin: 0; padding: 0; box-sizing: border-box; }
@@ -294,23 +291,6 @@ def generate_feed(posts):
print(f" Generated feed with {len(entries)} entry/entries.") print(f" Generated feed with {len(entries)} entry/entries.")
def generate_health():
"""Generate api/health/index.json with build-time metadata."""
HEALTH_DIR.mkdir(parents=True, exist_ok=True)
health = {
"status": "ok",
"services": {
"api": True,
"agent_loop": False,
"websocket": False,
},
"uptime": None,
"version": datetime.now(timezone.utc).strftime("%Y%m%d.%H%M%S"),
}
(HEALTH_DIR / "index.json").write_text(json.dumps(health, indent=2) + "\n")
print(" Generated api/health endpoint.")
def main(): def main():
print("Building The Scrolls...") print("Building The Scrolls...")
posts = load_posts() posts = load_posts()
@@ -319,7 +299,6 @@ def main():
print(f" Built: {out.relative_to(BLOG_DIR.parent)}") print(f" Built: {out.relative_to(BLOG_DIR.parent)}")
generate_index(posts) generate_index(posts)
generate_feed(posts) generate_feed(posts)
generate_health()
print("Build complete.") print("Build complete.")