Skip to content

desktop_engine_download_indicator

Xopher edited this page Aug 20, 2026 · 1 revision

Desktop Engine Download Indicator

Overview

This document details the real-time download and setup progress indication subsystem in YouMeOS Microverse.

Architecture

1. Data Contract (types.ts)

  • DownloadProgress: Represents real-time download metrics:
    • item: Name of the resource (e.g., FrankenPHP binary, WordPress core, SQLite Database Integration).
    • loaded: Bytes downloaded so far.
    • total: Total content length in bytes.
    • percent: Percentage completion (0-100).
    • speed: Current download speed in bytes per second.
    • detail: Formatted size string (e.g. 24.5 MB / 58.2 MB).
    • stage: Current stage (downloading, extracting, verifying, complete).

2. Main Process & Engine Setup

  • embedded-setup.ts & docker-setup.ts: Stream HTTP/HTTPS downloads with chunk measurement, throttling updates (~150ms intervals) to avoid IPC congestion.
  • EmbeddedEngine & DockerEngine: Maintain active downloadProgress and dispatch callbacks to EngineManager.
  • index.ts: Forwards download progress to the renderer window via engine:download-progress IPC event.

3. Preload Bridge (preload/index.ts)

  • Exposes onDownloadProgress(callback) in window.api for subscription in the renderer.

4. UI Layer (index.html, styles.css, app.ts)

  • #download-panel: Displays a neon-accented progress panel with animated spinner, component label, transfer size, current speed, and glowing progress bar.
  • Handles both determinate downloads (with byte metrics and percentages) and indeterminate states (like archive extraction).