feat(events): "View on globe" — jump an In-the-news card to the event's place + time#248
Merged
Merged
Conversation
Each "In the news" card in the dataset info panel now offers a "View on globe" action that flies the active globe to the related current event's location and seeks the loaded dataset to the event's time — so a reader lands on the moment and place the headline describes instead of hunting for it. Reuses the primitives Orbit's docent already drives: MapRenderer.flyTo (point geometry → regional altitude) / fitBounds (bounding box, or a named region resolved via regions.ts) for place, and seekToDate for time. Per the chosen behavior, when the event's time falls outside the loaded dataset's coverage — common for rolling real-time windows — we still fly to the place and reveal a small "outside this dataset's time range" note on the card. Static-image datasets (no time axis) simply fly, with nothing to note. Wiring: displayDatasetInfo takes an optional onNavigateToEvent callback (mirrors onLoadDataset); main.ts implements it against the primary renderer + hlsService. The card button is present only when the event carries a place or a time. New i18n keys + info-panel CSS. Backend and the /api/v1/datasets/:id/events shape are unchanged. Signed-off-by: Claude <noreply@anthropic.com>
`onNav.mock.calls[0][0]` tripped TS2493 (indexing a zero-length tuple — the mock's inferred params). Assert via toHaveBeenCalledWith + objectContaining instead, which needs no tuple indexing. Slipped past local vitest (esbuild transpile ignores types); caught by CI's tsc. Signed-off-by: Claude <noreply@anthropic.com>
Contributor
🖼️ Visual report54 shot(s) · 2 viewport(s) (desktop, mobile) · 14 with problems · 21 problem(s) total Regression: 8 shot(s) changed, 0 new (baseline-less, soft pass), threshold 0.001.
Shots with problems
Full report → Advisory — this check never fails the build. Visual review only. |
There was a problem hiding this comment.
Pull request overview
Adds a “View on globe” action to the dataset info panel’s “In the news” cards so users can jump the globe to an event’s place and (when applicable/in-range) seek the dataset to the event time, reusing existing globe navigation + playback primitives.
Changes:
- Adds a per-card “View on globe” button + out-of-range note wiring to the info panel news rendering (
datasetLoader.ts). - Implements the navigation behavior (fly/fit bounds + optional seek with out-of-range reporting) in the main app controller (
main.ts). - Adds styling + i18n strings and expands unit tests for the new affordance.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/styles/info-panel.css | Styles the new “View on globe” button and the conditional out-of-range note. |
| src/services/datasetLoader.ts | Adds navigation callback types and wires the “View on globe” button + note behavior into the info panel news cards. |
| src/services/datasetLoader.test.ts | Adds tests for button presence/absence, click wiring, and out-of-range note visibility. |
| src/main.ts | Implements event navigation (place fly/fit + optional time seek) and passes callback into info panel rendering. |
| locales/en.json | Adds new UI strings for the button and time out-of-range note. |
| locales/_explanations.json | Adds translator guidance for the new aria label key. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- aria-label / CSS comment / translator note said the button flies to
the event's "location and time", but the button appears when an event
has *either* a place or a time, and navigation may do only one. Reword
the aria-label to the accurate, generic "View {title} on the globe" and
align the explanation + CSS comment with the actual place-and/or-time
behavior.
- move the renderInfoPanel() JSDoc back above renderInfoPanel(): inserting
navigateToEvent() had left two consecutive doc blocks, orphaning the
first above the wrong method.
Signed-off-by: Claude <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.
What & why
Follow-up to #244 ("In the news" panel, now merged). Today each "In the news" card is a passive citation (headline + external source link + date) — the reader still has to find the event on the globe themselves. This adds a "View on globe" action that flies the active globe to the related current event's location and seeks the loaded dataset to the event's time, so a reader lands on the exact moment and place the headline describes.
How
Reuses the exact primitives Orbit's docent already drives (
main.tschat callbacks) — no new navigation machinery, no backend change:MapRenderer.flyTofor apoint(flies to a regional altitude),fitBoundsfor aboundingBoxor aregionName(resolved viaregions.ts). VR sessions rotate too (flyToOnGlobe).seekToDateon the loaded dataset.occurredStartfalls outside the loaded dataset's[startTime, endTime](common for rolling real-time windows), we still fly to the place and reveal a small "outside this dataset's time range" note on the card. Static-image datasets (no time axis) fly with nothing to note.Wiring mirrors the existing
onLoadDatasetpattern:displayDatasetInfogains an optionalonNavigateToEventcallback;main.tsimplements it against the primary renderer +hlsService. The button renders only when the event actually carries a place or a time.Tests
src/services/datasetLoader.test.ts(+5): button renders when the event has a place/time; omitted when it has neither; click invokesonNavigateToEventwith the event; the note reveals only onout-of-rangeand stays hidden onseeked. Full suite (4714) +type-checkgreen.No new UI route/module (enhances the existing info-panel surface), so no new Scene — the "In the news" panel needs a loaded dataset, whose imagery is network-gated and out of scope for the offline capture (see
openGlobe).🤖 Generated with Claude Code
Generated by Claude Code