explorer: skip tryEnterPointModeIfNeeded chase on non-applied loadRes (closes #193)#196
Merged
rdhyee merged 1 commit intoisamplesorg:mainfrom May 10, 2026
Conversation
…closes isamplesorg#193) When a chase site's loadRes returns `false` (stale or failed), the post-await chase would overpaint the user-facing phase message — most visibly the "Failed to load H3 res${target} — try zooming again." failure copy that flickers for a frame before being replaced by "Fetching sample index…" from the chase's own loadRes(8). Capture loadRes's return into `applied` at the three external chase sites and gate the chase on `if (applied)`: - Source-filter handler's mode==='cluster' branch - Camera handler's cluster-reload branch (cluster→cluster transition) - Camera handler's cluster-mode resolution-change branch Stale recovery is preserved: when our call returns 'false-stale', the supersedor's own chase site handles recovery (per the invariant documented in isamplesorg#194). Failed returns no longer paper over the failure message. Update the INVARIANT block on tryEnterPointModeIfNeeded() to reflect the new idiom (`const applied = await loadRes(...); if (applied) await tryEnterPointModeIfNeeded();`) and explain why we gate on `applied`. The verification grep continues to work — it lists the four awaited call sites; manual confirmation now checks for the `const applied = ...; if (applied) await tryEnterPointModeIfNeeded();` shape rather than the unconditional chase. Closes isamplesorg#193. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
Codex review round 1 — LGTM
Merging. |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #193. Stops
tryEnterPointModeIfNeeded()from being invoked after aloadRescall returnsfalse, so the user-facing failure phase message (Failed to load H3 res${target} — try zooming again.) no longer flickers before being overpainted by the chase's ownFetching sample index….Root cause
After PR #191, three external
loadRescall sites unconditionally chased withawait tryEnterPointModeIfNeeded():If
loadResfailed (caught error → returnedfalse), it paintedFailed to load H3 res${target} — try zooming again.But the immediate chase, if the user is at point altitude, fired its ownloadRes(8, ...)which paintedFetching sample index…over the failure. The user saw the failure message for ~1 frame.If
loadReswas superseded (stale → alsofalse), the chase was technically harmless but redundant — the supersedor's own chase recovers the user.Fix
Capture the return into
appliedand gate the chase:applied === true: fresh data applied; chase fires as before.applied === false(stale): supersedor's own chase will handle recovery (per the invariant documented in explorer: document the 'every loadRes caller chases with tryEnterPointModeIfNeeded' invariant #194). Skipping our chase is a no-op for liveness.applied === false(failed): failure phase message stays visible; user can read and act on it.Applied at the three external call sites:
mode === 'cluster'branchtargetMode === 'cluster' && mode !== 'cluster')elsebranch)Documentation
Updates the
tryEnterPointModeIfNeeded()doc-block (added in #194 / #195) to:const applied = await loadRes(...); if (applied) await tryEnterPointModeIfNeeded();applied(one bullet per false-stale and false-failed case)Test plan
Fetching sample index…→Loading individual samples...→ dots.applied=truefor the source-filter handler's loadRes(currentRes), so chase fires).Failed to load H3 res${target} — try zooming again.stays visible (does not flicker toFetching sample index…).applied=trueon success, chase only matters at point altitude).Refs
🤖 Generated with Claude Code