Skip to content

Clean up dead code and modernize admin codebase

jedmund requested to merge cleanup/dead-code-and-modernization into main

Created by: jedmund

Summary

This PR modernizes the admin codebase with a comprehensive migration to Svelte 5, improved authentication, and significant code cleanup.

Key Changes

Svelte 5 Migration

  • Migrated all components to Svelte 5 runes mode
  • Replaced $: reactive statements with $derived() and $effect()
  • Updated createEventDispatcher to Svelte 5 callback props
  • Modernized event handler syntax

Admin Authentication

  • Migrated from basic auth to session-based authentication
  • Added authenticated fetch helper for API calls
  • Improved security and user experience

Autosave System

  • Built new runes-based autosave store
  • Integrated autosave across all admin forms (EssayForm, PhotoPostForm, SimplePostForm, ProjectForm)
  • Added draft recovery and navigation guards

Server-Side Data Loading

  • Migrated lists (projects, posts, media) to server-side loading
  • Improved performance and SEO
  • Added URL-based filtering and pagination

Code Cleanup

  • Removed dead code and unused test pages
  • Deleted obsolete components (AdminSegmentedController, BaseSegmentedController, AlbumMetadataPopover)
  • Migrated from npm to pnpm

Bug Fixes

  • Fixed RSS feed link and formatting rendering
  • Fixed drag-and-drop in Edra editor
  • Resolved navigation guard infinite loops
  • Fixed clickOutside action race conditions

Stats

  • 117 files changed
  • ~8,000 insertions, ~4,500 deletions
  • 62 commits

Test Plan

  • Admin login flow works with session auth
  • Autosave functions correctly across all forms
  • All admin lists load and filter properly
  • RSS feeds render correctly
  • Drag-and-drop works in editor
  • Navigation guards prevent data loss

Merge request reports

Loading