Skip to content

#208 PR4a: centralize globe-hash writes behind writeGlobeHash()#13

Merged
rdhyee merged 1 commit into
mainfrom
feat/explorer-writeglobehash-208
Jun 16, 2026
Merged

#208 PR4a: centralize globe-hash writes behind writeGlobeHash()#13
rdhyee merged 1 commit into
mainfrom
feat/explorer-writeglobehash-208

Conversation

@rdhyee

@rdhyee rdhyee commented Jun 16, 2026

Copy link
Copy Markdown
Owner

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

  • New writeGlobeHash(viewer, { replace, force }) — the only place that writes the globe hash. It owns the _suppressHashWrite gate (previously repeated at 3 sites and silently omitted at 8).
  • All 11 history.{replace,push}State(buildHash(viewer)) sites migrated to it.

Per-site matrix (Codex-verified, see REFACTOR_PR4_PLAN.md §1)

  • Gated default 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 their pushHistory!==false caller guard.

Not in this PR (deferred to PR4b, per plan + Codex)

Verification (all green, local)

Diff: explorer.qmd +46/−17 (one new function + 11 call-site swaps) + the plan doc.

🤖 Generated with Claude Code

…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>
@rdhyee rdhyee merged commit cce4d1f into main Jun 16, 2026
3 checks passed
@rdhyee rdhyee deleted the feat/explorer-writeglobehash-208 branch June 16, 2026 04:33
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