jedmund-svelte/src
Justin Edmund 34a3e370ec refactor(admin): modularize ProjectForm with composable stores
Extract reusable form patterns following Svelte 5 best practices:

**New Store Factory** (`project-form.svelte.ts`)
- Centralizes form state management with `$state` and `$derived` runes
- Provides validation, payload building, and field mutation methods
- Type-safe with ProjectFormData interface
- Reusable across different contexts

**New Helpers**
- `useDraftRecovery.svelte.ts`: Generic draft restoration with auto-detection
- `useFormGuards.svelte.ts`: Navigation guards, beforeunload warning, Cmd+S shortcut
- `DraftPrompt.svelte`: Extracted UI component for draft recovery prompts

**Refactored ProjectForm.svelte**
- Reduced from 720 lines to 417 lines (42% reduction)
- Uses new composable helpers instead of inline logic
- Cleaner separation between UI orchestration and business logic
- All form state now managed through formStore
- Draft recovery, navigation guards fully extracted

**Benefits**
- Reusable patterns for PostForm, EssayForm, etc.
- Easier to test helpers in isolation
- Consistent UX across all admin forms
- Better maintainability and code organization

Closes Task 3 of admin modernization plan (Phase 2)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 23:24:50 -07:00
..
assets feat: add SVG icons for debug panel 2025-07-10 21:33:12 -07:00
lib refactor(admin): modularize ProjectForm with composable stores 2025-10-07 23:24:50 -07:00
routes refactor(admin): migrate dropdowns to clickOutside action 2025-10-07 21:58:34 -07:00
stories Prettier + build errors 2025-06-02 08:41:03 -07:00
app.css Linter 2025-06-13 21:22:49 -04:00
app.d.ts First commit for universe 2025-05-26 06:44:27 -07:00
app.html Add meta theme color 2025-08-07 03:12:25 -07:00
decs.d.ts Update decs.d.ts for GiantBomb API 2024-08-05 23:38:14 -07:00
global.d.ts Update config 2024-07-12 08:42:45 -04:00