Skip to content

explorer: map position and size jump between views because surrounding elements shift #199

@rdhyee

Description

@rdhyee

Symptom

The Cesium globe (#cesiumContainer) changes both vertical position on the page and rendered size as the user moves between views (cold-load, search-active, point-mode, cluster-mode, table-mode). The user has to re-orient on the map each time something above or beside it changes.

Diagnosis

Two distinct causes, both in explorer.qmd:

1. Map size is content-width-dependent

#cesiumContainer (explorer.qmd:40-44) is currently sized as:

#cesiumContainer {
    width: 100%;
    min-height: 500px;
    aspect-ratio: 4/3;
}

Height is derived from width via aspect-ratio. Width is the left column of grid-template-columns: 1fr 340px on .globe-layout. So any viewport-width change resizes the map.

The side-panel column has max-height: 700px; overflow-y: auto, which is the right pattern (bounded + internal scroll), but the map column has no comparable height anchor.

2. Map position drifts because variable-height content lives above it

The flow above .globe-layout:

When any of those grow/shrink, #cesiumContainer.getBoundingClientRect().top shifts and the map jumps vertically.

Proposed fix (CSS + light HTML restructure)

Treat the globe as an app-shell anchor, not a flow-layout element:

  1. Replace aspect-ratio: 4/3 + min-height: 500px on #cesiumContainer with a viewport-stable height (e.g., height: clamp(500px, 70vh, 800px)). Map height becomes a function of viewport height alone.
  2. Bound #searchResults with min-height: 0; max-height: <small>; overflow-y: auto — or move inline status into a Cesium overlay (.cesium-topleft slot already styled at explorer.qmd:23-30).
  3. Reserve a fixed-height slot for banner-style messages above the map (loading, phase, error) so the slot exists whether or not a message is showing.
  4. Verify with Playwright: snapshot #cesiumContainer.getBoundingClientRect() across the five views; assert top/height stable within ε.

No JS logic changes expected. Scope is similar to a single Codex-loop PR.

Open design choices

  • Target height: clamp(500px, 70vh, 800px) is a starting point. May want to align with the Hana mockup direction referenced near .cesium-viewer-toolbar styling (explorer.qmd:~98).
  • Status banners — overlay vs reserved slot: overlay (Cesium top-left badge, reusing .cesium-topleft styling) is denser; reserved slot is more conventional. PR explorer: surface 'Fetching sample index…' during cold-cache boot→point-mode wait (#190 fix 2) #191's "Fetching sample index…" UX is currently implemented one of these ways — choice should be consistent with that.

Acceptance criteria

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