Skip to content

Configures pop-ups for sign locations added to work order#343

Open
mateoclarke wants to merge 7 commits into21517-app-nextfrom
mateo/26881_pop_ups
Open

Configures pop-ups for sign locations added to work order#343
mateoclarke wants to merge 7 commits into21517-app-nextfrom
mateo/26881_pop_ups

Conversation

@mateoclarke
Copy link
Copy Markdown
Contributor

@mateoclarke mateoclarke commented Apr 20, 2026

Associated issue

Closes cityofaustin/atd-data-tech#26881

Summary

Two related pieces of work shipped together on this branch:

1. Pop-up enhancements for sign locations added to a work order

  • Popups now prefer Location ID (from AGOL ASSET_LOCATION_ID / Knack field_4461) and fall back to Spatial ID only when no Location ID is present.
  • Lat/lng is no longer shown in the popup.
  • When a Knack sign-location pin shares a lat/lng with an AGOL sign (within ~5 m), the AGOL marker is hidden and its attributes (including sign messages) are merged into the Knack pin's popup.
  • The ID row in the popup is now a link that opens the Location Details page in Knack.

2. Symbology + default mode + "Add Location" button styling

  • Knack sign locations now render as circular points (not pins) with state-based styling:
    • Yellow — existing Knack sign location
    • Green with a "NEW" label — newly-created location (no AGOL ASSET_LOCATION_ID)
    • Red — the location currently being viewed on a Location Details page
  • Map defaults to Select Existing mode on first load; user's last choice is still persisted in sessionStorage.
  • The "Add Location" button in Create Location mode is restyled to match the popup's Bootstrap btn-primary and is centered at the bottom of the map.
Screenshot 2026-04-22 at 4 24 38 PM Screenshot 2026-04-22 at 4 24 59 PM

Testing

Use the test Knack app test-30-may-2024-signs-and-markings-operations and GIS QA credentials (from 1Password).

Steps to test:

1. Default mode is "Select Existing"

  1. If necessary, clear sessionStorage for the Knack app origin (DevTools > Application > Storage > Clear site data), then load the Add Sign Location view on an existing work order.
  2. Expected: The Select Existing toggle is active by default (not Create Location).
  3. Switch to Create Location, reload the page.
  4. Expected: The map restores Create Location — the last-used mode is still persisted across reloads.

2. Pop-ups prefer Location ID and link to details & No lat/lng in popups

  1. In Select Existing mode, click an AGOL sign that is not already added to the work order.
  2. Expected popup shows: sign message(s), no lat/lng row, no Spatial ID.
  3. Add the location to the work order, then click the newly-created pin.
  4. Expected: The pin is yellow (indicating it was created from an existing sign location). Also, the popup shows Location ID, and the ID is a link to that location's details page.
  5. From Create Location mode, drop a new pin by dragging the red pin in place and clicking "Add Location" button.
  6. Expected: The new pin is green (new), popup shows Spatial ID (not Location ID since it creates a new value instead of inheriting one from AGOL), and the ID links to the location's details page.
  7. Click any sign popup (AGOL-only, existing Knack, newly-created Knack).
  8. Expected: No Lat / Lng rows in any popup variant.

3. Co-located AGOL + Knack sign de-dup

  1. Find a work order with at least one Knack sign location that was originally added from AGOL (ex: link this one).
  2. Load the map and zoom in until AGOL features appear.
  3. Expected: At that Knack pin's location, only the yellow Knack point is visible — the AGOL marker at the same lat/lng should be hidden.
  4. Click the Knack point. Expected: The popup shows the Location ID and the sign messages merged in from AGOL (proves the AGOL attributes were merged rather than dropped).
  5. Zoom out past the AGOL display threshold and back in. Expected: Blue dots disappear outside zoom threshold, yellow dots stay visible.
  6. From "Select Existing" mode, click a blue dot to open the popup and "Add this Location". Expected: When the map reloads, only a yellow dot appears in the place of the blue dot that was there.

4. Symbology

  1. On a work order with mixed signs, visually confirm:
    • Existing Knack locations → yellow circle, no label
    • Newly-created (from "Create Location" mode) → green circle with NEW label
    • If you navigate into a Location Details page, the sign for the current location renders as a red circle.

