[codex] Stabilize explorer map layout#202
Conversation
Codex review — round 1Self-contained Codex round-1 review (no shared context with author). Verbatim per the iterative-review pattern. SummaryThe fixed map-height strategy is sound, and it directly addresses the vertical jump described in #199. I would not merge this exact revision yet: the rendered Quarto HTML does not match the control DOM the CSS assumes, and the new Playwright spec has the known brittle point-mode settle wait. Per-ask response1. Quarto raw-html fenceThe fence is right for the That matters because 2.
|
Codex round-1 review (verbatim posted to PR isamplesorg#202 thread) BLOCKed on two items: 1. Quarto Markdown-parses inside the bare static-layout HTML and wraps `<input>` / `<label>` in `<p>` tags (e.g. `.search-bar > p > input`). This breaks `.search-bar input { flex: 1 }` and adds paragraph margins to control rows. Pre-existing on main, but in-scope here. Fix: wrap both the `.explorer-controls` block AND the `.globe-layout` + `#tableContainer` block in `{=html}` raw-html fences. 2. Layout-stability spec waited on the substring 'individual samples' in `#phaseMsg`, which misses the cap-reached done-state branch (`explorer.qmd:1611` — "<N> samples in view (showing M ...)" with no "individual" word). Same brittleness Codex flagged on PR isamplesorg#214. Switch to 'Click one for details' — common denominator across both done-state branches. Also addressed Codex NITs: - Added small-phone case (320×568) exercising the clamp-floor branch at the 360px floor — the 390×844 case never hits this. - Replaced hardcoded `585` / `489.52` heights with a probe-element approach: a hidden `<div style="height: var(--explorer-map-height)">` whose `getBoundingClientRect()` resolves the `clamp(...)` to a real px value. `getComputedStyle().getPropertyValue('--explorer-map-height')` returns the unresolved `clamp(...)` literal, not a px value (this is why my first attempt failed with NaN). - Documented the `waitForClusterBoot` `value('zoomWatcher')` await as intentional synchronization (cell finishes => listeners registered), not a stray return value. Kept (per Codex review): - `requestRenderMode = false` mutation pattern matches URL-roundtrip spec, no cleanup needed (fresh page per test). - `#searchResults` 2-line reserved slot — Codex acknowledged 3 lines would be more forgiving but the 2-line policy is acceptable for layout stability. Verification: all 3 layout-stability tests pass in ~23s. All 5 url-roundtrip specs pass against the modified explorer.qmd (no regression in the recently-landed isamplesorg#214 contract). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codex review — round 2Verbatim Codex round-2 review. LGTM, ready to merge. Codex's only non-blocking nit (consistency: desktop test still hardcoded 585 while mobile cases use the probe) addressed in a follow-up commit — extracted a SummaryNo block-level issues found in the round-2 diff. The raw HTML fence boundaries look right, the probe-element approach is appropriate for resolving the CSS I did not rerun Playwright locally; this is a static re-review of the checked-out files. Per-ask response1. P-wrap fix scopeThe boundary is right. Static interactive HTML is inside the two
The only other interactive-looking markup found by 2. Probe-element approachYes, this is the right idiom here. The probe and 3. Small-phone test correctnessCorrect. At
4. PR title
|
Codex round-2 review noted the desktop test still hardcoded `585` while the mobile cases switched to a probe-element approach. Extract the probe inline into `resolveMapHeightPx(page)` and use it from all three tests — desktop, mobile, small-phone. Desktop assertion now derives expected height the same way as the mobile cases (probe of `var(--explorer-map-height)` → measured px) and sanity-bounds the result to the desktop clamp range [500, 680]. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Fixes #199.
This stabilizes the explorer globe layout so the Cesium container is anchored to viewport height instead of deriving its height from grid-column width. It also reserves bounded space for search status text and the view toolbar so loading/search/table controls cannot move the map frame.
Changes
#cesiumContaineraspect-ratio sizing with--explorer-map-height: clamp(500px, 65vh, 680px).clamp(360px, 58vh, 520px)..side-panelmax height to the same map-height variable.scrollbar-gutter: stableandminmax(0, 1fr)for layout-width stability..explorer-controls, reserved a two-line#searchResultslive region, and reserved view-toolbar height so table controls do not shift the table/globe anchor.Validation
quarto render explorer.qmdnode --check tests/playwright/explorer-layout-stability.spec.jsenv NODE_PATH=/Users/raymondyee/C/src/iSamples/isamplesorg.github.io/node_modules /Users/raymondyee/C/src/iSamples/isamplesorg.github.io/node_modules/.bin/playwright test tests/playwright/explorer-layout-stability.spec.js --project=chromium --reporter=lineThe focused Playwright spec passed: 2 tests passed on Chromium.