explorer: in-map detail card + unified click semantics (#226)#228
Merged
Conversation
Adds the floating in-map detail card from Hana Figma 222:456 / 225:1700, anchored near the clicked sample dot with viewport-edge collision avoidance. Same data path as the side-panel sample card; the floating card is the new map-anchored surface companion. Unifies click semantics across map dot and samples table (isamplesorg#226): click = open detail card; the external link to the source record (OpenContext, SESAR, etc.) lives inside the card title, never as the row's default action. Previously the table title rendered as <a href={sourceUrl}> and the row-click handler bailed on anchor targets, so clicking the title opened the external site while clicking elsewhere updated the panel — the most-attractive click target did the least-useful thing. Lazy-load now resolves vocabulary URIs to human labels via vocab_labels.parquet, so Material / Specimen Type render as e.g. "Biogenic non-organic material" / "Architectural element" instead of the raw w3id.org URI strings. Wide-parquet only — no narrow-format references. Codex-reviewed iteration: * XSS-hardened: escapeHtml() on all interpolated values; thumbnail image built via DOM construction, not innerHTML, so the onerror fallback is a property rather than an inline-JS attribute string. * Removed the table-row card-vs-detail race: card now shows immediately at canvas centre (where the sample lands after the camera flyTo), rather than deferring to flyTo.complete and racing the detail query. * z-index bumped to 1001 so the card stays above the search overlay, results line, and color legend (all at 1000). * Table title is now a role="button" tabindex="0" span with aria-label, not an <a>. Keeps the blue-underline visual styling; screen readers announce as a button (correct) rather than a link (misleading). Keyboard parity via Enter/Space handler on .table-link. Pre-deploy smoke gate (isamplesorg#225) passes locally: 1 passed in 12.75s. Followup: isamplesorg#227 tracks the same click-semantics fix for the nearby-samples and search-results panels (separate PR to keep this diff focused). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Closes #226.
What this adds
In-map floating detail card (Hana Figma 222:456 / card subnode 225:1700) anchored near the clicked sample dot, with viewport-edge collision avoidance. Same data path as the existing side-panel sample card; this is the map-anchored surface companion.
Unified click semantics across map dot and samples table (#226):
Previously the table title was rendered as
<a href={sourceUrl(pid)}>and the row-click handler bailed on anchor targets, so clicking the most-attractive target (the title) opened the external site while clicking anywhere else in the row updated the panel and flew the map. The bold blue underlined element did the least useful thing.Lazy-load resolves vocab URIs to human labels via
vocab_labels.parquet, so Material / Specimen Type render as e.g. "Biogenic non-organic material" / "Architectural element" instead of the raww3id.orgURI strings.Wide-parquet only — no
narrow.parquetreferences.Codex-reviewed iteration
After the initial commit, Codex found 5 issues. 4 are fixed in this PR; #5 spun out to #227 (separate-PR followup so this diff stays scoped).
titleText, sourcename,srcUrl,thumbnail_url)escapeHtml()for all text/attribute interpolations; thumbnail image built via DOM construction with property-basedonerrorinstead of inline-JS attributeflyTo.complete, populating a still-hidden card)z-index: 5could sit underneath search overlay / results / legend (all at 1000)<a href>(a11y: screen readers announce as link that no longer fires)role="button" tabindex="0"span witharia-label; visual styling preserved; Enter/Space keyboard parity added; focus-visible outline<a href>and bail row-clicks on anchor targetsPre-deploy smoke gate
#225 passes locally on this branch:
1 passed in 12.75s.Gate will run again as part of CI on push-to-main; deploy is fail-closed if it doesn't pass.
What I asked of the reviewer / what changed
The user-visible UX changes worth eyeballing in the deployed build:
Files changed
explorer.qmdonly. ~349 insertions / 18 deletions in one Quarto file.Followups
p__has_sample_object_typeconcepts (e.g. PKAP "Animal Bone" has 3); this PR picks[1](first). Could later show all viastring_agg+UNNEST WITH ORDINALITY. Product decision deferred.🤖 Generated with Claude Code