From 624aab440b3cfaef917a3bddf34948b25369f4e1 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 6 Nov 2026 15:57:51 +0000 Subject: [PATCH 1/2] Web app: a new loading screen with real steps, an error screen and an animated logo - The EaglePlot logo (logo.png, redrawn as inline SVG) builds itself: the disc, the axes, the bars one by one, then the line through the points. While Python loads, a pulse runs along the points. Inline SVG, CSS and a classic script: it draws before stlite.js is fetched and loads nothing else. - Four real steps from stlite's kernel events (loadProgress matched by keyword, only moving forward; loadFinished), replacing the endlessly sliding bar. loadError shows the message and a Reload button. - The 45 MB note shows only on a first visit (localStorage flag set after a successful start). Reduced motion: the logo is drawn complete and nothing moves. - When the sidebar appears the logo zooms out and the splash fades (450 ms). - smoke.js checks that the splash shows a step, reaches the last one and is removed. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 7 ++ packaging/web/README.md | 27 +++++- packaging/web/index.html | 197 +++++++++++++++++++++++++++++++++++---- scripts/web/smoke.js | 27 +++++- 4 files changed, 236 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c67df5..0ac23a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,13 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Changed +- **A new loading screen for the web app.** The EaglePlot logo builds itself (the bars grow, + then the line draws through the points) and a pulse runs along the points while Python + loads. Below it, four real steps (downloading Python, installing the science libraries, + starting EaglePlot, opening your workspace) replace the endlessly sliding bar. The note + about the 45 MB download appears only on a first visit. If loading fails, the screen says + why and offers **Reload** instead of sliding forever. With reduced motion turned on in + the system settings, the logo appears complete and nothing moves. - **A "Get started" Home page.** With no data loaded, Home offers three example datasets, each a single click away from a plot in Quick Plot, plus buttons to upload a file or browse all examples, instead of "Datasets 0 · Plots 0 · Analyses 0". diff --git a/packaging/web/README.md b/packaging/web/README.md index b4eff31..4b3243b 100644 --- a/packaging/web/README.md +++ b/packaging/web/README.md @@ -45,7 +45,7 @@ Streamlit exception, uncaught page error, failed download or request to another | File | Content | | --- | --- | -| `index.html` | Loading splash, the stlite mount call, and a download workaround (below) | +| `index.html` | Loading splash (below), the stlite mount call, and a download workaround (below) | | `404.html` | A copy of `index.html`, for hosts that serve the nearest `404.html` (below) | | `site-config.js` | Written by the build: entrypoint, packages, wheels, Pyodide URL, Streamlit flags, storage mount, environment | | `eagleplot-app.zip` | `eagleplot/` (code, assets, gallery, example data) and `.streamlit/config.toml`; entrypoint `eagleplot/Home.py` | @@ -73,6 +73,31 @@ Opening `index.html` from disk fails: the app runs in a module Web Worker and lo app zip, wheels and Pyodide with `fetch()`, and browsers block both for `file://` pages. Serve the directory over HTTP (`python -m http.server`, GitHub Pages, any static host). +## Loading splash + +`index.html` draws the splash before anything else loads: a classic inline script, inline +CSS and SVG, and no other files, so it is on screen while `stlite.js` and Pyodide download. + +- **The logo.** `eagleplot/assets/logo.png` is redrawn as inline SVG (960 × 960, the PNG's + own coordinates) so its parts can move: the disc pops in, the axes draw, the bars grow one + by one, then the red line draws and each point pops as the line reaches it (Web Animations + API). While Python loads, a pulse runs along the points. If the logo changes, redraw it + here too. No web fonts: the smoke test fails on requests to other origins. +- **Steps.** `window.eaglePlotSplash` exposes `setStage(i)`, `ready()` and `fail(message)`. + The module script calls them from stlite's kernel events: `loadProgress` messages are + matched by keyword (`/pyodide/`, `/install|package/`, `/streamlit|server|boot/`), + `loadFinished` is the last step, and `loadError` shows the message and a Reload button. + Steps only move forward, so a reworded stlite message leaves the step where it is. The + events come from `_kernel`, which stlite calls unstable: re-check them when upgrading. +- **Leaving.** The existing sidebar observer calls `ready()`, which waits for the logo to + finish building, fades the splash out over 450 ms and removes `#loading`. It also sets + `localStorage["eagleplot.started"]`, which hides the first-visit download note next time. +- **Reduced motion.** With `prefers-reduced-motion`, the logo is drawn complete and nothing + moves. + +The smoke test checks that the splash shows a step, reaches the last one and is gone once +the app is up. + ## Browser-specific behaviour - **Downloads.** Streamlit 1.65 starts a deferred download diff --git a/packaging/web/index.html b/packaging/web/index.html index 5729ff2..13e396b 100644 --- a/packaging/web/index.html +++ b/packaging/web/index.html @@ -7,34 +7,178 @@ +
- -
Starting EaglePlot…
- - - EaglePlot runs entirely in your browser: your data never leaves this computer. - The first visit downloads Python and the scientific libraries (tens of MB); - later visits start from the browser cache. - +
+ +
EaglePlot
+
+
Starting EaglePlot…
+ +
Runs entirely in your browser. Your data stays on this computer.
+
+
+
Schultz Lab · North Carolina Central University
+