isaachili / instagram-tools

Explore your Instagram connections with Instagram Tools! See mutual followers, track one-way follows, and stay updated on who’s new to your circle.
https://www.isaachili.com/instagram-tools/
0 stars 0 forks source link

Add a loading animation for file uploads #21

Open isaachili opened 1 week ago

isaachili commented 1 week ago

Large files may take some time to process and thus, it would be beneficial for the user to introduce a loading animation; otherwise, the user might think that the application has crashed.

isaachili commented 1 week ago

.NET 8 Blazor WASM does not support multi-threading: https://github.com/dotnet/aspnetcore/issues/54365 https://github.com/dotnet/aspnetcore/issues/17730

isaachili commented 1 week ago

Attempted to use Task.Delay(TimeSpan.FromMilliseconds(1)) to yield back to the current context and thus, allowing the UI to update. The UI experienced no noticeable freezing; however, it significantly prolonged the process time.

A more conservative Task.Delay(TimeSpan.FromMicroseconds(100)) yields no benefits in terms of UI — the UI experienced frequent freezing.

Task.Yield() had no impact on UI performance either.


It could be worth looking into incorporating Web Workers with WASM to offload the work to a background thread.