#208 PR4a: centralize globe-hash writes behind writeGlobeHash()#13
Merged
Conversation
…ash() Single URL-hash writer (issue isamplesorg#208 smell 1a). Introduces writeGlobeHash(viewer, {replace, force}) as the only place that writes the globe hash, and migrates all 11 history.{replace,push}State(buildHash(viewer)) call sites to it. Behavior-neutral. The boundary bakes the `_suppressHashWrite` gate into one place. Per the Codex-verified per-site matrix (REFACTOR_PR4_PLAN.md §1): - 3 settled-camera writers honor the gate (camera.changed early/late, moveEnd) -> writeGlobeHash(viewer) - 8 explicit user-action writers were already ungated and keep writing via force:true (map sample/cluster click, table row click, enter/exit point mode, source-filter selection-invalidation, Share button) - replace:false for the 4 push sites (map/cluster click, enter/exit mode) isamplesorg#208 smell 2 (dual `mode`) was already resolved earlier; not touched here. buildHash extraction and the camera.changed/moveEnd reconcile (smell 1b) are deferred to PR4b per the plan. Verified behavior-neutral: smoke 4, characterization 7, url-roundtrip 5 (incl. isamplesorg#203 Bug B, isamplesorg#205 sub-threshold moveEnd, cross-context push/replace round-trip) all green; render clean. 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 PR4a — single globe-hash writer (
writeGlobeHash)Next step of the isamplesorg#249 refactor (after PR1-3, now live on isamples.org). Addresses isamplesorg#208 smell 1a: many scattered URL-hash writers, no single boundary. Behavior-neutral.
What changed
writeGlobeHash(viewer, { replace, force })— the only place that writes the globe hash. It owns the_suppressHashWritegate (previously repeated at 3 sites and silently omitted at 8).history.{replace,push}State(buildHash(viewer))sites migrated to it.Per-site matrix (Codex-verified, see
REFACTOR_PR4_PLAN.md §1)writeGlobeHash(viewer)(honor suppress): camera.changed early + late, moveEnd.force:true(were ungated; must keep writing): map sample/cluster click, table row-click, enter/exit point mode, source-filter H3/pid invalidation, Share button.replace:false(push) for the 4 push sites;replace(default) for the rest. enter/exit keep theirpushHistory!==falsecaller guard.Not in this PR (deferred to PR4b, per plan + Codex)
camera.changed/moveEndunification (explorer: refactor URL/mode state management (centralize writers, collapse dual mode) isamplesorg/isamplesorg.github.io#208 smell 1b) → minimalreconcileSettledCameratail, separate PR.buildHashmodule extraction → deferred (reads#heatmapToggleDOM).mode) was already resolved earlier.Verification (all green, local)
quarto render✓ ·git diff --check✓Diff:
explorer.qmd+46/−17 (one new function + 11 call-site swaps) + the plan doc.🤖 Generated with Claude Code