Skip to content

Conversation

@ovsky
Copy link
Owner

@ovsky ovsky commented Dec 5, 2025

This pull request introduces significant improvements to the DownloadManager to enhance reliability, user experience, and persistence of download history. The most notable changes include implementing a robust internal ID mapping system to prevent collisions, adding persistent download history with disk-backed storage, and improving UI logic so completed and failed downloads remain visible until the user clears them. Additionally, new utility methods have been added for encoding/decoding fields and managing history snapshots.

Download ID Management Improvements

  • Added an internal ID mapping system (external_to_internal_id_ and related logic) to prevent collisions and ensure downloads are tracked consistently, even if external IDs are reused by Ultralight. This affects download request, begin, finish, fail, and cleanup logic. [1] [2] [3] [4] [5] [6]

Persistent Download History

  • Implemented persistent download history: history is loaded from disk on startup (LoadHistoryFromDisk), updated and trimmed on changes, and saved back to disk. This ensures download records are retained across sessions and only a maximum number of entries are kept. [1] [2] [3] [4]

UI and User Experience Enhancements

  • Modified UI logic so that completed and failed downloads remain visible until the user explicitly clears them, improving discoverability and allowing users to inspect or retry failed downloads. [1] [2] [3]
  • Changed overlay dismissal behavior: the downloads overlay is no longer auto-closed on mouse down outside the overlay, requiring explicit user action to dismiss.

Utility Methods for History Encoding/Decoding

  • Added utility methods for encoding and decoding history fields, converting status strings, and handling time points, enabling robust serialization and deserialization of download records. [1] [2]

General Codebase Enhancements

  • Added necessary includes (<vector>, <cstdio>) for new functionality.
  • Improved thread safety and notification logic by ensuring history is trimmed and updated only when necessary, and the UI is notified of changes appropriately. [1] [2]

Let me know if you want to dive deeper into any specific change!

ovsky added 2 commits December 5, 2025 17:22
Implements saving and loading of download history to disk, including encoding/decoding fields and trimming history to a maximum number of entries. Adds internal/external ID mapping to avoid collisions, ensures UI visibility for finished/failed downloads, and updates ClearFinishedDownloads to notify changes when records are removed.
Prevents automatic dismissal of the downloads overlay on mouse down, requiring explicit user action to close it. Also stops aggressive pruning of completed downloads, keeping them visible until the user clears them, and only notifies about new downloads by sequence change.
@ovsky ovsky merged commit 75edd22 into dev Dec 5, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants