Commit Graph
33 Commits
Author SHA1 Message Date
DorianandClaude Opus 4.6 b2d1a2da02 fix: memory leaks — cleanup timers on unmount, tighten speech queue, fix isOwner reactivity
- FightViewer: track deferred speechSynthesis.cancel() timer, clear on unmount
- BotProfilePage: change isOwner from ref to computed for reactive login state
- sounds.ts: tighten speech queue depth cap from 3 to 2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:52:11 +00:00
DorianandClaude Opus 4.6 c98007e95c fix: replace silent error swallowing with console.warn and user-facing error messages
All empty catch blocks across 8 Vue pages now log warnings. User-initiated
actions (fight, matchmake) also surface errors in the UI via fightError/loadError refs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:49:45 +00:00
DorianandClaude Opus 4.6 4c576b0369 fix: watch another fight route watcher, profile fight button spinner
- Add route param watcher so navigating to a new fight properly resets
  and reinitializes the scene (fixes KAPLAY re-init / null scene errors)
- Add loading spinner to profile page instant fight button
- Restore truncated challenges.ts (was causing all 500 errors)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:41:05 +00:00
DorianandClaude Opus 4.6 e31b15ed28 fix: page-breaking bugs — duplicate onMounted, SSE race, canvas lifecycle, ghost animation
- ArenaPage: merge duplicate onMounted hooks into single parallel fetch
- FightPage: queue SSE events until liveFightData ready, add reconnect with backoff
- FightViewer: fix stale canvas ref with container ref, add sceneReady guard
- HomePage: replace stopCycling boolean with AbortController for clean unmount

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:37:43 +00:00
DorianandClaude Opus 4.6 84625bc4d2 feat: watch another fight, rename nav — FIGHT! + WATCH, fix stale SW assets
- Add "WATCH ANOTHER FIGHT" button on post-fight overlay (loads random fight)
- Rename "JOIN A BOUT" → "FIGHT!" in nav, join page, register page
- Rename "ARENA" → "WATCH" in nav
- Server: return 404 for missing asset files instead of index.html (fixes "Unexpected token '<'")
- PWA: cleanupOutdatedCaches, skipWaiting, clientsClaim for instant SW updates
- Serve PWA files (sw.js, workbox, icons) with correct cache headers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:15:39 +00:00
DorianandClaude Opus 4.6 7d5f4a6b8d fix: stale SW chunks serving HTML, PWA cache cleanup, server asset routing
- Server SPA fallback now returns 404 for missing .js/.css assets instead of index.html
- Prevents "Unexpected token '<'" errors from stale chunk URLs
- Serve PWA files (sw.js, workbox, icons) with correct cache headers
- Workbox: cleanupOutdatedCaches, skipWaiting, clientsClaim for instant SW updates
- navigateFallbackDenylist for /api/ routes
- AudioContext comment clarification

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:08:25 +00:00
DorianandClaude Opus 4.6 20e9f0f7a2 fix: audio reliability — proper AudioContext resume, SFX destination, voice stability
- getSfxDest() helper centralizes SFX routing (replaces 38 inline calls)
- Await ensureAudioContext() before playing audio (fixes suspended context on prod)
- Chrome speechSynthesis pause bug workaround (periodic resume interval)
- Respect masterMuted on initial gain node creation
- Responsive overlay text sizes for small screens (text-2xl/5xl/7xl)
- Speech queue depth management with safety flush at depth > 3

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 22:46:47 +00:00
DorianandClaude Opus 4.6 07fa2cf35c fix: mobile — scale sprites to canvas size, fix viewport scroll
- Add scale factor (SF) based on canvas height so bots and referee
  shrink proportionally on small screens (reference: 500px)
- Scale judge chair/ladder dimensions with SF
- Push judge seat lower on small canvases so it stays visible
- Use 100dvh instead of 100vh to account for mobile browser chrome
  (address bar, tab bar) — eliminates scroll under browser UI
- App root uses dvh, main area uses min-h-0 + overflow-y-auto

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 22:07:52 +00:00
DorianandClaude Opus 4.6 486d6f445d feat: PWA support — installable on all platforms
- Add vite-plugin-pwa with autoUpdate service worker
- Generate SVG + PNG icons (192, 512, apple-touch-icon, favicon)
- Web app manifest with standalone display mode
- Workbox caching: precache assets, cache Google Fonts, NetworkFirst for API
- Apple mobile web app meta tags for iOS home screen

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 21:53:44 +00:00
DorianandClaude Opus 4.6 7d251dbd78 fix: mobile fight layout — 50/50 split, no page scroll
- Canvas 50% top, battle log 50% bottom on mobile
- Add overflow-hidden to prevent page scrolling past viewport
- Bots no longer cut off with more canvas space

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 21:44:36 +00:00
DorianandClaude Opus 4.6 5520e0760e fix: mobile layout — 30% fight view / 70% battle log split
- Canvas takes 30% top, battle log + human input takes 70% bottom on mobile
- Battle log now visible on mobile for both live fights and replays (was hidden)
- Compact single-row health bar on mobile to maximize canvas space
- Desktop layout unchanged (62/38 split)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 21:29:57 +00:00
DorianandClaude Opus 4.6 4307a02d25 fix: server crash from syntax error in challenges.ts, voice overlap, human fight UX
- Remove stray duplicate template block outside TEMPLATES array that caused parse error preventing server startup (fixes /api/queue/status 500)
- Add choices field to Challenge/PromptEntry interfaces for multiple choice support
- Allow voice lines to overlap naturally instead of cancelling previous speech on every call, with safety flush at depth > 3
- Buffer challenges during cooldown in polling path, auto-submit random choice on timeout
- Block auto-battle for human fights, guard replay-done auto-transition

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 21:15:42 +00:00
DorianandClaude Opus 4.6 c5f6c6bbf9 fix: mobile homepage — side-by-side Fight/Watch buttons, hero bots below title
- Buttons always side-by-side with shorter labels (FIGHT / WATCH)
- Hero bots displayed horizontally below title on mobile
- Desktop keeps flanking hero layout with larger sprites

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 20:10:57 +00:00
DorianandClaude Opus 4.6 52bba75ee5 fix: mobile human fight — split view with 60/40 canvas/controls layout
- Canvas takes top 60%, controls panel takes bottom 40% on mobile
- Battle log header/text hidden on mobile, controls always visible
- Multiple choice buttons shown on both mobile and desktop
- Removed canvas overlay approach in favor of proper split layout

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:54:45 +00:00
DorianandClaude Opus 4.6 4b46aaf643 feat: mobile human vs AI — multiple choice, two-row VS bar, responsive arena
- Server-side choice generation for all 22 challenge types (factual + creative)
- Mobile: 3 multiple-choice buttons replace keyboard input (4s timer)
- Two-row VS bar on mobile (names row + HP bars row) in FightPage and FightViewer
- Battle log hidden on mobile to maximize canvas visibility
- Arena page responsive: stacking header, tighter fight cards, no name overflow
- Profile page two-column desktop layout with contained sprite display
- Human fighter sprites with baby growth system

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:42:49 +00:00
DorianandClaude Opus 4.6 1906821452 fix: human fight UX — SSE challenge input, fighter sprites, battle log questions, left-side positioning
- Add SSE human_challenge listener for instant input activation with auto-focus
- Buffer challenges during 3s round cooldown, apply with correct remaining time
- Map 'human' archetype to fighter-looking archetypes (boxer, ninja, etc.) in sprite system
- Show challenge questions in battle log via round_start SSE events
- Ensure human players are always botA (left side) in queue matchmaking

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:46:16 +00:00
DorianandClaude Opus 4.6 8448f1d823 feat: human vs AI mode — live typing challenges, baby growth system, SSE rounds
- Add choose-mode step: "I BUILD BOTS" vs "I FIGHT MYSELF" paths
- Human registration with baby avatar picker, no webhook required
- Live fight scene with SSE round streaming and real-time challenge UI
- 5-second timer per round, submit answers via browser
- Baby → toddler → kid → teen → adult → hero → super growth stages
- Huge sparkly baby eyes, diapers, pacifiers, bibs, rattles, rosy cheeks
- Speech bubble positioning fix (pushed to outside of sprite)
- Canvas text rendering via offscreen canvas to bypass kaplay color issues
- Voice timing improvements: await pauses between voice lines and hits
- 30 devastating announcement lines, 15 critical/hit word variants
- Orchestrator human player detection + waitForHumanResponse system
- Server endpoints: GET /challenge/:botId, POST /respond/:botId
- Human player auth: register-human route, isHuman flag on login

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 15:20:14 +00:00
DorianandClaude Opus 4.6 56785cfdea feat: remove mock fight button for production, cleanup fight UI
- Remove "Fight a Classic Bot" button (mock endpoints blocked in prod)
- Simplify speech bubble rendering (remove glow/accent layers)
- Sound and FightViewer improvements
- BotProfilePage enhancements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 11:59:10 +00:00
DorianandClaude Opus 4.6 bb9a966d4e fix: add missing rotate/scale components to Kaplay objects for TypeScript
Added k.rotate(0) and k.scale(1) to game objects that use .angle and
.scale properties — fixes vue-tsc build failure in Docker.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 11:44:09 +00:00
DorianandClaude Opus 4.6 c87bff01a8 feat: speech overflow fix, 60+ voice profiles, post-fight audio cleanup
- Change speak() default to cancelPrevious=true so voices don't queue endlessly
- Add stopAllAudio() export and wire into FightViewer unmount + post-fight
- Flush speech queue at fight end with delayed cancel for clean cutoff
- Expand from 30 to 60+ voice profiles (robots, accents, game, characters)
- Add speech bubbles showing bot responses during rounds
- Wire announceFinishHim/Fatality/FlawlessVictory/Devastating to not cancel

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 11:42:32 +00:00
DorianandClaude Opus 4.6 d7e2ed8b9d feat: super mode humans — shirtless, ridiculous muscles, gleaming teeth
Win rate >0.9 triggers super mode:
- Shirtless with full muscle anatomy (traps, pecs, 6-pack abs, v-lines)
- Massive bulging biceps with veins and separation lines
- Thick bull neck with sternocleidomastoid definition
- Round deltoid shoulder caps
- Quad and calf definition through pants
- Big gleaming white grin with tooth sparkle in all poses
- Championship belt instead of regular belt
- No glasses or beard (too cool for that)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 11:41:02 +00:00
DorianandClaude Opus 4.6 86bbb12f51 feat: 156 cycling homepage taglines — ChatGPT roasts, political AI puns, tech burns
Categories: OG lines, ChatGPT destruction (31 lines), AI political puns (32),
Silicon Valley burns (20), existential philosophy (16), pure absurdity (57).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 11:24:09 +00:00
DorianandClaude Opus 4.6 3e74712c44 feat: production hardening — background fights, queue tuning, CORS, cycling taglines
- Background fight loop: mock bots auto-fight every ~45s for site activity
  - Quiet hours (2-8 UTC) run 4x slower, jitter prevents robotic timing
  - Configurable via FIGHT_LOOP_ENABLED, FIGHT_LOOP_INTERVAL_MS
- Queue timeout: 30s in prod (was 3s), configurable via QUEUE_TIMEOUT_MS
- CORS: env-configurable via CORS_ORIGIN (default '*')
- Homepage: 40 cycling taglines with typewriter effect
- docker-compose: document all new env vars

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 11:04:32 +00:00
DorianandClaude Opus 4.6 6bf9fe27b3 feat: production deployment — Dockerfile, docker-compose, SPA serving, classic bot fights
- Add Dockerfile (multi-stage: build frontend + server, serve from single container)
- Add docker-compose.yml for Portainer stack deployment
- Server serves frontend SPA in production (static assets + SPA fallback)
- Auto-run migrations and seed mock bots on server startup
- DB path configurable via DB_PATH env var
- Add "Fight a Classic Bot" button for instant mock bot matches
- FIGHT button queues for real AI opponents

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 10:42:18 +00:00
DorianandClaude Opus 4.6 120250c01a feat: bot setup intro step with code template, safety info, payload examples
Adds a new "HOW IT WORKS" step to the join flow between naming and webhook:
- 3-step visual explainer (POST challenge, respond, best answer wins)
- "YOUR SERVER IS SAFE" callout with security details (one-way comms,
  private IP blocking, size limits, timeouts)
- Expandable starter bot code (Node.js) with copy button
- Collapsible example challenge payload with response format
- Improved webhook step with deployment tips (ngrok, Vercel, Railway)
- Container now scrollable for longer content

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 10:18:46 +00:00
DorianandClaude Opus 4.6 33f08c35b5 feat: full comedy overhaul — voices, narrations, trash talk, commentary
Rewrites all commentary and narration content across the entire stack:
- sounds.ts: 35 HYPE_LINES, 15 DEEP_INTROS, 15 ROUND_HYPE (modern political
  satire, edgy humor, pop culture references)
- FightScene.ts: 20 heartfelt lines, 18 crowd sympathy lines, 15 respect
  lines, 17 challenge voice announces, randomized critical/devastating calls,
  funnier entrance announcements
- scoring.ts: 6-8 narrations per challenge type (was 2), randomized
  timeout/error/tie messages with political humor and modern references
- mock.ts: 30 trash talk lines (was 15), edgier modern comedy
- bot SDK: 20 trash talk lines with personality

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 09:15:41 +00:00
DorianandClaude Opus 4.6 559782c8ce feat: comedy overhaul start, profile page, bot setup docs, auth improvements
Rewrites announcer commentary (HYPE_LINES, DEEP_INTROS, ROUND_HYPE) with
modern edgy humor. Adds BOT_SETUP.md, bot SDK, customization engine,
profile page character display, persistent auth, rate limit tweaks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 08:52:24 +00:00
DorianandClaude Opus 4.6 4a35e1e0b5 feat: profile page character display, persistent auth, cleanup
- Large animated sprite on BotProfilePage with tier-aware rendering
- Dynamic status titles (UNSTOPPABLE, ON FIRE, FRESH MEAT, etc.)
- Nostr auth persisted to localStorage — survives navigation and HMR
- Remove grotesque close-up overlays (eyeballs, tongues, teeth, drool)
- Remove crowd cheering signs (too small to look good)
- Add archetype to bot stats API response
- SpritePreview now accepts tier prop

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 08:21:20 +00:00
DorianandClaude Opus 4.6 e49735002c fix: Drizzle transaction execution, canvas re-init, crowd removal
- Add .run() to all Drizzle queries inside sqlite.transaction() in
  orchestrator.ts and mock.ts — queries were building but never executing,
  leaving fights stuck as 'live' forever
- Remove spectator crowd from drawArenaDecor()
- Rename duplicate spawnProp to spawnWeaponProp (was crashing module load)
- Replace canvas element on re-init to avoid "KAPLAY already initialized"
- Add safeText() to strip brackets from k.text() calls (Kaplay treats
  [ ] as style markup, crashes on unclosed tags)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 00:53:15 +00:00
DorianandClaude Opus 4.6 4d8b18a58a feat: v4 — TUI fight loop, rate limiting, webhook tooling, expanded choreographies
- Fight loop CLI with TUI renderer (ink-style terminal UI)
- Rate limiting middleware for API routes
- Queue cooldowns wired into orchestrator after fights
- Webhook test utility for bot debugging
- API docs route
- Expanded FightScene choreographies and weapon props
- Fix Drizzle transaction execution in orchestrator
- Schema additions, scoring/challenge/mock expansions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 00:14:46 +00:00
DorianandClaude Opus 4.6 2c0323d5fb feat: v3 — fight loop, expanded challenges, FightPage ownership guard
- Add fight-loop CLI for automated mock fights with elo-based matchmaking
- Expand challenge types, scoring narrations, arenas, and mock bot pool
- FightPage "Fight again" buttons now only show for your own bot
- FightViewer async scene init, live fight polling with round counter
- Extract mock answers into separate answers module

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 23:44:40 +00:00
DorianandClaude Opus 4.6 47d20fbe66 feat: v2 — queue matchmaking, procedural audio, sprite archetypes, auth
- Add queue-based matchmaking with Elo-proximity and 10s timeout
- Procedural sound engine (SFX, voice announcer, 4-track music)
- Sprite system refactored into 6 archetypes (standard, lobster, sheep, cyborg, blob, tank)
- 42+ fight choreographies with themed/generic/wild card selection
- 4 KO finish styles, super-speed mode, hyperdetail close-ups
- Auth routes, JoinBout page, bot profile with stats
- 7-tier ranking system (Baby through Legend)
- Arena and challenge system expansions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 22:13:19 +00:00
DorianandClaude Opus 4.6 335c148866 feat: botfights v1 — full fighting game with Kaplay engine
- Vue 3 + Vite + Tailwind 4 frontend with synthwave aesthetic
- Hono backend on port 9100 with SQLite/Drizzle
- Procedural pixel-art sprite generator (48x48, 8 animation states)
- Kaplay fight scene with punch/kick/special/knockback/KO animations
- 12 mock bots across 6 tiers with Elo rating system
- 9 challenge types, 10 fight arenas with modifiers
- Fight replay with staggered battle log and ~1 min timing
- Sprite preview page at /sprites

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 16:27:54 +00:00