Add foundational components and logic for migration, UI design, and input handling
- Introduced foundational UI components (`Badge`, `LockCard`, `SectionHeader`, `AvatarIcon`, etc.) for flexible layouts and consistent design. - Added migration support with the `MigrationModal` component and backend integration for exporting/importing data between Electron and Tauri. - Extended form components with `TextAreaInput`, `OrderInput`, `ToggleField`, and `ToolbarSelect` for improved input handling. - Updated `ScribeShell` with migration popup logic to prompt users for data migration. - Integrated `AlertStack` for better alert handling and notification management. - Enhanced Rust/Tauri services with migration command implementations. - Added translations and styles for new components.
This commit is contained in:
23
lib/tauri.ts
23
lib/tauri.ts
@@ -677,6 +677,29 @@ export async function applySeriesTombstones(tombstones: TombstoneRecord[]): Prom
|
||||
return invoke<void>('apply_series_tombstones', {tombstones});
|
||||
}
|
||||
|
||||
// ─── Migration ────────────────────────────────────────────────
|
||||
|
||||
export interface MigrationCheckResult {
|
||||
found: boolean;
|
||||
userId: string | null;
|
||||
hasDb: boolean;
|
||||
migrationPath: string | null;
|
||||
}
|
||||
|
||||
export interface MigrationResult {
|
||||
success: boolean;
|
||||
userId: string | null;
|
||||
error: string | null;
|
||||
}
|
||||
|
||||
export async function checkElectronMigration(migrationFilePath: string): Promise<MigrationCheckResult> {
|
||||
return invoke<MigrationCheckResult>('check_electron_migration', {migrationFilePath});
|
||||
}
|
||||
|
||||
export async function importFromElectron(migrationFilePath: string): Promise<MigrationResult> {
|
||||
return invoke<MigrationResult>('import_from_electron', {data: {migrationFilePath}});
|
||||
}
|
||||
|
||||
// ─── Window Management ──────────────────────────────────────
|
||||
|
||||
let loginWindowOpening = false;
|
||||
|
||||
Reference in New Issue
Block a user