Skip to content

explorer: URL state contract micro-fixes (post-#203 follow-ups) #207

@rdhyee

Description

@rdhyee

Cluster of small, targeted URL-state contract fixes surfaced by Codex's retrospective review of #203 + #205. Each item is independently shippable; bundling for tracking, not for one PR.

Items

  • Low-altitude-without-mode=point round-trip (Codex item 4). The early-write fix in explorer: fix URL state round-trip (closes #201 parts A+B) #203 can produce URLs like alt=8000 without mode=point if the user copies during a pending point-mode transition. Boot only force-enters point mode when the URL says mode=point, so the round-trip lands in cluster mode at low altitude — not what the user saw. Fix shape: boot path should enter point mode based on altitude (alt < ENTER_POINT_ALT) AND/OR the URL flag, not the URL flag alone. Update tryEnterPointModeIfNeeded() call at boot end to fire whenever altitude is below threshold, regardless of ih.mode.

  • h3 hashchange null-result asymmetry (Codex item 6). When fetchClusterByH3(state.h3) returns null in the hashchange handler (explorer.qmd:~2568-2580), the UI is cleared but viewer._globeState.selectedH3 is NOT cleared. Boot does clear it (line ~2590). The asymmetry means an invalid/filtered h3 can be re-emitted later by buildHash(). Fix shape: clear viewer._globeState.selectedH3 in the hashchange null branch to match the boot behavior.

  • Selection state with search-result flights (Codex item 8). Search-result clicks fly the camera but don't set or clear selectedPid / selectedH3. The URL then becomes "new camera, old selection". Fix shape: search-result click handler should either set selection to the searched-for sample or clear stale selection before flying.

  • Avoid pushState during boot/hash hydration (Codex item 3). tryEnterPointModeIfNeeded() at boot eventually calls enterPointMode() with default pushHistory, so boot hydration can add a browser history entry. Boot and hashchange should reconcile state without growing history. Fix shape: thread an explicit { pushHistory: false } option through the boot call site.

Why bundled

Each is a small, localized fix in explorer.qmd. None unblocks the others. Codex flagged them as a group; tracking them together keeps the URL state contract's edges visible while we work through them. Individual PRs are fine.

Refs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions