Skip to content

Move AOI's analyze and cancel card onto the core popup service - #424

Closed
CarsonDavis wants to merge 5 commits into
feature/298-map-popup-service-v2from
feature/299-aoi-popup-migration-v2
Closed

CarsonDavis wants to merge 5 commits into
feature/298-map-popup-service-v2from
feature/299-aoi-popup-migration-v2

Conversation

@CarsonDavis

@CarsonDavis CarsonDavis commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator
Category Lines added %
Tests 753 74.0%
Production code 265 26.0%

AOI's analyze card is now the core popup, and every way of closing it clears the selection.

Closes #299

The analyze card is the core popup

Previously the card was AOI's own tooltip, mounted through the overlay API with its own CSS. A plugin cannot ship DOM across a sandbox boundary, so the card became data. It is now the core card, same "Analyze area" then "Cancel" order, label on top, anchored above the selection centre. Demo mission: search a state.

What each way of closing does

Analyze is unchanged: it hands the selected feature to the statistics and chart plugins and leaves the highlight up. Previously only Cancel cleared the selection. Now Cancel, the X, Escape and a click on empty map all clear the selection and its highlight; a card that code replaced or retracted leaves it alone. A click on a feature dismisses nothing, so a new selection replaces the open card. Demo mission: all four, then a second state.

Drawing over a selection

Previously the card sat there through the whole drawing session. Now starting a drawing parks the selection and takes the card down, cancelling before a vertex brings the card back, and the first vertex drops it for good. AOI's own subscriptions now go through its handle, so they are released with it. Demo mission: open a card, draw, press Escape; repeat and click once.

Shape identity, lines and points

The panel follows the shape the engine started, not the button pressed, visible when switching shape mid-session. Centroid and bounds now handle linestrings and points. Demo mission: shape identity yes; lines and points only if the mission's draw shapes include them, not the default three.

Closing AOI mid-flight

Previously a selection made and instantly closed could leave an orphan card 1.5 s later. Now AOI's teardown disarms a card still waiting on the camera, core closes any card already open when the plugin is destroyed, and a selection superseded before its card opens never opens one. Demo mission: select, then close AOI. The tooltip component and its styles are gone, and the unused drawingCancelled event with them.

Decisions to review

  • Drawing a new area suspends the previous selection and can restore it. drawstart retracts the card but keeps the selection, the first vertex drops it (plugin:aoi:drawingCleared now fires mid-session, not at completion), and drawcancel reopens the old card. Restoring re-anchors without re-framing, so a selection panned off screen gets its card at the view centre.
  • The label goes as title, rendered as text, not an html body. Labels from boundary data and uploads cannot inject markup, but the body slot stays unused, so a future "size under the name" needs a contract change, not a payload one.
  • Centroid and bounds were generalized from polygons to lines and points. A linestring selection now gets a card and can move the camera; a point yields a degenerate bbox the fit step refuses, so its card may land at the view centre. The alternative was guarding the popup path instead.
  • plugin:aoi:drawingCancelled is gone from AOI's emitted contract. Nothing in the repo listens, so the blast radius is zero today; it matters more once plugins are third-party artifacts. The alternative was keeping it on a secondary press.

AOI asks core for its card with plain data through its own handle and acts on how the card closed: Analyze runs the analysis, Cancel, the X, Escape and an empty-map click clear the selection, and a card that code replaced or retracted leaves the selection alone. Starting a drawing parks the selection and takes the card down; cancelling before a vertex puts both back. The tool's own tooltip component and its styles are gone, and the centroid and bounds helpers handle lines and points.
@slesaad
slesaad added this pull request to stack #434 September 14, 2026 19:37
@CarsonDavis
CarsonDavis marked this pull request as ready for review September 14, 2026 19:38
@CarsonDavis

Copy link
Copy Markdown
Collaborator Author

Superseded by #456 (AOI migration onto the core popup service).

@CarsonDavis CarsonDavis linked an issue Sep 17, 2026 that may be closed by this pull request
4 tasks
@slesaad
slesaad removed this pull request from stack #434 September 21, 2026 22:17
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.

AOI's analyze/cancel card becomes the core popup

1 participant