Commit Graph

25 Commits

Author SHA1 Message Date
Bas van Rossem
69e53ed695 feat(web): add search to Rules page
Filter sections by typing in the search box — matches against both
section titles and content. Shows result count and a "no results"
message. Expand/Collapse All buttons respect the filtered set.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:28:22 +01:00
Bas van Rossem
4de0b1cb2a feat(web): weapon templates for Add Weapon modal
Add 19 weapon templates from Appendix A (9 mundane + 10 spellcannons)
with pre-filled damage, range, and notes. Template picker in Add Weapon
modal is grouped by type (Mundane / Spellcannons). Selecting a template
auto-fills all fields; "Custom" option for manual entry. Also adds
notes field and two-column form layout to the modal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:26:04 +01:00
Bas van Rossem
c2432d6fab fix(web): center stepper labels
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:24:33 +01:00
Bas van Rossem
86134a34bb fix(web): use "max N" label and center combat stat cards
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:23:57 +01:00
Bas van Rossem
836a5d7a49 refactor(web): split dashboard into combat stats and reference stats
Hull and Armor current are always editable with steppers at the top
of the dashboard — these are the values that change every combat round.

All other stats (AC, Con, Speed, Class, Size, Max values, Crew,
Hardpoints, Cargo) are shown in a compact read-only reference grid
with an Edit button to toggle into editable mode when needed.

Removes separate MobilitySection and CrewSection in favor of a unified
ShipStatsSection that combines all reference stats in one place.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:22:42 +01:00
Bas van Rossem
642f1f70e8 feat: ship templates, crew fields, and read/edit dashboard
- Add crew_req, hardpoints, cargo fields (DB migration + server + types)
- Add 10 ship templates from Appendix A (Caravel, Galleon, Sloop, etc.)
- Enhanced CreateShipModal with template picker that auto-fills all stats
- Dashboard defaults to compact read-only view; Edit button toggles to
  editable steppers/dropdowns
- New CrewSection showing crew required, hardpoints, and cargo
- Two-column form layout in create modal for better use of space
- Fix .gitignore data/ pattern to only match root-level data directory

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:16:44 +01:00
Bas van Rossem
cbda07d793 feat(web): render markdown tables as real HTML tables
Add remark-gfm plugin so react-markdown renders GFM table syntax as
proper <table> elements. Wrap tables in a scrollable container for
mobile-friendly horizontal scrolling on wide tables like ship stats
and weapon lists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:02:58 +01:00
Bas van Rossem
0b6c810474 feat(web): expand Rules page with comprehensive ship reference
Replace the condensed battle reference with full ship-related content
from the complete Spelljammer reference. Now includes 18 sections:
General Spelljamming Rules, Ships, Ship Size, Maneuverability, Weapons,
Targeted Shots, Combat Turn, Complications, On-Deck/Below-Deck, Big
Damage rules, Ship & Weapon Stats (Appendix A), Subsystems & Upgrades
(Appendix B), Magic Items (Appendix C), NPC Crew (Appendix D),
Recovering Hull Points, Advanced Rules, Stunts (Appendix G), and a
Quick Reference checklist. Excludes Cards/Deck Building and Appendix F
(enemies) per request.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:57:32 +01:00
Bas van Rossem
aceef65002 feat(web): optimistic UI updates with debounced server sync
Ship and weapon updates now apply locally immediately so stepper clicks
feel instant. Server sends are debounced (300ms) and batched so rapid
clicks produce a single network call.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:44:15 +01:00
Bas van Rossem
275137cdbb feat(web): make stepper values tappable for direct number input
Tap the number to type a value directly instead of clicking +/- repeatedly.
Input auto-selects, commits on Enter/blur, cancels on Escape, and clamps
to min/max constraints.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:41:35 +01:00
Bas van Rossem
79ea720d18 fix(web): use 127.0.0.1 instead of localhost in Vite proxy
Fixes ECONNREFUSED ::1:3000 on Windows where localhost resolves to IPv6
but Fastify binds to IPv4 (0.0.0.0).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:39:12 +01:00
Bas van Rossem
047d4e9776 docs: add comprehensive README with testing and deployment instructions
Includes development setup, Docker deployment, API reference, WebSocket events,
troubleshooting guide, and curl-based test script. Updates App plan.md with
implementation completion status.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:31:42 +01:00
Bas van Rossem
9ef1199324 chore: add Dockerfile and docker-compose with static file serving
Multi-stage Docker build (web → server → production). Fastify serves
React build in production with SPA fallback. Docker Compose with volume
for SQLite persistence.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:30:17 +01:00
Bas van Rossem
510820b77a feat(web): add Rules/Reference page with collapsible battle reference sections
Embeds Battle reference.md content as collapsible sections with markdown
rendering, expand/collapse all controls, and styled tables and blockquotes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:29:07 +01:00
Bas van Rossem
b3a55d9fac feat(web): add reusable ConfirmDialog and polish delete interactions
Extracts reusable ConfirmDialog component, refactors ship delete to show
the ship name in confirmation, and improves interaction consistency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:27:43 +01:00
Bas van Rossem
1ef2f6338c feat(web): implement weapons section with add/edit/detail modals and notes
Adds WeaponCard with inline ammo stepper and status dropdown, AddWeaponModal,
WeaponDetailModal with full editing, and debounced NotesSection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:26:47 +01:00
Bas van Rossem
88e9bf7f05 feat(web): implement Ship Dashboard with vitals and mobility sections
Adds NumericStepper and EnumDropdown UI components, VitalsSection (hull/armor/AC/con),
MobilitySection (speed/maneuver class/size), with debounced real-time updates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:24:53 +01:00
Bas van Rossem
130cffd3c1 feat(web): implement Ship List page with create and delete modals
Adds ship cards with navigation, create ship modal with initial stats,
inline delete confirmation, and supporting CSS for modals and cards.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:23:00 +01:00
Bas van Rossem
06428f79cd feat(web): add zustand stores and Socket.IO client
Implements ship list store (REST-based) and ship detail store (Socket.IO-based)
with room join/leave, reconnection handling, and real-time event listeners.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:21:22 +01:00
Bas van Rossem
5f275bfcc7 feat(web): set up React app shell with routing and layout
Adds react-router-dom with routes for ship list, dashboard, and rules pages.
Includes TopBar with navigation and mobile-first dark theme CSS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:20:22 +01:00
Bas van Rossem
76ad839abb feat(server): add Socket.IO with ship rooms and real-time events
Implements ship:join/leave/update and weapon:create/update/delete socket events
with room-based broadcasting. Server validates and persists before broadcasting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:19:20 +01:00
Bas van Rossem
525a1a4a95 feat(server): implement weapon REST endpoints with validation
Adds POST/PATCH/DELETE for weapons with ammo constraint validation,
status enum checks, and ship existence verification on create.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:18:21 +01:00
Bas van Rossem
5f179229d6 feat(server): implement ship REST endpoints with Zod validation
Adds GET/POST/PATCH/DELETE /api/ships with constraint validation (current <= max),
enum checks for maneuver_class, and cascade delete for weapons.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:17:16 +01:00
Bas van Rossem
4b4d105009 feat(server): add SQLite connection and migration system
Adds better-sqlite3 with WAL mode, auto-migration runner that tracks applied
migrations, and initial schema for ships and weapons tables with constraints.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:16:01 +01:00
Bas van Rossem
6d60d714d0 chore: initial project scaffold with Fastify server and Vite React app
Set up monorepo structure with server/ (Fastify + TypeScript) and web/ (React + Vite + TypeScript).
Includes package configs, dev proxy setup, and mobile-first CSS foundation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 16:14:30 +01:00