Skip to content

ERA-13210: Patrol detail view usability prototype#1576

Open
tiffanynwong wants to merge 11 commits into
developfrom
ERA-13210
Open

ERA-13210: Patrol detail view usability prototype#1576
tiffanynwong wants to merge 11 commits into
developfrom
ERA-13210

Conversation

@tiffanynwong
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a pre-seeded patrol prototype with 7 demo patrols (overdue, paused, active ×3, done ×2) surfaced through a new patrols list in the sidebar
  • PatrolOverview and PatrolLegDetailView show a structured activity feed with leg boundaries, pause events, notes, and demo events using real EarthRanger event types with realistic field data
  • Clicking a demo event lazily creates a real API event and opens the event detail form; back-navigation returns to the patrol view
  • PatrolTracksLayer renders procedural patrol tracks and event markers (correct icon + priority colour) on the map; event positions are interpolated along each leg's track so the Focus button keeps them in view

Test plan

  • Open the app and confirm the Patrols tab shows the 7 demo patrols in the correct states (Overdue, Paused, Active, Done)
  • Open a patrol and verify the activity feed shows leg boundaries, notes, and events with correct icons and timestamps
  • Click a demo event row — confirm it creates a real event and opens the event detail form with fields pre-filled
  • Press back/cancel and confirm it returns to the patrol view
  • Open a patrol on the map and confirm tracks render with event markers at the correct positions
  • Click the Focus button and confirm all events are within the map view
  • Verify no stray circle markers appear on the map

🤖 Generated with Claude Code

Adds a fully interactive patrol prototype to the app:

- Patrol list with demo patrols (overdue, paused, active ×3, done ×2)
  seeded into sessionStorage on first load via demoPatrols.js
- PatrolOverview and PatrolLegDetailView showing a structured activity
  feed with leg boundaries, pause events, notes, and demo events
- Demo events use real EarthRanger event types (carcass_rep, snare_rep,
  spoor_rep, fire_rep, hwc_rep, suspicious_activity_rep, invasive_species_rep,
  unidentified_vessel_rep, vessel_boarding_rep, oil_slick_rep) with
  realistic event_details; clicking a row lazily creates a real API event
  and navigates to the event detail form with back-navigation support
- PatrolTracksLayer renders procedural patrol tracks and event markers
  (icon + priority colour) on the map; event positions are interpolated
  along each leg's track geometry so Focus keeps them in view
- PatrolForm, PatrolLegDetailView, EditableTitle, PatrolTypeIcon and
  supporting stores (legs, state, tracks, addedReports) wired together
- Sidebar entry point for the prototype patrols list

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Keep branch MUI/emotion deps; adopt develop's bumped versions of
@rjsf/* (6.5.1), @turf/turf (7.3.5), and ajv (8.20.0). Regenerate
yarn.lock to include all packages.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

🚀 PR Environment Deployed

App Sync Health Image
pr-web-era-13210 ✅ Synced ✅ Healthy 5778788b55449270de18b217bb20a9526b2f7832

Access: https://era-13210.dev.pamdas.org

View in ArgoCD

tiffanynwong and others added 2 commits May 21, 2026 13:34
- Revert useSortedNodes sort functions to original (returning -1 for
  equal dates) — our change to return 0 shifted sort order and broke
  the ActivitySection sorting test
- Remove !isPatrolOverviewActive and !isPatrolFormActive from the
  SideBar header hide condition; only hide for leg detail view. Restores
  the Go Back button visibility at /patrols/new and /patrols/:id that
  the SideBar tests expect
- Update AddPatrolTab, AddItemButton, AddItemModal tests: prototype
  uses a fixed list (Vehicle/Foot/Aerial/Routine Patrol) not Redux
  patrol-types, so update testIds and expected call args accordingly
- Update PatrolsFeedTab test: PrototypePatrolList reads sessionStorage
  not Redux, so the UUID-based PatrolListItem button is not rendered;
  test now verifies the tab mounts without crashing instead

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Comment thread .env.production Outdated
@@ -1,4 +1,4 @@
GENERATE_SOURCEMAP=false
REACT_APP_DAS_HOST=''
REACT_APP_DAS_HOST='https://user-testing.pamdas.org/'
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.

Let's undo these changes before merging 😄

luixlive and others added 7 commits May 21, 2026 15:20
…ts tab

- Fix sticky footer covering last interactive element in PatrolForm and
  PatrolOverview by adding 5rem padding-bottom to scrollable body
- Add phone tracking indicator icon next to tracked team members in
  PatrolForm (read-only, inline with name)
- Add Rafael Soto (Pilot) to Bravo team roster; add Pilot to role dropdown
- Rename patrols: North Ridge Loop → Charlie - North Ridge Loop,
  Coast Road Sweep → Echo - Coast Road Sweep
- Remove second leg from Charlie - North Ridge Loop (keep track unchanged)
- Restore entity last-position subject markers (circle + name label) on map
- Default to /events after login: update Auth0TokenManager and Login to
  navigate to events route instead of root when no intended route saved
- Navigate redirect at SideBar root path → /events as belt-and-suspenders

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ly active leg

- Rename patrol to "Aerial Patrol" and mark it mobileOrigin: true
- Show phone icon badge next to its name in the patrol feed list
- Patrol overview footer shows only End while active (no Pause/Cancel/New Leg)
- Leg detail view renders all fields as read-only when the leg is still
  active; edit pencils and footer Edit button re-appear once the leg is done

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Remove Navigate from SideBar root route (redirect handled upstream in
  Login/Auth0TokenManager); prevents double-heading in SideBar tests
- Update Login test expectation to match new /events default destination

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…tates

- Asset subtype sprite icons in leg detail view and form asset picker
- Jump-to-location map pin button in PatrolOverview header
- Vehicle patrol form: Gas in Tank replaces Driver/Vehicle Name fields
- Aerial patrol form: remove Pilot Name field
- Mobile origin phone icon in PatrolOverview header for mobile-started patrols
- Patrol overview back button: goes to patrol list, or back to event when
  navigated from a linked report (passes location state from LinksSection)
- Leg fit-to-view: focus button zooms map to just that leg's track window
  (patrol overview per-leg row button + leg detail view header button)
- Active button highlight: fit-to-view, jump-to-location, and per-leg fit
  buttons turn blue on click and revert when user pans/zooms the map
- Performance: seed demo patrols in useEffect instead of at module load;
  halve track point density; fingerprint check skips marker rebuild when
  patrol data hasn't changed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants