Commit graph

34 commits

Author SHA1 Message Date
Devin AI
62263e5785 lint: fix unused expressions by adding void operator (26 fixes)
Co-Authored-By: Justin Edmund <justin@jedmund.com>
2025-11-24 05:39:21 +00: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
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
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
128a24ccde fix(admin): remove infinite loop in navigation guards
Fixed infinite loop caused by calling goto() inside beforeNavigate,
which would trigger the same navigation guard again.

The correct approach is to NOT cancel navigation, but simply await
the autosave flush. SvelteKit's beforeNavigate accepts async callbacks,
so navigation will naturally wait for the flush to complete before
proceeding.

Changes:
- Removed navigation.cancel() calls
- Removed goto() calls that created the loop
- Simply await autoSave.flush() and let navigation proceed

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 18:43:28 -07:00
8fa26fb39e fix(admin): replace navigation.retry() with goto() after flush
Fixed navigation guards in all forms that were calling the non-existent
navigation.retry() method. After canceling navigation and flushing autosave,
now properly uses goto() to navigate to the intended destination.

Files fixed:
- ProjectForm.svelte
- EssayForm.svelte
- PhotoPostForm.svelte
- SimplePostForm.svelte
- posts/[id]/edit/+page.svelte

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 18:34:56 -07:00
672eb47143 fix(admin): only block navigation/close when changes are unsaved
- Update beforeNavigate guard to check autosave status before blocking
- Allow instant navigation when status is 'saved' (no interruption)
- Add beforeunload warning for browser close/reload
- Only show warnings when status is NOT 'saved' (saving/error/idle)
- Improves UX by not interrupting users when everything is already saved

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 13:21:57 -07:00
f35fa60207 refactor(admin): only save local draft on autosave failure
- Remove redundant localStorage saves on every form change
- Only save draft when autosave status is 'error' or 'offline'
- Reduces draft recovery banner noise for successful autosaves
- Navigation guard still prevents data loss when navigating away

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 13:09:39 -07:00
dfbf45f8a4 refactor(admin): migrate ProjectForm to runes-based autosave
- Update ProjectForm to use new createAutoSaveStore with Svelte 5 runes
- Fix $derived syntax in AutoSaveStatus (use $derived.by for multi-statement)
- Add hasLoaded flag to prevent infinite loop on autosave completion
- Move draft recovery from inline header to prominent banner below header
- Style draft banner with blue info colors and slide-down animation
- Fix draft persistence by clearing localStorage on restore/dismiss
- Call beforeNavigate at top level for proper Svelte 5 lifecycle
- Add keyboard shortcut (Cmd/Ctrl+S) and navigation guard effects
- Update AutoSaveStatus to support both old stores and new reactive props

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-07 11:55:51 -07:00
e2949bff20 refactor(admin): update form flows for session auth 2025-10-07 05:57:45 -07:00
c98ba3dcf0 feat(admin): integrate autosave and local draft prompt into ProjectForm and Post Edit; add Cmd/Ctrl+S and beforeNavigate flush 2025-08-31 11:03:27 -07:00
9da64583ba style: make editor more immersive with full-width design
- Remove border and background from full variant composer
- Increase padding for better readability
- Update toolbar padding to match content area
- Make case study panel full-width and transparent

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-26 10:01:10 -04:00
75b61021a0 fix: simplify editor content loading to prevent infinite loops
- Use a simple contentLoaded flag to load content once when editor is ready
- Remove complex change detection that was causing infinite update loops
- Remove debug logging now that issue is resolved

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-26 09:56:24 -04:00
7211ccff9f debug: add logging to trace editor content loading issue 2025-06-26 09:50:00 -04: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
e92cc2393e feat: create unified PhotoGrid component
- Created PhotoGrid.new.svelte with flexible column layouts (1, 2, 3, auto)
- Supports ultrawide image handling from ThreeColumnPhotoGrid
- Maintains PhotoItem component usage for consistency
- Created wrapper components for backward compatibility:
  - SingleColumnPhotoGrid.new.svelte
  - TwoColumnPhotoGrid.new.svelte
  - ThreeColumnPhotoGrid.new.svelte
- Fixed FormFieldWrapper import errors (was already removed)

This consolidates 4 similar grid components into a single flexible component, reducing code duplication by ~60%.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-26 05:32:55 -04:00
d4490fd70c fix: add missing error and successMessage state variables in ProjectForm
Fixes ReferenceError where template was using undefined variables.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-25 22:07:28 -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
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
b8d965370b feat(admin): update admin pages with new editor and workflows
- Update media management page with album associations
- Enhance media audit page with better reporting
- Improve regenerate thumbnails page
- Update post pages to use EnhancedComposer
- Update universe compose page with new editor
- Update ProjectForm to use EnhancedComposer
- Add better error handling and loading states
- Improve form validation across admin pages

Modernizes admin workflows with unified components.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-24 01:14:41 +01:00
f753d5fb8b Unify fullscreen editors 2025-06-13 14:17:26 -04:00
c50b8e2e53 Add view on site button 2025-06-12 03:28:34 -07:00
3ba7f6b762 We ran the linter 2025-06-11 00:54:05 -07:00
e43fd6335f Textarea component and Project form updates 2025-06-10 21:45:24 -07:00
b3c9529e3f Fix image handling in forms 2025-06-10 20:48:02 -07:00
9ba787cd8b Add dropdown to change object publish state and fix z-index 2025-06-02 17:00:52 -07:00
78443e2bdd Prettier + build errors 2025-06-02 08:41:03 -07:00
b2ad9efd9c Fixes for UniverseComposer and delete modals.
Also standardizing Publish buttons and whatnot
2025-06-02 06:19:39 -07:00
0d90981de0 Fix Edit Post and Album list 2025-06-02 04:32:32 -07:00
2f504abb57 big update 2025-06-01 23:48:10 -07:00
c7b4f57ab0 tbh i dont know whats going on anymore 2025-05-31 02:08:26 -07:00
4fde0e6148 New project + Edit project working
* Can fill out metadata
* Uploads SVGs for logos
* Editor works and persists/loads data
2025-05-29 20:19:01 -07:00