fix: Loading indicator fixes (#398)

Resolves https://github.com/webrecorder/replayweb.page/issues/397

## Changes

- Uses animated logo when loading
- Show non-animated logo for error and other states where user action is required.
- Only shows progress bar if progress is >0
- Fixes WARC progress bar percentage lagging behind displayed "Loaded"
values
- Fixes "Cancel" not redirecting back to initial view
- Removes extra spacing from logo image file

---------

Co-authored-by: Henry Wilkinson <henry@wilkinson.graphics>
Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
This commit is contained in:
sua yoo
2025-02-11 23:17:01 -08:00
committed by GitHub
co-authored by Henry Wilkinson Ilya Kreymer
parent 50ac4e41ca
commit 94cbf5e43d
5 changed files with 91 additions and 29 deletions
+7
View File
@@ -403,6 +403,7 @@ export class ReplayWebApp extends LitElement {
@replay-favicons=${this.onFavIcons}
@update-title=${this.onTitle}
@coll-loaded=${this.onCollLoaded}
@coll-load-cancel=${this.onCollLoadCancel}
@about-show=${() => (this.showAbout = true)}
></wr-item>`;
}
@@ -691,6 +692,12 @@ export class ReplayWebApp extends LitElement {
}
}
private onCollLoadCancel() {
this.sourceUrl = null;
this.loadInfo = null;
window.history.pushState({}, "", new URL(window.location.href).origin);
}
// @ts-expect-error [// TODO: Fix this the next time the file is edited.] - TS7006 - Parameter 'event' implicitly has an 'any' type.
onTitle(event) {
if (event.detail.title) {