Skip to content

Initialize progress bar with MonoConfig asset count estimation - #1025

Merged
jeromelaban merged 10 commits into
dev/mazi/progressbar-adjustfrom
copilot/sub-pr-971
Feb 13, 2026
Merged

jeromelaban merged 10 commits into
dev/mazi/progressbar-adjustfrom
copilot/sub-pr-971

Conversation

Copilot AI commented Jan 16, 2026 •

Copy link
Copy Markdown
Contributor

The progress bar starts at an arbitrary value, causing it to jump backward when .NET incrementally reports total resource counts. This creates a confusing UX where progress appears to regress during loading.

Changes

  • Added initializeProgressEstimation() method: Counts MonoConfig.assets (assemblies, satellite resources, ICU data, PDBs) at config load time and sets initial target to 30% of estimated total (minimum 30)

  • Constructor initialization: Progress tracking variables now initialized to prevent undefined behavior if reportDownloadResourceProgress() executes before estimation

  • Array validation: Added Array.isArray() check to prevent runtime errors on malformed config

  • Constants extraction: Replaced magic numbers with MINIMUM_INITIAL_TARGET and INITIAL_TARGET_PERCENTAGE for maintainability

Implementation

private initializeProgressEstimation() {
    if (this._monoConfig && this._monoConfig.assets && Array.isArray(this._monoConfig.assets)) {
        const estimatedTotal = this._monoConfig.assets.length;
        this._currentTargetProgress = Math.max(
            Bootstrapper.MINIMUM_INITIAL_TARGET,
            estimatedTotal * Bootstrapper.INITIAL_TARGET_PERCENTAGE
        );
    } else {
        this._currentTargetProgress = Bootstrapper.MINIMUM_INITIAL_TARGET;
    }
    this._previousTotalResources = 0;
}

The convergence algorithm remains unchanged - as .NET reports updated totals, the target still increments by half the remaining distance to 100, providing smooth progress even as the actual count varies.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@CLAassistant

CLAassistant commented Jan 16, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ jeromelaban
❌ Copilot
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI commented Jan 16, 2026

Copy link
Copy Markdown
Contributor Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 0t3vsblobprodcus362.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build src/Uno.Wasm.Bootstrap/Uno.Wasm.Bootstrap.csproj (dns block)
  • 1p7vsblobprodcus324.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build src/Uno.Wasm.Bootstrap/Uno.Wasm.Bootstrap.csproj (dns block)
  • c50vsblobprodcus330.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build src/Uno.Wasm.Bootstrap/Uno.Wasm.Bootstrap.csproj (dns block)
  • kmuvsblobprodcus389.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build src/Uno.Wasm.Bootstrap/Uno.Wasm.Bootstrap.csproj (dns block)
  • n3kvsblobprodcus335.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build src/Uno.Wasm.Bootstrap/Uno.Wasm.Bootstrap.csproj (dns block)
  • ofvvsblobprodcus315.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build src/Uno.Wasm.Bootstrap/Uno.Wasm.Bootstrap.csproj (dns block)
  • se1vsblobprodcus349.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build src/Uno.Wasm.Bootstrap/Uno.Wasm.Bootstrap.csproj (dns block)
  • u6ovsblobprodcus377.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet dotnet build src/Uno.Wasm.Bootstrap/Uno.Wasm.Bootstrap.csproj (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Address feedback on progress bar initialization improvements Initialize progress bar with MonoConfig asset count estimation Jan 16, 2026
Copilot AI requested a review from MartinZikmund January 16, 2026 15:56
@jeromelaban
jeromelaban marked this pull request as ready for review February 13, 2026 16:24
@jeromelaban

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@jeromelaban
jeromelaban merged commit 2879e4b into dev/mazi/progressbar-adjust Feb 13, 2026
3 checks passed
@jeromelaban
jeromelaban deleted the copilot/sub-pr-971 branch February 13, 2026 16:24
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.

4 participants