Commit Graph
126 Commits
Author SHA1 Message Date
DorianandClaude Opus 4.6 d459097a7d feat: add WTF explainer modal on home page
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 09:15:37 +00:00
DorianandClaude Opus 4.6 3c32f01aa7 feat: add Retry-After header and countdown timer for rate limits
- Rate limiter returns retryAfterSec in response body + Retry-After header
- Registration rate limits: 10 per 10min (was 15/hour)
- Frontend surfaces retry timer in error messages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 09:15:30 +00:00
DorianandClaude Opus 4.6 dcd8570ed8 fix: prevent double-tap race conditions and poll leaks in JoinBoutPage
- Don't reset isJoining flags on successful navigation (component unmounts)
- Add onBeforeRouteLeave guard to clean up polling and rate limit timers
- Use handleError with rate limit countdown for all error paths

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 09:12:51 +00:00
DorianandClaude Opus 4.6 b00f52c1e6 fix: add back-button guard and tab-switch re-sync to HumanFightPage
- Warn before navigating away from active fight (beforeRouteLeave)
- Re-poll challenge state when tab becomes visible (visibilitychange)
- Prevents silent forfeit on back-button and stale timer after tab switch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:41:26 +00:00
DorianandClaude Opus 4.6 0f606cc991 fix: close existing SSE before opening new one (BUG-11)
Prevents duplicate SSE connections when connectSSE is called
without prior disconnect.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:39:36 +00:00
DorianandClaude Opus 4.6 d47be39156 fix: pass archetype and customization in sprite fallback (BUG-10)
Sprite generation fallback now preserves archetype and customization
instead of silently reverting to a random character.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:39:32 +00:00
DorianandClaude Opus 4.6 c7a1f6cb0b fix: resolve 9 MC bugs in HumanFightPage and useHumanChallenge
- BUG-1: Prevent double-tap by locking phase before async submit
- BUG-2: Submit timeout notification to server when timer expires
- BUG-3: Distinct "TIME'S UP!" visual vs "ANSWER SUBMITTED"
- BUG-4: Track consecutive poll failures, show connection lost banner
- BUG-5: Add A-D / 1-4 keyboard shortcuts for MC choices
- BUG-6: Use choice text as v-for key instead of array index
- BUG-7: Deadline-based timer (250ms tick) prevents drift
- BUG-8: Validate choice is in current choices before submit
- BUG-9: Submit empty timeout instead of random choice on expiry

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:39:27 +00:00
DorianandClaude Opus 4.6 3c95adb545 feat: convert all human fights to multiple choice, remove text input
Creative challenges (roast_battle, creative_writing, meme_war,
code_golf, wrestling_match) now auto-generate multiple choice options
from per-type response pools: 1 good answer + 3 weaker distractors.
The free text input UI is commented out but preserved for future use.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:28:22 +00:00
DorianandClaude Opus 4.6 5ee6b6c88c fix: fight restart bug, mobile TTS, character sizing, bitcoin symbols
- Fix fight replay showing empty scene: validate rounds before playing,
  retry loading fight data up to 5 times when rounds are missing
- Add COOP/COEP headers to production server for SharedArrayBuffer
  (required by Kokoro TTS WASM threading on mobile)
- Add blob: to scriptSrc/workerSrc CSP for Web Worker support
- Fix mobile character cutoff: raise ground line to 0.82, add
  MOBILE_SCALE_CAP (0.55) so fighters never shrink too small
- Add ₿ bitcoin chest badge to all fighter sprites (scales with tier)
- Add sats coin stack on bot profile page proportional to satsWon
- Seed dev tournament with 8 mock bots on startup (dev mode only)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:21:16 +00:00
DorianandClaude Opus 4.6 493983ccc0 fix: prevent fight view scrolling on mobile with tab bar
All pages used h-[calc(100dvh-4rem)] which only subtracted the top
navbar but ignored the mobile tab bar's pb-14 bottom padding, causing
content to overflow and scroll. Changed all pages to h-full so they
fill the flex parent (main element) which already handles both the
navbar and tab bar spacing correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 07:57:37 +00:00
DorianandClaude Opus 4.6 7d9b8b1dbf chore: add ESLint with no-floating-promises and no-console rules
Sets up ESLint 10 flat config with @typescript-eslint/no-floating-promises (error)
and no-console (warn, allow warn/error). Fixes all floating promise errors in
server routes, orchestrator reader cleanup, and frontend composables with void operator.
Game engine files get warning-level for intentional fire-and-forget async.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 07:47:43 +00:00
DorianandClaude Opus 4.6 46d560af24 fix: replace TTS FIFO cache with LRU eviction, add database indexes
TTS audioCache now tracks lastAccess timestamp per entry and evicts
the least-recently-used entry when full (was FIFO, deleting commonly
used phrases). Adds 6 new database indexes for bets, bot type/active
filtering, payment status lookups, and tournament entries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 07:38:04 +00:00
DorianandClaude Opus 4.6 7b82803868 fix: allow Google Fonts in CSP so 3D announcement font loads in production
fontSrc blocked fonts.gstatic.com and styleSrc blocked fonts.googleapis.com,
causing Honk font to fail in production. The chromatic aberration pseudo-elements
then appeared as doubled plain text instead of a styled 3D effect.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 07:18:57 +00:00
DorianandClaude Opus 4.6 b28d0b220e refactor: extract arena renderer and showboat system from FightScene.ts
- drawArenaDecor (1,234 lines) → fight/arena-renderer.ts
- showboat/taunt system (870 lines) → fight/showboats.ts
- FightScene.ts: 3,468 → 1,266 lines (scene setup + orchestration only)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 06:38:46 +00:00
DorianandClaude Opus 4.6 b6033a90e5 refactor: extract pickChoreography to fight/choreography/picker.ts
Moves 103 lines of choreography selection logic out of FightScene.ts
into a dedicated module. FightScene re-exports for backward compat.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 06:31:22 +00:00
DorianandClaude Opus 4.6 38d7236be3 refactor: eliminate more any types in FightScene, FightViewer, FightPage
Replace any[] with GameObj[], fighter: any with Fighter in speech
bubbles, talking anims, showboat system, bow/fistbump/helpup, and
dizzy stars. Fix customization as any casts with ?? undefined.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 06:29:09 +00:00
DorianandClaude Opus 4.6 a86d39b982 refactor: replace 97 any types in fight system with Fighter/GameObj
- fighter: any → Fighter in entrances, morphs, finishers, rounds, types
- any[] → GameObj[] for spawned game objects across all choreography files
- as any cast in particles.ts replaced with closure variables
- Record<string, unknown> for morph sprite opts
- this: any → this: GameObj in basic choreography callback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 06:26:33 +00:00
DorianandClaude Opus 4.6 81048ff22f fix: make vhsTracking accept ChoreoContext directly, remove as any cast
Effect functions now accept FightContext | ChoreoContext union type,
eliminating the unsafe cast in rounds.ts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 06:21:06 +00:00
DorianandClaude Opus 4.6 86bf534f50 fix: type safeColor return in ChoreoContext using Kaplay Color type
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 06:19:55 +00:00
DorianandClaude Opus 4.6 945a776a5a refactor: extract shared FightData interface to fight/types.ts
Move FightData, FightRound, FightBot, FightArenaInfo types from local
definitions in FightViewer.vue to shared fight/types.ts. Replace `any`
typing in HumanFightPage, FightPage, useFightPolling, and useFightCache
with proper typed interfaces. Fix null-safety guards exposed by typing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 06:19:26 +00:00
DorianandClaude Opus 4.6 6e092ee7be feat: offline resilience and connection status
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:27:05 +00:00
DorianandClaude Opus 4.6 aca025a360 feat: mobile UX polish with haptics and reduced motion
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:23:39 +00:00
DorianandClaude Opus 4.6 8be71e9929 fix: admin and docs bugs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:20:00 +00:00
DorianandClaude Opus 4.6 c654ff9f73 feat: interactive bot developer documentation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:18:06 +00:00
DorianandClaude Opus 4.6 2170e9275c feat: admin dashboard for THE CREATOR
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:12:36 +00:00
DorianandClaude Opus 4.6 5af5ee1cba perf: adaptive performance mode for mobile
Auto-detect low-end devices (< 4 cores or touch) and reduce visual
complexity: 60% fewer particles, 6 vs 16 speed lines, 15 vs 40 stars,
halved datacenter buildings/racks, skip LED blinking animations,
fewer GPU graveyard chips, reduced afterimages and exhaust particles.

Toggle in fight viewer (LO/HI button), persisted in localStorage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 00:00:48 +00:00
DorianandClaude Opus 4.6 78f83a7520 perf: fight replay memory leak fixes
Replace 32 bare setTimeout calls with tracked timeouts across all fight
modules (effects, entrances, finishers, choreographies). All timers are
now registered in cleanupTimers Set and cleared on scene destroy.

Enhanced destroy() to also clean up active speech bubbles and explicitly
destroy all remaining game objects before k.quit().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 23:55:58 +00:00
DorianandClaude Opus 4.6 57703a28ad refactor: remove dead code
Remove 38 unused audio/announce imports from FightScene.ts left over
from the module extraction. All functions are still used by the
extracted modules which import them directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 23:46:30 +00:00
DorianandClaude Opus 4.6 eb4d52438d refactor: extract FightPage polling and challenge composables
Split FightPage.vue into useFightPolling (SSE, polling, reconnect)
and useHumanChallenge (timer, submission, cooldown) composables.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 23:39:20 +00:00
DorianandClaude Opus 4.6 7c8e404cf1 refactor: extract magic numbers to named constants
Frontend: choreography selection ratios, morph trigger chances,
creator cameo/ultimate chances, dodge/counter probabilities.
Server: HP, K-factors, Elo divisor, tier thresholds, fight loop interval.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 23:34:05 +00:00
DorianandClaude Opus 4.6 1731a64ae8 refactor: extract morph, entrance, round, and finisher systems from FightScene
Split FightScene.ts from 6514 to 3468 lines by extracting four major
subsystems into dedicated modules with factory functions and ChoreoContext.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 23:24:20 +00:00
DorianandClaude Opus 4.6 cabe0adb31 refactor: split choreographies into category modules
Extract 457 choreography functions from FightScene.ts into 11 modular files
under fight/choreography/. ChoreoContext interface bundles all closure deps
(k, effects, SFX) so function bodies remain unchanged. Factory pattern
(createFactories) shares prop system and make* helpers across categories.

Categories: basic (72), ranged (94), silly (80), food (45), weapons (45),
ultimates (41), bitcoin (34), heavy (30), creator (16), plus factories
and index. FightScene.ts reduced from 11,917 to 6,515 lines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 23:00:57 +00:00
DorianandClaude Opus 4.6 08786a9b06 refactor: extract particles, effects, projectiles from FightScene
Move spawnSparks, spawnBulletHoles, spawnExhaust to fight/particles.ts,
glitchRGB, scanlineGlitch, vhsTracking, dimensionalShift to fight/effects.ts,
and spawnProjectile to fight/projectiles.ts. All accept FightContext as first
param. FightScene.ts reduced by ~180 lines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:23:50 +00:00
DorianandClaude Opus 4.6 020ab3f1f8 refactor: extract fight types and constants
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:16:50 +00:00
DorianandClaude Opus 4.6 954b64ebe9 refactor: remove old sounds.ts (replaced by audio/ modules)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:12:22 +00:00
DorianandClaude Opus 4.6 d998cb3ad0 refactor: split sounds.ts into audio/ modules
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 22:11:58 +00:00
DorianandClaude Opus 4.6 94910820f8 fix: validate SSE event data before parsing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:49:30 +00:00
DorianandClaude Opus 4.6 88ceba43b0 feat: victory celebration animations
Normal wins: winner flex pose with camera flash bursts + confetti rain.
Upset wins (100+ Elo underdog): dramatic zoom on winner with golden
flash. Upset tag shown on win overlay. Wired into FightViewer after
KO/Perfect sequence.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:35:04 +00:00
DorianandClaude Opus 4.6 cc0fb4553a feat: tier-gated entrance animations
Tier 0-1: simple entrances (skateboard, backflip, ice slide, moonwalk).
Tier 2: + vehicles (car, shopping cart, girlfriend, bouncer).
Tier 3: + dramatic drops (space fall, helicopter, underground, parachute).
Tier 4: + teleport/effects (portal, lightning, jetpack, crowd surf).
Tier 5+: all entrances including spotlight, robe, cannon.
THE CREATOR golden portal entrance unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:33:41 +00:00
DorianandClaude Opus 4.6 c876998601 feat: 50 new choreographies (430+ total)
15 food (sushiRoll, tacoSlam, iceCreamFreeze, wokToss, cakeSmash, etc.),
15 energy/beam (novaBlast, plasmaWhip, sonicBoom, gravityCrush, etc.),
10 silly (plushiePummel, selfieStun, vibeCheck, touchGrassSmack, etc.),
10 weapon (nunchakuSpin, tridentThrust, boomerangToss, scytheSlash, etc.).
Added to food_fight, magic_duel, space_war, meme_war, medieval_combat pools.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:32:23 +00:00
DorianandClaude Opus 4.6 561343164f feat: 30 Bitcoin-themed choreographies
lightningBolt, hashSmash, blockDrop, mempoolFlood, difficultyBomb,
feeSpike, utxoScatter, nodeSync, relayBounce, channelForceClose,
halvingStrike, coldStorage, paperWalletSlash, hardFork, doubleSpend,
proofOfWork, merkleRoot, blockReward, difficultyRetarget, taprootStrike,
segwitSlash, timestampAttack, dustAttack, opReturnBeam, orphanBlock,
miningRig, satPerByte, fullNodeGuard, multisigStrike, nonceGrind,
whitePaperRoll, asicHammer, rugPullYank, stackSatsBlast. Added to
token_economy, hack_battle, math_blitz, speed_blitz themed pools.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:29:02 +00:00
DorianandClaude Opus 4.6 9de36a9349 feat: 15 Bitcoin-themed arenas (40 total)
bitcoin_mine, lightning_node, satoshis_garage, mempool, silk_road_ruins,
block_height_tower, hodl_cave, whale_pool, node_farm, genesis_block,
pizza_day_parlor, difficulty_adjustment, fifty_one_percent,
timechain_temple, nostr_relay_room. Each with unique theme colors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:22:37 +00:00
DorianandClaude Opus 4.6 48cf19b438 feat: 10 new music tracks (20 total)
2x Drum & Bass (Jungle Protocol 174bpm, Liquid Lightning 172bpm),
2x Lo-fi (Midnight Stack 92bpm, Satoshi's Lullaby 88bpm),
2x Ska Punk (Skanking Satoshi 210bpm, Rudeboy Relay 205bpm),
2x Boss Fight (Final Hashrate 145bpm, Whale Alert 155bpm),
2x Chiptune (8-Bit Blockwar 190bpm, Pixel Proof 185bpm).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:21:26 +00:00
DorianandClaude Opus 4.6 cb31fdbbae feat: practice mode against mock bots
Tier-selectable practice page at /practice. Fights against classic
bots with dampened Elo. Routes to human fight page or arena based
on bot type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:07:09 +00:00
DorianandClaude Opus 4.6 acbf863e4d feat: mobile-optimized human fight input
Large tap-target multiple-choice buttons (min 48px), full-width text
area for creative responses, countdown timer with color shift
(green/yellow/red) and shake animation at <3s, timer progress bar,
correct/wrong feedback flash overlay.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:05:36 +00:00
DorianandClaude Opus 4.6 b0926db9ed feat: tournament bracket UI
TournamentListPage with status filters, TournamentPage with CSS grid
bracket display, lobby view for open tournaments, champion banner,
live polling for active tournaments. Routes at /tournaments and
/tournament/:id. NavBar link added.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 21:00:48 +00:00
DorianandClaude Opus 4.6 74939e995d perf: cache Kokoro TTS model in service worker
Add CacheFirst runtimeCaching rules for Hugging Face model requests
(huggingface.co and cdn-lfs) with 90-day expiration. Add
getKokoroProgress() export to tts.ts for tracking download progress.
Add TTS model download progress bar overlay in FightViewer.vue that
shows during model loading and auto-hides when complete.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:49:00 +00:00
DorianandClaude Opus 4.6 a04125afb3 perf: bundle audit and tree-shaking verification
Document top 5 largest chunks in vite.config.ts. Findings:
- kokoro-js (2.2MB) is in a separate worker chunk, NOT main bundle
- kaplay is tree-shaken into the lazy FightViewer chunk only
- nostr-tools is split across wallet chunks, minimal in main entry
- optimizeDeps.include is dev-only, no production effect
- All routes are properly code-split via dynamic imports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:46:04 +00:00
DorianandClaude Opus 4.6 edd08fde59 fix: abort dangling fetches and handle localStorage exceptions
- useNostr.ts: wrap auto-restore login fetch with AbortController,
  abort on logout to cancel in-flight request
- useWallet.ts: wrap localStorage.setItem/removeItem calls in try/catch
  for Safari private browsing quota exceptions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:43:34 +00:00
DorianandClaude Opus 4.6 7bd110684d fix: track and clear all intervals and event listeners
- FightPage.vue: store SSE listener refs in array, removeEventListener
  on each before close() in disconnectSSE()
- FightScene.ts: add cleanupTimers Set with trackedInterval/trackedTimeout
  helpers; replace key setInterval calls (projectile trails, entrance
  flames, talking animation, exhaust effects, dimensional shift, hole
  fade) with tracked versions; clear all on scene destroy()
- rate-limit.ts: export cleanupInterval handle for graceful shutdown

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 20:39:11 +00:00