Skip to content

refactor: AOI tool to monorepo pattern + event triggered panel#124

Open
BhattaraiSijan wants to merge 1 commit into
developmentfrom
refractor/aoi-draw
Open

refactor: AOI tool to monorepo pattern + event triggered panel#124
BhattaraiSijan wants to merge 1 commit into
developmentfrom
refractor/aoi-draw

Conversation

@BhattaraiSijan

Copy link
Copy Markdown
Collaborator

Purpose

Refactor the AOI (Area of Interest) tool to the monorepo tool pattern — a portable lib/ of presentational React components with all MMGIS coupling isolated in adapters/ — and make the selection panel open on demand from the Title plugin instead of showing eagerly. No change to the tool's capabilities (search / inspect / draw / upload / analyze).

Proposed Changes

  • [CHANGE] Restructure AOI into the standard layout: portable lib/geo/* components + lib/styles/components-geo/*, MMGIS glue in adapters/, state + bus wiring in MMGISAOIAdapter.tsx, thin AOITool.tsx mount wrapper, and a metadata block in config.json.
  • [CHANGE] Port the legacy AOITool.js to React 19 createRoot + TypeScript; migrate styling to BEM (blocks-aoi-*) with USWDS --theme-* design tokens (Path A theming).
  • [CHANGE] Route all map/plugin messaging through the shared _shared/adapters/mmgisAPI (no tool-local bus copy); split pure helpers into adapters/{search,parse,geometry,slug}.ts.
  • [ADD] Event-gated panel: AOI stays hidden until the Title plugin emits plugin:title:analyzeAreaBtnClicked (OPEN_PANEL_CHANNEL); the adapter stays mounted and listening while hidden. The in-tooltip "Analyze area" → statistics trigger is unchanged.
  • [FIX] Remove the legacy react-dom render/unmountComponentAtNode path (incompatible with React 19) along with the old AOIComponent/ and AOITool.js.

Issues

Testing

  • npm run typecheck0 errors.
  • Manual smoke test via console: window.mmgisAPI.emit('plugin:title:analyzeAreaBtnClicked') reveals the panel; all four modes (search / inspect / draw / upload), selection → tooltip → analyze, and fit-bounds verified in browser.

@BhattaraiSijan BhattaraiSijan requested a review from slesaad June 9, 2026 18:10
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.

1 participant