fix(#262): heatmap-OFF force-reloads altitude-appropriate marker layer#7
Open
rdhyee wants to merge 1 commit into
Open
fix(#262): heatmap-OFF force-reloads altitude-appropriate marker layer#7rdhyee wants to merge 1 commit into
rdhyee wants to merge 1 commit into
Conversation
…opriate marker layer
Root cause: the `#heatmapToggle` change handler only called `clearHeatmap()`
+ `applyLayerVisibility()` on heatmap-OFF. `applyLayerVisibility()` flips
`.show = true` on `viewer.h3Points` (or `.samplePoints`) but never loads data
into it. A session that lived entirely in heatmap mode could have an empty
`viewer.h3Points`; revealing an empty layer produces the "no clusters after
heatmap-off" symptom. Even when phase-1 data was present, `currentRes` might
equal the target altitude's resolution, causing the camera handler's
`target !== currentRes` guard to skip the reload on subsequent zooms.
Fix (explorer.qmd):
- Make the listener `async`.
- On heatmap-OFF: call `clearHeatmap()` + `applyLayerVisibility()` +
`syncFacetNote()` as before, then wrap a data reload in
`busyAcquire()`/`busyRelease()` (try/finally):
* Set `currentRes = null` to defeat the same-res skip guard.
* If `searchIsActive()` or altitude < `ENTER_POINT_ALT`: `await enterPointMode(false)`.
* Else: `await loadRes(target, resUrls[target])` + chase with
`tryEnterPointModeIfNeeded()` (mirrors the source-filter handler pattern).
- On heatmap-ON path: move `applyLayerVisibility()` + `syncFacetNote()` inside
the `if` branch (no semantic change, just symmetry).
- Add `h3PointsLen` to `window.__a1globe()` so test assertions can confirm
clusters are actually loaded, not just shown.
Also adds `tests/playwright/heatmap-off-restore.mjs` — a standalone mode-matrix
harness (plain chromium, `node ...`, NOT a .spec.js) that exercises:
T1. Boot `heatmap=1` at cluster alt → heatmap shown, markers hidden.
T2. Toggle heatmap OFF → H3 cluster points load and render (the bug).
T3. Toggle heatmap OFF at point altitude → sample points load.
T4. Toggle heatmap OFF with search active → filtered point markers.
T5. Normal cluster→heatmap ON→OFF still works (regression).
T6. Heatmap ON still suppresses markers (regression).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5c9d4da to
e8f4d2f
Compare
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
&heatmap=1deep-link boot), the globe shows an empty cluster layer — no markers render even after zooming out.#heatmapToggle's change handler only calledclearHeatmap()+applyLayerVisibility(). That flipsviewer.h3Points.show = truebut never loads data into it. A session that lived entirely in heatmap mode had an emptyviewer.h3Points. Additionally, even when phase-1 data was present,currentRescould equal the target altitude's resolution, causing the camera handler'starget !== currentResguard to skip the subsequent reload on zoom-out.explorer.qmd):async.currentRes = null(defeats the same-res skip guard), then use the existing helpers (loadRes/enterPointMode/tryEnterPointModeIfNeeded) to force a data reload, all wrapped inbusyAcquire()/busyRelease()(try/finally) matching the source-filter handler pattern.applyLayerVisibility()+syncFacetNote()moved inside theifbranch (no semantic change, symmetry).h3PointsLentowindow.__a1globe()for test assertions.tests/playwright/heatmap-off-restore.mjs— standalone mode-matrix harness (plain chromium, NOT.spec.js) covering 6 scenarios: T1 boot heatmap on/hidden, T2 the actual bug, T3 low-alt point mode, T4 search active, T5 normal regression, T6 heatmap-on suppression.Verification needed (build + run locally)
Test plan
HEADLESS=1 A1_CLOSE=1 node tests/playwright/a1-verify.mjspasses (A1 coherence regression)HEADLESS=1 node tests/playwright/heatmap-off-restore.mjsshows all 6 assertions passing, especially T2 (the bug)?heatmap=1deep link at cluster altitude, toggle off, verify clusters appearprod/consolidated-0601branch NOT touched (Kerstin's keynote safety)🤖 Generated with Claude Code