Skip to content

feat(events): "View on globe" — jump an In-the-news card to the event's place + time#248

Merged
Hackshaven merged 3 commits into
mainfrom
claude/events-jump-to-place
Jul 2, 2026
Merged

feat(events): "View on globe" — jump an In-the-news card to the event's place + time#248
Hackshaven merged 3 commits into
mainfrom
claude/events-jump-to-place

Conversation

@Hackshaven

Copy link
Copy Markdown
Member

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.

Supersedes #247, which GitHub auto-closed when its base branch (claude/events-in-the-news) merged. This is the same commit, rebased onto main.

How

Reuses the exact primitives Orbit's docent already drives (main.ts chat callbacks) — no new navigation machinery, no backend change:

  • PlaceMapRenderer.flyTo for a point (flies to a regional altitude), fitBounds for a boundingBox or a regionName (resolved via regions.ts). VR sessions rotate too (flyToOnGlobe).
  • TimeseekToDate on the loaded dataset.
  • Out-of-range handling (the chosen behavior) — when the event's occurredStart falls 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 onLoadDataset pattern: displayDatasetInfo gains an optional onNavigateToEvent callback; main.ts implements 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 invokes onNavigateToEvent with the event; the note reveals only on out-of-range and stays hidden on seeked. Full suite (4714) + type-check green.

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

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>
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🖼️ Visual report

54 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.

Scene Viewport Change
orbit-chat-open desktop 0.17% (2147 px)
browse-timeline-view desktop 2.38% (30853 px)
browse-map-view desktop 14.42% (186847 px)
tools-menu desktop 99.16% (1285052 px)
publish-events desktop 0.42% (5392 px)
orbit-chat-open mobile 0.64% (2111 px)
browse-map-view mobile 14.64% (48192 px)
tools-menu mobile 97.79% (321895 px)
Shots with problems
Scene Viewport Errors Failed req a11y
browse-filters-open desktop 0 2 0
browse-search-active desktop 0 1 0
orbit-chat-open desktop 0 1 0
help-panel desktop 0 1 0
browse-graph-view desktop 0 1 0
browse-timeline-view desktop 0 1 0
browse-map-view desktop 0 1 0
orbit-settings desktop 0 1 0
publish-tours desktop 1 1 0
publish-featured-hero desktop 1 1 0
publish-datasets-error desktop 1 1 0
publish-tours mobile 1 1 0
+2 more

Full report → visual-report artifact

Advisory — this check never fails the build. Visual review only.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread locales/en.json Outdated
Comment thread locales/_explanations.json Outdated
Comment thread src/styles/info-panel.css Outdated
Comment thread src/main.ts Outdated
- 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>
@Hackshaven
Hackshaven merged commit f2dd189 into main Jul 2, 2026
17 checks passed
@Hackshaven
Hackshaven deleted the claude/events-jump-to-place branch July 2, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants