Skip to content

explorer: surface 'Fetching sample index…' during cold-cache boot→point-mode wait (#190 fix 2)#191

Open
rdhyee wants to merge 1 commit intoisamplesorg:mainfrom
rdhyee:fix/190-loading-message-boot-to-point-mode
Open

explorer: surface 'Fetching sample index…' during cold-cache boot→point-mode wait (#190 fix 2)#191
rdhyee wants to merge 1 commit intoisamplesorg:mainfrom
rdhyee:fix/190-loading-message-boot-to-point-mode

Conversation

@rdhyee
Copy link
Copy Markdown
Contributor

@rdhyee rdhyee commented May 10, 2026

Summary

Implements fix 2 from #190 — surface the loading state during the boot→point-mode gap so cold-cache deep-links to a point-mode altitude don't look broken during the 60-90s wait.

Independent of fix 1 (move off Quarto's bundled DuckDB-WASM 1.24.0), which is blocked on UBIGINT representation changes in newer wasm builds (see spike result comment).

Phase-message sequence

Before (cold-cache deep-link to alt < 120 km):

  1. Loading H3 res8... — internal jargon, fires ~immediately, persists ~85 s
  2. 175,653 clusters, X samples. Zoom closer for individual samples. — flashes for one frame; misleading because the user is already zoomed in
  3. Loading individual samples... — fires from inside loadViewportSamples
  4. 47 individual samples. Click one for details.

After:

  1. Fetching sample index… — fires ~immediately, persists during the cold-cache wait
  2. Loading individual samples...
  3. 47 individual samples. Click one for details.

Implementation

  • loadRes() now accepts an opts parameter:
    • opts.loadingMsg — override the default "Loading H3 res${res}..." text
    • opts.suppressDoneMsg — skip the interim "... Zoom closer for individual samples." done message
  • The camera handler's cluster→point-mode branch (explorer.qmd ~L1848) passes both options, so the boot path shows one coherent message.
  • Other loadRes callers (source-filter handler, cluster-mode resolution changes) are unchanged.

Comments inline reference #190 so the rationale is discoverable from the code.

Test plan

  • Cold-cache visit to https://isamples.org/explorer.html#v=1&lat=34.9954&lng=33.7052&alt=62054&heading=360.0&mode=point&h3=882da6b2e1fffff (use a fresh browser profile / disabled cache) — confirm Fetching sample index… appears and persists until sample dots render, with no Loading H3 res8... or Zoom closer for individual samples. flashes in between.
  • Wider deep-link (alt > 180 km, cluster mode) — confirm phase messages are unchanged (still Loading H3 res${res}...${count} clusters, ${samples} samples. Zoom in for finer detail.).
  • Source-filter toggle while in cluster mode — confirm Loading H3 res${res}... still appears (loadRes called without opts).
  • Source-filter toggle while in point mode — confirm Loading individual samples... still appears.
  • Camera zoom from cluster → point mode (warm cache, no cold network wait) — confirm transition still works and Loading individual samples... fires.

Refs

🤖 Generated with Claude Code

isamplesorg#190 fix 2)

On a cold-cache deep-link to a point-mode altitude, DuckDB-WASM 1.24.0
falls back to a full HTTP read of samples_map_lite.parquet (~60 MB) and
the res8 cluster file, blocking sample dots for 60-90s. Today the only
phase-message signal during that wait is the internal "Loading H3 res8..."
string, followed by a misleading "Zoom closer for individual samples."
flash before point mode finally fires "Loading individual samples...".

Fix the user-facing signal independently of the version bump (issue isamplesorg#190
fix 1, blocked on UBIGINT representation changes in newer wasm builds):

- loadRes() now accepts opts.loadingMsg / opts.suppressDoneMsg so callers
  can override the default phase text and skip the intermediate done
  message when the next step will overwrite it anyway.
- Camera handler's cluster→point branch passes loadingMsg='Fetching
  sample index…' and suppressDoneMsg=true, so the cold-cache wait shows
  one coherent message instead of three transient ones.

Other loadRes callers (sourceFilter handler, cluster-mode resolution
changes) keep the original "Loading H3 res\${res}..." behavior unchanged.

Refs isamplesorg#190.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant