#208 PR4b: shared settled-camera tail (reconcileSettledCamera)#14
Open
rdhyee wants to merge 1 commit into
Open
#208 PR4b: shared settled-camera tail (reconcileSettledCamera)#14rdhyee wants to merge 1 commit into
rdhyee wants to merge 1 commit into
Conversation
…Camera() Extract the shared settled-camera reconciliation both globe listeners run once the camera comes to rest — the cluster "Samples in View" stat refresh + the URL-hash write (writeGlobeHash) — into reconcileSettledCamera(v), and call it from BOTH camera.changed and moveEnd (isamplesorg#208 smell 1b). This gives moveEnd the same cluster-stat refresh camera.changed already did, closing the sub-10%-pan gap: a small cluster-mode drag fired moveEnd (which updated the URL via isamplesorg#204) but NOT camera.changed (debounced away by percentageChanged=0.1), leaving the "Samples in View" count stale. Scope is deliberately minimal (Codex Q3 / REFACTOR_PR4_PLAN.md §3): NOT the full handler merge. Mode-transition + resolution-reload stays camera.changed- only; facet/heatmap/point-exit stays moveEnd-only; isamplesorg#262 stays a separate tracked sibling. reconcileSettledCamera is a local fn (closes over getMode/currentRes/countInViewport), not top-level like writeGlobeHash. Behavior: - camera.changed: behavior-neutral (same order — cluster-stat then hash). - moveEnd: adds the cluster-stat refresh (point mode skips it via the getMode()==='cluster' guard, so point mode is unchanged). The stat read is synchronous, guarded by _clusterData, and writes no mode/selection/URL/ facet/heatmap state. Verification: smoke 4 + characterization 7 + url-roundtrip 5 all green (behavior-neutral URL contract from both handlers preserved); render clean; Codex review of the diff found no blocking issues. A dedicated headless regression for the moveEnd cluster-stat refresh proved unreliable (OJS cell re-evaluation yields multiple viewer instances in the harness; the one reachable at interaction time often has no camera listeners) — documented inline in url-roundtrip.spec.js rather than shipped flaky. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
isamplesorg#208 PR4b — shared settled-camera tail (
reconcileSettledCamera())Continues the isamplesorg#249 strangler refactor (PR4a centralized hash writes behind
writeGlobeHash). Targets isamplesorg#208 smell 1b: a single settled-camera reconciliation entry point shared by both globe listeners. Branch offmain(fork staging); promote upstream later like isamplesorg#287/isamplesorg#288.What
Extracts the shared tail both
camera.changedandmoveEndrun once the camera settles — the cluster "Samples in View" stat refresh + the URL-hash write — into a localreconcileSettledCamera(v), called from both.This gives
moveEndthe same cluster-stat refreshcamera.changedalready did, closing the sub-10%-pan gap: a small cluster-mode drag firesmoveEnd(which kept the URL fresh via isamplesorg#204) but notcamera.changed(debounced away bypercentageChanged=0.1), so the "Samples in View" count went stale until a larger move.Scope (deliberately minimal — Codex Q3 /
REFACTOR_PR4_PLAN.md§3)camera.changed/moveEndhandler merge (those encode explorer: 60–90 s 'no dots' window on cold-cache deep-link to point mode (DuckDB-WASM 1.24.0 falls back to full HTTP read) isamplesorg/isamplesorg.github.io#190/explorer: smooth failure-message flicker when tryEnterPointModeIfNeeded chases a failed cluster reload isamplesorg/isamplesorg.github.io#193/explorer: 'Samples in View' shows the 5000 fetch budget, not real count + URL round-trip doesn't reproduce view isamplesorg/isamplesorg.github.io#201/explorer: small camera moves don't update URL (Bug A residual, follow-up to #201) isamplesorg/isamplesorg.github.io#204/Samples table and phase-msg 'Samples in View' diverge during point-mode cache-hit pans isamplesorg/isamplesorg.github.io#221/explorer: architectural direction — make filter semantics coherent across all surfaces isamplesorg/isamplesorg.github.io#234/explorer: B1 viewport-aware facet counts (#234 step 3) isamplesorg/isamplesorg.github.io#237/explorer: heatmap overlay spike — phase 1 (#233) isamplesorg/isamplesorg.github.io#240/explorer: turning off heatmap then zooming out doesn't restore clusters (if session started in heatmap) isamplesorg/isamplesorg.github.io#262 edge-cases — too risky).camera.changed-only; facet/heatmap/point-exit staysmoveEnd-only.Behavior
camera.changed: behavior-neutral — same order (cluster-stat then hash), early pre-await write intact.moveEnd: adds the cluster-stat refresh. Point mode skips it via thegetMode()==='cluster'guard (unchanged there). The stat read is synchronous, guarded by_clusterData, and writes no mode/selection/URL/facet/heatmap state.Verification
quarto render explorer.qmdclean.viewerinstances; the one reachable viavalue('viewer')at interaction time often has no camera listeners, so a forcedmoveEndnever reaches the handler. Rather than ship a flaky test, the rationale is documented inline inurl-roundtrip.spec.js. A manual probe confirms a settled cluster camera writes<count> | Samples in Viewvia the shared tail.🤖 Generated with Claude Code