Skip to content

RF-1224: Use deployment dates instead of update dates in gear popup#1550

Open
jeslefcourt wants to merge 9 commits into
developfrom
RF-1224
Open

RF-1224: Use deployment dates instead of update dates in gear popup#1550
jeslefcourt wants to merge 9 commits into
developfrom
RF-1224

Conversation

@jeslefcourt

@jeslefcourt jeslefcourt commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Gear popup header date now uses the most recent last_deployed across all devices, falling back to gear.last_updated
  • Device list sorted ascending by last_deployed (undated devices last, stable sort for ties)
  • Gear popup width increased 25% (16.25rem)
  • Clicking the gear name in the sidebar list now jumps to location (same as the jump icon)

Fixes: RF-1224

Test plan

  • Open a gear popup on the map and verify the header date reflects the most recent device deployment date
  • Verify devices with no last_deployed appear after dated devices in the popup list
  • Verify clicking a gear name in the sidebar jumps the map to that gear
  • Run npx jest src/GearPopup/index.test.js — all 11 tests pass

🤖 Generated with Claude Code

Gear popup header and device list now show last_deployed timestamps.
The header falls back to gear.last_updated when no device has a deployment date.
Devices are sorted ascending by last_deployed, with undated devices last.
Popup width increased 25% and name is now clickable (jump to location).
Adds test coverage for device sort order and popup rendering branches.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the Gear popup and sidebar interactions to use deployment dates (instead of update dates) and improve navigation to gear locations.

Changes:

  • Gear popup header now uses the most recent device.last_deployed (fallback to gear.last_updated) and device rows show last_deployed.
  • Devices in the popup are sorted ascending by last_deployed (undated devices last; ties preserve order).
  • Gear popup styling updated to widen the Mapbox popup content, and gear names in the sidebar are now clickable to jump to location.

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/SideBar/GearTab/styles.module.scss Adds styling for a “clickable” gear display id in the sidebar list.
src/SideBar/GearTab/index.js Makes the gear name clickable/keyboard-focusable to jump to the gear’s location.
src/PopupLayer/index.js Applies a GearPopup-specific popup class for width styling via popup template attrs.
src/GearPopup/styles.module.scss Adds a .popup wrapper to increase Mapbox popup content width for gear popups.
src/GearPopup/index.js Switches popup header/device dates to last_deployed logic and sorts devices by deployment date.
src/GearPopup/index.test.js Adds unit tests for GearPopup rendering and device sort order.

Comment thread src/SideBar/GearTab/index.js Outdated
Comment thread src/SideBar/GearTab/styles.module.scss Outdated
Comment thread src/GearPopup/index.js Outdated
Comment thread src/GearPopup/index.test.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…oyed across devices

Agent-Logs-Url: https://github.com/PADAS/das-web-react/sessions/5f2a8b61-505a-4b8d-bebe-cedff1eba9cd

Co-authored-by: jeslefcourt <32883811+jeslefcourt@users.noreply.github.com>
jeslefcourt and others added 3 commits April 23, 2026 15:31
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chrisj-er

Copy link
Copy Markdown
Contributor

@claude review

@claude claude Bot 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.

LGTM — small frontend change with good test coverage.

Extended reasoning...

Overview

This PR updates the gear popup to surface the most recent device last_deployed date (with fallback to gear.last_updated), sorts devices ascending by deployment date, widens the popup, and makes the gear name in the sidebar list clickable to jump to location. Touches 7 files, all frontend (React + SCSS), with a new 141-line test file covering the popup behavior and sort ordering edge cases.

Security risks

None. No auth, crypto, network calls, user input parsing, or permission logic. Date strings are compared lexicographically (safe for ISO 8601), and the new offset option to useJumpToLocation is conditionally spread only when truthy.

Level of scrutiny

Low. This is presentation-layer logic with clear intent, deterministic behavior, and direct test coverage. The most-recent-date reduce, the sort comparator, and the conditional offset spread are all small and easy to verify by inspection. The test file specifically covers the most-recent-date selection (added in 00bfe94 in response to Copilot feedback), the fallback path, undated-devices-last ordering, and stable sort for ties.

Other factors

  • Prior Copilot review surfaced 4 items; 3 were addressed (focus-visible styling now present in SCSS, missing test added, PR description corrected).
  • The remaining nit (Space key on the role=button span doesn't preventDefault, so Space both activates and scrolls the page) is flagged as an inline comment by the bug-hunting system. It's a real a11y nit but minor and isolated — does not block approval.
  • No CODEOWNER-sensitive areas touched. The useJumpToLocation hook change is backward-compatible (new optional second-arg property).

Comment thread src/SideBar/GearTab/index.js Outdated

@luixlive luixlive left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Almost done, some small suggestions on improvements for code readability and HTML semantics 👍

Comment thread src/GearPopup/index.js Outdated
Comment thread src/GearPopup/index.js Outdated
Comment thread src/GearPopup/styles.module.scss
Comment thread src/hooks/useJumpToLocation/index.js Outdated
Comment thread src/SideBar/GearTab/index.js Outdated
Comment thread src/SideBar/GearTab/styles.module.scss
jeslefcourt and others added 3 commits June 15, 2026 09:34
- Memoize most-recent-deployment date in GearPopup with useMemo
- Extract device sort comparator to top-level sortByLastDeployed helper
- useJumpToLocation: accept generic options param spread into fit/easeTo
- GearTab: render semantic <button> instead of span[role=button], drop <p>
- Reset button defaults in styles so it matches the prior span appearance

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… options

- GearPopup: compare last_deployed via Date() in both the sort comparator and
  the most-recent-date reducer, removing the lexicographic timezone assumption
- useJumpToLocation: JSDoc the new options param and its override behavior
- GearTab: document the approximate 175px popup-center offset

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jeslefcourt jeslefcourt requested a review from luixlive June 15, 2026 16:52
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.

5 participants