Commit graph

23 commits

Author SHA1 Message Date
d72d32001e fix: Address critical issues in admin form refactor
Phase 1: Critical Type Fixes
- Fix useDraftRecovery type signature to accept () => string | null
  (was incorrectly typed as string | null)
- Add TResponse generic parameter to AutoSaveStore interface
- Update all call sites to use function for draftKey reactivity

Phase 2: Robustness Improvements
- Remove non-null assertions in useFormGuards
- Capture autoSave in closures to prevent potential null access
- Make useFormGuards generic to accept any AutoSaveStore types

Documentation & Code Quality
- Document AlbumForm autosave initialization order
- Add comments explaining void operator usage for reactivity
- Fix eslint error: prefix unused _TResponse with underscore

These fixes address the critical issues found in PR review:
1. Type mismatch causing TypeScript errors
2. Non-null assertions that could cause crashes
3. Missing documentation for complex initialization patterns
2025-11-24 08:03:43 -08:00
Devin AI
5e58d31f7e refactor: Phase 1 admin form system unification
- Refactor EssayForm to use useDraftRecovery and useFormGuards composables
- Refactor AlbumForm to add autosave and use composables
- Refactor posts edit page to use composables
- Replace inline draft recovery logic with useDraftRecovery composable
- Replace inline form guards with useFormGuards composable
- Replace inline draft banners with DraftPrompt component
- Remove ~200 lines of duplicated code across forms
- Maintain zero lint errors throughout refactoring

Co-Authored-By: Justin Edmund <justin@jedmund.com>
2025-11-24 15:30:56 +00:00
974781b685 fix: Svelte 5 migration and linting improvements (61 errors fixed)
Complete Svelte 5 runes migration and fix remaining ESLint errors:

**Svelte 5 Migration (40 errors):**
- Add $state() and $state.raw() for reactive variables and DOM refs
- Replace deprecated on:event directives with onevent syntax
- Fix closure capture issues in derived values
- Replace svelte:self with direct component imports
- Fix state initialization and reactivity issues

**TypeScript/ESLint (8 errors):**
- Replace explicit any types with proper types (Prisma.MediaWhereInput, unknown)
- Remove unused imports and rename unused variables with underscore prefix
- Convert require() to ES6 import syntax

**Other Fixes (13 errors):**
- Disable custom element props warnings for form components
- Fix self-closing textarea tags
- Add aria-labels to icon-only buttons
- Add keyboard handlers for interactive elements
- Refactor map popup to use Svelte component instead of HTML strings

Files modified: 28 components, 2 scripts, 1 utility
New file: MapPopup.svelte for geolocation popup content
2025-11-24 04:47:22 -08:00
c4172ef411 fix: restore AlbumForm save functionality and update cleanup docs
- Restore AlbumForm handleSave() and validateForm() functions
- Add back missing imports (goto, zod, Button, toast)
- Restore isSaving and validationErrors state
- Add back albumSchema validation

This fixes the critical issue where AlbumForm had no way to save albums
due to over-aggressive dead code removal in previous cleanup.

Also update docs/eslint-cleanup-plan.md to reflect:
- Current branch status (207 errors remaining)
- Quality review of previous LLM work (84% good, 1 critical issue fixed)
- Detailed breakdown of remaining errors
- Actionable roadmap for completing the cleanup
2025-11-24 01:05:30 -08:00
Devin AI
6ae7a18443 lint: remove unused imports and variables (8 fixes)
Co-Authored-By: Justin Edmund <justin@jedmund.com>
2025-11-23 14:34:09 +00:00
Devin AI
841ee79885 lint: remove more unused imports and variables (5 fixes)
Co-Authored-By: Justin Edmund <justin@jedmund.com>
2025-11-23 14:32:37 +00:00
Devin AI
018fc67b2c lint: remove unused imports, variables, and dead code (10 fixes)
Co-Authored-By: Justin Edmund <justin@jedmund.com>
2025-11-23 14:30:57 +00:00
Devin AI
3e2336bc5c lint: remove more unused imports and variables (6 fixes)
Co-Authored-By: Justin Edmund <justin@jedmund.com>
2025-11-23 14:29:05 +00:00
9c746d51c0 fix: replace any types in frontend components
- use Leaflet types (L.Map, L.Marker, L.LeafletEvent) for map components
- use Post and Project types from Prisma for form components
- use JSONContent type for editor instances
- use Snippet type for Svelte 5 render functions
- use EditorView type for TipTap/ProseMirror views
- use proper type guards for error handling
- add editor interface types for save/clear methods
2025-11-23 05:32:09 -08:00
cf2842d22d refactor: migrate admin UI to Svelte 5 runes
Convert admin components from Svelte 4 to Svelte 5 syntax using $props, $state, $derived, and $bindable runes. Simplifies AdminNavBar logic and improves type safety.
2025-11-03 23:03:28 -08:00
e2949bff20 refactor(admin): update form flows for session auth 2025-10-07 05:57:45 -07:00
a4f5c36f71 refactor: migrate media components to Svelte 5 runes
- Convert all media-related admin components to use $state and $derived
- Update event handlers to use new syntax (onclick instead of on:click)
- Refactor prop destructuring to use interface Props pattern
- Improve type safety and remove legacy reactive statements
- Simplify component logic with Svelte 5 patterns

Components updated:
- AlbumForm: Enhanced validation and state management
- FilePreviewList: Simplified preview rendering
- FileUploadZone: Improved drag-and-drop handling
- MediaDetailsModal: Better metadata display
- MediaGrid: Optimized selection state
- MediaMetadataPanel: Cleaner EXIF data presentation
- MediaUploadModal: Streamlined upload flow
- MediaUsageList: Enhanced usage tracking
- UnifiedMediaModal: Consolidated media management

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 23:20:56 -07:00
e64788962e refactor: remove EnhancedComposer backward compatibility
- Remove EnhancedComposer shim and old backup file
- Update all imports to use new Composer from ./composer
- Fix editor command implementations for link operations
- Fix dropdown hook usage with proper reactive patterns
- All 5 components now directly import the modular implementation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-26 09:12:08 -04:00
a31291d69f refactor: replace deprecated $grey- variables with $gray-
- Replace 802 instances of $grey- variables with $gray- across 106 files
- Remove legacy color aliases from variables.scss
- Maintain consistent naming convention throughout codebase

This completes the migration to the new color scale system.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-25 21:41:50 -04:00
a04d48e549 feat: enhance editor with drag handle and UI improvements
- Add drag handle functionality to editor blocks
- Improve dropdown menu component with better state management
- Enhance composer with AI-powered features
- Update form components to use toast notifications
- Add chevron-right and drag-handle SVG icons
- Various bug fixes and UI refinements

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-25 01:06:46 +01:00
2bbc306762 refactor: restructure routing - albums at /albums/[slug], photos at /photos/[id]
- Move album routes from /photos/[slug] to /albums/[slug]
- Simplify photo permalinks from /photos/p/[id] to /photos/[id]
- Remove album-scoped photo route /photos/[albumSlug]/[photoId]
- Update all component references to use new routes
- Simplify content.ts to always use direct photo permalinks
- Update PhotoItem, MasonryPhotoGrid, ThreeColumnPhotoGrid components
- Update UniverseAlbumCard and admin AlbumForm view links
- Remove album context from photo navigation

Breaking change: URLs have changed
- Albums: /photos/[slug] → /albums/[slug]
- Photos: /photos/p/[id] → /photos/[id]

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-24 10:35:21 +01:00
e305bf15ef refactor: replace button text changes with toast notifications
- Update all admin forms to use toast messages
- Remove temporary "Saving..." button text changes
- Remove inline error/success message displays
- Keep buttons disabled during operations
- Show loading, success, and error toasts appropriately

Updated components:
- AlbumForm: Save operations with descriptive messages
- StatusDropdown: Remove loading text from buttons
- MediaDetailsModal: Save, delete, and copy operations
- ProjectForm: Create and update operations
- EssayForm: Publish and save draft operations
- SimplePostForm: Create and update posts
- PhotoPostForm: Publish photo posts

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-24 01:56:26 +01:00
e488107544 feat(admin): update album management UI for content support
- Update AlbumForm to use EnhancedComposer for content editing
- Add AlbumSelector component for album selection workflows
- Update AlbumListItem with improved styling and metadata display
- Enhance album edit/create pages with new content capabilities
- Add support for geolocation data in album forms
- Improve form validation and error handling

Modernizes the album management interface with rich content editing.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-24 01:12:54 +01:00
f753d5fb8b Unify fullscreen editors 2025-06-13 14:17:26 -04:00
c615791090 Fix slug 2025-06-12 03:28:05 -07:00
e43fd6335f Textarea component and Project form updates 2025-06-10 21:45:24 -07:00
78443e2bdd Prettier + build errors 2025-06-02 08:41:03 -07:00
b314be59f4 Library support in Edra 2025-05-31 13:17:38 -07:00