Skip to content

v0.9.0: Architecture Deepening (6 Candidates)

Choose a tag to compare

@fb0sh fb0sh released this 18 Jul 09:17

What's Changed

Architecture Deepening — 6 Candidates Implemented

Candidate 2 — Collapse Download Type Trinity

  • Replace DownloadConfig with EngineConfig in types/engine_config.rs
  • Add DownloadItem::to_engine_config() and DownloadState::to_engine_config()
  • Rename proxy_nameproxy_url in EngineConfig (fixes semantic inconsistency)
  • Remove duplicate output_path field (was always identical to save_path)

Candidate 3 — Seal Engine Resume-State Seam

  • Rename OnCancelledOnResumeState (reflects actual purpose)
  • WorkerPool::add_with_id accepts on_resume callback parameter
  • DownloadManager creates facade-based callback via make_resume_callback()
  • Engine no longer directly calls gob::save_state (seam is sealed)

Candidate 5 — Extract Platform Utilities from cmd.rs

  • update.rs: AssetInfo, UpdateInfo, GithubRelease, GithubAsset, compare_versions, current_platform_suffix, check_update command
  • platform.rs: sync_autostart, deploy_extensions, copy_dir_recursive, resolve_extensions_dir
  • cmd.rs shrinks from 434 to ~180 lines (pure Tauri command routing)

Candidate 4 — Unify Event Vocabulary

  • event_bus.rs: FrontendEvent enum (single source of truth for event names)
  • EventBus struct wraps AppHandle::emit
  • Remove EmittedEvent struct and direct app_handle.emit calls from cmd.rs
  • constants/events.ts: EVENTS object mirrors FrontendEvent variants

Candidate 6 — Frontend Context Provider

  • contexts/AppContext.tsx: AppProvider owns dialog, selectedIds, filter
  • tauriClient.ts: plain object export replacing tauriCommands() function
  • App.tsx: uses useAppContext() instead of useState for state
  • Layout.tsx: reads from context, 19→11 props (state props removed)

Candidate 1 — Deepen DownloadManager Orchestrator

  • services/chunk_planner.rs: compute_connection_count, plan_chunks, check_disk_space
  • services/probe_service.rs: probe_with_fallback, build_user_agents
  • download_manager.rs: inline logic replaced with service calls

Files Changed

  • Created: types/engine_config.rs, event_bus.rs, update.rs, platform.rs, services/mod.rs, services/chunk_planner.rs, services/probe_service.rs, contexts/AppContext.tsx, tauriClient.ts, constants/events.ts
  • Deleted: hooks/useTauriCommands.ts
  • Modified: 16 existing files across backend and frontend

Full Changelog: v0.8.1...v0.9.0