feat: show observation details on track point popup (ERA-13537)#1628
Open
jeslefcourt wants to merge 2 commits into
Open
feat: show observation details on track point popup (ERA-13537)#1628jeslefcourt wants to merge 2 commits into
jeslefcourt wants to merge 2 commits into
Conversation
Clicking a track timepoint now fetches the underlying observation for that subject + time and exposes its device_status_properties (e.g. speed) via the same "more details" toggle used by the subject popup. - TimepointPopup fetches the observation by subject_id over a small time window bracketing the point, matching by instant (track times are UTC while observation recorded_at uses tenant-local offset) with a closest-in-window fallback for sub-second rounding. - Extract the toggle/list/localStorage control into a shared AdditionalDeviceProperties component consumed by both SubjectPopup and TimepointPopup; SubjectPopup behavior (static-subject gating, time-slider state) preserved via optional props. - 4px spacing between location and details in the track point popup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds telemetry (“device status properties”) to the historic track timepoint popup by fetching the nearest matching observation for the clicked subject/time and reusing the same “more details” UI used in the subject popup.
Changes:
TimepointPopupnow queries/observationsfor the clickedsubject_idwithin a small time window and matches by instant (with closest-in-window fallback).- Introduces a shared
AdditionalDevicePropertiescomponent that encapsulates the toggle UI, list rendering, andlocalStoragepersistence. - Refactors
SubjectPopupto use the shared component and removes the now-duplicated styles/logic.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/TimepointPopup/index.js | Fetches observations around the clicked timepoint and renders shared additional device properties UI. |
| src/TimepointPopup/index.test.js | Adds regression coverage for instant-vs-string matching, non-zero query window, and toggle/localStorage behavior. |
| src/TimepointPopup/styles.module.scss | Adds spacing for the additional properties section in the timepoint popup. |
| src/AdditionalDeviceProperties/index.js | New shared component for rendering/toggling device status properties with persisted preference. |
| src/AdditionalDeviceProperties/styles.module.scss | Moves additional device properties list/toggle styles into the shared component. |
| src/SubjectPopup/index.js | Replaces inline additional properties UI with the shared AdditionalDeviceProperties component. |
| src/SubjectPopup/styles.module.scss | Removes additional properties styles that were moved into the shared component. |
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.
Summary
Resolves ERA-13537 — customers want to see per-position telemetry (e.g. speed) when clicking a point along a subject's historic track ("snail trail").
Clicking a track timepoint now fetches the underlying observation for that subject + time and exposes its
device_status_propertiesvia the same "more details" toggle already used by the subject popup.Changes
TimepointPopupnow fetches the observation bysubject_idover a small time window bracketing the point, then selects the matching record. Matching is done by instant, not string: the track endpoint serializes times in UTC (...+00:00) while observationrecorded_atuses the tenant-local offset (...-07:00) — the same instant, different string. A closest-in-window fallback handles sub-second rounding (track times are whole-second;recorded_atcarries milliseconds).AdditionalDevicePropertiescomponent extracts the toggle +device_status_propertieslist +localStoragepersistence that previously lived inline inSubjectPopup. Both popups now consume it, so the control stays consistent and the preference is shared.SubjectPopuprefactored to use the shared component. Its extra behaviors (static-subject gating, time-slider active/empty rendering) are preserved via optional props that default off, soTimepointPopupis unaffected.Verification
TimepointPopup(7) +SubjectPopup(5) pass. New tests lock in the instant-vs-string matching and the non-zero query window as regression guards (both fail against the pre-fix code).since==untilquery returning nothing), which are fixed here.Notes for reviewers
AdditionalDevicePropertiesreturnsnullwhen there are no device properties, so no empty control or stray spacing renders.🤖 Generated with Claude Code