5. "Add Location" button update in "Create Location" mode

  1. Switch to Create Location mode on a work order map.
  2. Expected: The Add Location button is styled like the blue popup primary button (matching btn-primary), and is centered at the bottom of the map, not tucked into the form layout.
  3. Click the button. Expected: A new location is created at the center of the map and handed off to Knack as before.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 20, 2026

Deploy Preview for nextjs-knack-signs-markings canceled.

Name Link
🔨 Latest commit e8cbce4
🔍 Latest deploy log https://app.netlify.com/projects/nextjs-knack-signs-markings/deploys/69f502764b53190008454c55

@mateoclarke mateoclarke changed the base branch from staging to 21517-app-next April 20, 2026 17:44
@mateoclarke mateoclarke marked this pull request as draft April 20, 2026 17:45
Comment thread knack/index.css
}
/* END #233 */

#view_3207 > div.kn-records-nav > div.js-filter-menu.tabs.is-toggle.is-flush > ul > li:nth-child(2) > a{
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

All of this to the bottom of the page was in the test environment but not committed, and I didn't want to overwrite it without knowing why it was added.

);
const signPins = useCreateSignPins(knackSigns, setPopupInfo);

// Merge AGOL attributes into co-located Knack signs and filter those
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This logic is essentially to dedupe and merge data so we don't have the problem of Knack signs and AGOL locations overlapping.

// Merge AGOL attributes into co-located Knack signs and filter those
// AGOL features out of the layer so they don't render on top of Knack pins.
const { enrichedSigns, filteredAgolGeoJSON } = useMemo(() => {
if (!isZoomedInEnough || agolSignsGeoJSON.features.length === 0) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the fast path short circuit if the user isn't zoomed to see AGOL layer. Or if there's no features in the AGOL geojson layer.

};
}

const COLOCATION_THRESHOLD_METERS = 5;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Open to feedback on this threshold should be smaller.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

my feeling is this is something to refine with user feedback, I have no idea if this is too big of a threshold in areas where there are a ton of signs close to each other.

@mateoclarke mateoclarke marked this pull request as ready for review April 22, 2026 22:25
@mateoclarke
Copy link
Copy Markdown
Contributor Author

Note from @ChristinaTremel after review on 4/23:

Mateeeeoooo! 🙌 Testing steps were 10/10. And the changes look SO goood! I love the switch up to the points that are added to the work order and how transparently someone can see the new locations they're adding. Also the changes to the add location button feels way more natural to click around on the map. I'm out of office this afternoon through Monday so I ran through everything quickly this morning. Early next week I can get a tablet and test on that as well!

Upon initial testing the only thing I'm noticing is when a location is added, the map zooms out further than I would expect it to and I have to zoom back in every time. I think if it could zoom out less when the map reloads that would be helpful!

Copy link
Copy Markdown

@roseeichelmann roseeichelmann left a comment

Choose a reason for hiding this comment

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

followed all the test steps and they worked as expected!

whenever you switch to Create Location, would it be possible to automatically close out of any pin popups you had selected? Bc its kind of confusing when you have a popup open and you click Create Location and the red marker is covered by the popup.

Comment thread knack/index.css
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what do you think about adding some comments that alert the app team to not touch these styles without checking with the dev team, or a comment saying that these specific styles are used in the react map integration. Something to let them know where the styles are being applied

const raw = sessionStorage.getItem(STORAGE_KEY);
if (isLocationMode(raw)) return raw;
} catch {
// private mode / quota
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

just curious, what does "quota" mean?

Copy link
Copy Markdown
Member

@chiaberry chiaberry left a comment

Choose a reason for hiding this comment

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

🚀
this looks so slick Mateo, I missed the last PR so this is a huge jump in user experience for me.

It could be because I am on VPN, but I noticed some delay between clicking to select an existing location and getting feedback (the map reloading). I am guessing it is knack slowness, maybe some visual feedback before the map reloads, like a loading icon or something while knack is trying to process the data?

I added locations, zoomed in and out, deleted locations and checked the location details pages. all looks so good!

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.

Configure pop-ups for sign locations added to work order

3 participants