tasks/completed/opml-import-wizard/opml-import-wizard-tech-brief.md
Implement a multi-step OPML import wizard accessible from the Sources index page, enabling admin users to upload an OPML file, preview and select sources, run health checks, configure bulk settings, and confirm import, with results stored for later viewing as import history.
This extends SourceMonitor’s existing sources management, background job orchestration (Solid Queue), Turbo Streams real-time UI, and follows established Rails engine, controller, and asset pipeline patterns.
import_sessions table to persist wizard state (user reference, OPML file metadata, parsed sources, selections, bulk settings, step state).import_histories table to store completed import results (timestamp, user, sources imported, failures, skipped duplicates, error details).sourcemon_sources table; duplicate detection uses feed URL matching.| Table | Column | Type | Description |
|---|---|---|---|
import_sessions | user_id | UUID (FK) | References the admin user running the wizard |
opml_file_metadata | JSONB | Stores OPML file info (filename, size, upload timestamp) | |
parsed_sources | JSONB | Array of parsed sources with status (valid, malformed, duplicate) | |
selected_source_ids | JSONB | Array of selected source identifiers | |
bulk_settings | JSONB | Bulk source settings to apply | |
current_step | String | Tracks wizard step for session | |
created_at | Timestamp | Creation time | |
updated_at | Timestamp | Last update time | |
import_histories | user_id | UUID (FK) | References the admin user who performed the import |
imported_sources | JSONB | Array of successfully imported sources | |
failed_sources | JSONB | Array of sources that failed to import with error details | |
skipped_duplicates | JSONB | Array of sources skipped due to duplication | |
bulk_settings | JSONB | Settings applied to imported sources | |
started_at | Timestamp | Import start time | |
completed_at | Timestamp | Import completion time |
All new tables and columns follow SourceMonitor’s migration, indexing, and naming standards.