Skip to content

Render interactive Azure Maps results in the V2 chat (pan, zoom, point details) #1609

Closed

Description

@paullizer

Summary

Classic chat renders Azure Maps (OpenLayers) action results as an interactive map. The V2 chat has no map renderer, so these results can't be explored there. Bring the interactive map to V2 and add hover tooltips for points and paths.

User Value

A map with several locations, a route, or reads along a corridor is hard to read as one fixed view. Users want to start from the view that shows everything, then zoom into an area, pan along a path, and see what each point is and when it was recorded, without leaving the conversation.

Current Behavior

  • Classic chat: chat-inline-maps.js takes the {{map:...}} inline block and the azure_maps_openlayers tool result, and draws an OpenLayers map with Azure Maps tiles through /api/azure-maps/tile. It supports pan, zoom and fit to features, and shows a popup when a marker, path or area is clicked. Hovering only changes the cursor.
  • V2 chat: no component handles the inline block or the tool result, and the V2 app has no map library. azure_maps_openlayers appears only in the action editor.

Proposed Behavior

  • A V2 map component for azure_maps_openlayers results and {{map:...}} blocks. It draws markers, ordered paths and areas on Azure Maps tiles, loaded through the existing tile proxy.
  • Expired tile tokens in older messages are refreshed, as refresh_azure_maps_message_content already does.
  • The map opens fitted to all features. Pan, zoom and an expand option are available.
  • Hovering a marker or path shows a tooltip with its label, time and description. Clicking keeps the details open.
  • OpenLayers is bundled from a pinned local package, never a CDN, and the CSP stays as strict as classic chat's.
  • A list of the map's points sits next to the map, for keyboard and screen-reader users.
  • Where an interactive map can't render, such as exported documents, a readable fallback (summary text or a static snapshot) is shown.

Acceptance Criteria

  • A V2 conversation with an Azure Maps result shows an interactive map with pan, zoom and fit to features.
  • Hovering a marker or path shows its label and details, and clicking keeps them open.
  • Tiles load through /api/azure-maps/tile, and maps in older messages still load after their tile token expires.
  • No CDN assets are added, and the CSP is unchanged or tighter.
  • Classic chat gets the same hover tooltips, or the issue records why not.
  • Functional and UI tests cover the renderer and the tile token refresh.

Notes

  • Classic renderer: application/single_app/static/js/chat/chat-inline-maps.js, with OpenLayers vendored in static/js/openlayers/ol.js.
  • Plugin: semantic_kernel_plugins/azure_maps_openlayers_plugin.py. Payload helpers and token refresh: functions_azure_maps.py. Tile proxy: /api/azure-maps/tile in route_frontend_conversations.py.
  • V2 references azure_maps_openlayers only in ActionAuthentication.tsx and workspaceActionRegistry.ts.

Activity

  1. paullizer commented on Oct 2, 2026

    @paullizer
    ContributorAuthor

    Implemented in PR #1612 (0.261.223), on top of the V2 inline media work.

    Acceptance criteria

    • A V2 conversation with an Azure Maps result shows an interactive map with pan, zoom and fit to features. It also has a Full screen control. The mouse wheel zooms only with Ctrl/Cmd, so scrolling a conversation never zooms a map by accident.
    • Hovering a marker or path shows its label and details, and clicking keeps them open (until a click elsewhere on the map or Escape). The payload has no separate time field; times come through in labels and descriptions.
    • Tiles load through /api/azure-maps/tile only: the card refuses any other tile template. Maps in older messages still load after their tile token expires: GET /api/get_messages and GET /api/collaboration/conversations/<id>/messages now reissue tokens, as the classic message route already did. The collaboration route also covers group conversations that receive a workflow's reply.
    • No CDN assets are added and the CSP is unchanged. OpenLayers 10.6.1 is vendored into application/v2_ui/public/vendor/openlayers-10.6.1/, byte-identical to the published package and to the classic chat's copy, and is loaded only when a reply has a map.
    • Classic chat hover tooltips: not in this PR. It targets the V2 branch and leaves the classic renderer untouched. Classic keeps click-for-details; adding hover there is a small follow-up in chat-inline-maps.js.
    • Functional and UI tests: functional_tests/test_v2_inline_maps.py (7), functional_tests/test_v2_inline_maps_logic.mjs (13) and ui_tests/test_v2_inline_maps.py (4). The UI tests run the real MessageList and card in Chromium with production CSS. The tile token refresh is covered by the functional test.

    Also included

    • List what the map shows: a text list of every marker, path and area beside the map, for keyboard and screen reader users.
    • Legacy {{map:...}} blocks are hidden from V2 reply text, as the classic chat hides them. The map is drawn from the tool result.
    • A compact (artifact-backed) map citation is fetched once through /api/conversation/<id>/agent-citation/<artifact_id>.
    • Map text is only ever written as text. OpenLayers' attribution control writes HTML, so it is turned off and the attribution is shown as plain text.

    Not covered

    • Exported conversations do not draw maps (no static snapshot yet).
  2. paullizer commented on Oct 2, 2026

    @paullizer
    ContributorAuthor

    Follow-up from deploying #1612 to a SimpleChat POC deployment:

    • Maps drew their markers and paths on blank tiles. Tool results are redacted before they are stored as citations, and the token= rule replaced the tile proxy token with ***REDACTED***, so every tile request returned 400.
    • Fixed in 0.261.224 on V2 chat: inline media players, image cards, agent-posted markdown, and interactive maps (0.261.224) #1612. Redaction now keeps a token= value only where it directly follows /api/azure-maps/tile?. That token is encrypted, expires, and only works on SimpleChat's signed-in tile proxy. Everything else is still redacted.
    • Backported to Development in Keep the Azure Maps tile token when tool results are redacted (0.261.050) #1618, because classic chat stores maps the same way.
    • Maps stored before the fix keep the redacted token and can't be repaired. Running the request again produces a working map.
    • Verified on the POC: a fresh run's map loaded all 26 tiles with no failures and no page errors.
  3. paullizer commented on Oct 2, 2026

    @paullizer
    ContributorAuthor

    Closing as complete. V2 now draws Azure Maps results under the reply, with pan, zoom, full screen and point details:

    Verified on a SimpleChat POC deployment.

  4. moved this from Pending Evaluation to Released in Simple Chat Roadmapon Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2Priority 2: important, scheduled after P0/P1enhancementNew feature or request

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions