Commit Graph

4 Commits

Author SHA1 Message Date
Thomas Hallock 8511998d0c docs: add comprehensive precision controls documentation for Know Your World
Add detailed documentation for the advanced precision control system that makes sub-pixel regions (Gibraltar 0.08px, Jersey 0.82px) clickable:

- PRECISION_CONTROLS.md: Complete technical deep-dive
  - Automatic cursor dampening (3-25% speed based on region size)
  - Auto super-zoom (up to 60x) after 500ms hover on sub-pixel regions
  - Quick-escape mechanism (>50px/frame cancels all precision features)
  - Crosshair accuracy fix ensuring dampened cursor matches hover highlighting
  - Configuration constants, debug logging, performance considerations

- know-your-world/README.md: Game overview and feature documentation
  - Game modes, maps, difficulty levels, study mode
  - Visual features, technical architecture, component structure
  - Development guide, troubleshooting, configuration

- Updated documentation graph:
  - Main README → Arcade Games → Know Your World → Precision Controls
  - All documentation now reachable from root README

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 18:06:34 -06:00
Thomas Hallock 7c33d0246f fix: prevent undefined displayRules error in worksheet generator
Fixes production error "Cannot read properties of undefined (reading 'carryBoxes')"
that occurred when users tried to adjust difficulty settings.

Root cause: displayRules was undefined for new users or users with old V1 config
in database. Difficulty adjustment buttons accessed displayRules.carryBoxes without
checking if displayRules existed first.

Changes:
- AdditionWorksheetClient: Initialize displayRules with defaults when missing
- ConfigPanel: Use null-coalescing operators instead of non-null assertions
- ConfigPanel: Add error logging when required fields are missing
- NEW: WorksheetErrorBoundary component to catch all errors in worksheet page
- page.tsx: Wrap client component with error boundary

This ensures users see helpful error messages instead of blank pages,
and never need to open the browser console to understand what went wrong.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 13:01:54 -06:00
Thomas Hallock b47b1cc03f docs(arcade): update README with Phase 3 type inference architecture
**Updates**:
- Added "Key Improvements" section highlighting Phase 3
- Updated architecture diagram to show type system layer
- Added validateConfig to GameDefinition interface docs
- Updated Step 6 to include validateConfig example
- Added Step 7c: Config Type Inference guide
- Documented benefits of type inference (10-15 lines saved per game)

**Example shown**:
```typescript
// Before: Manual definition
export interface NumberGuesserGameConfig { ... }

// After: Inferred
export type NumberGuesserGameConfig = InferGameConfig<typeof numberGuesserGame>
```

**Key concept**: defaultConfig serves as source of truth for types.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 21:38:44 -05:00
Thomas Hallock 6f6cb14650 docs(arcade): update docs for unified validator registry
## Documentation Updates

### src/arcade-games/README.md
- **Step 7**: Expanded to explain both registration steps
  - 7a: Register validator in validators.ts (server-side)
  - 7b: Register game in game-registry.ts (client-side)
- Added explanation of why both steps are needed
- Added verification warnings that appear during registration
- Clarified the difference between isomorphic and client-only code

### docs/AUDIT_MODULAR_GAME_SYSTEM.md
- **Status**: Updated from "CRITICAL ISSUES" to "ISSUE RESOLVED"
- **Executive Summary**: Marked system as Production Ready
- **Issue #1**: Marked as RESOLVED with implementation details
- **Issue #2**: Marked as RESOLVED (validators now accessible)
- **Issue #5**: Marked as RESOLVED (GameName auto-derived)
- **Compliance Table**: Updated grade from D to B+
- **Action Items**: Marked critical items 1-3 as completed

## Summary

Documentation now accurately reflects the unified validator registry
implementation, providing clear guidance for developers adding new games.

Related: 9459f37b (implementation commit)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 20:41:06 -05:00