Map: OSM provider - Add marker tooltips - #35164
AlisherAmonulloev wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The implementation is cohesive and extensively covers interaction, accessibility, positioning, and cleanup behavior.
Pull request overview
Adds accessible marker tooltips to the OpenStreetMap provider using DevExtreme Popovers.
Changes:
- Implements tooltip rendering, positioning, keyboard handling, focus restoration, and cleanup.
- Adds tooltip styling and Storybook controls.
- Adds comprehensive QUnit coverage and updates the OpenLayers mock.
File summaries
| File | Description |
|---|---|
packages/devextreme/testing/tests/DevExpress.ui.widgets/mapParts/osmTests.js |
Covers tooltip behavior, accessibility, lifecycle, and positioning. |
packages/devextreme/testing/helpers/forMap/openLayersMock.js |
Attaches mock overlay containers to the map target. |
packages/devextreme/js/__internal/ui/map/provider.dynamic.osm.ts |
Passes tooltip options and manages cleanup focus behavior. |
packages/devextreme/js/__internal/ui/map/provider.dynamic.osm.openlayers.ts |
Integrates tooltips with OpenLayers markers. |
packages/devextreme/js/__internal/ui/map/provider.dynamic.osm.openlayers.tooltip.ts |
Implements the marker tooltip component. |
packages/devextreme/js/__internal/ui/map/provider.dynamic.osm.openlayers.popover.ts |
Adds specialized Popover positioning behavior. |
packages/devextreme/js/__internal/ui/map/provider.dynamic.osm.engine.ts |
Extends internal marker contracts for tooltips and cleanup. |
packages/devextreme-scss/scss/widgets/base/_map.scss |
Styles marker Popovers and close controls. |
apps/react-storybook/stories/map/OSMMap.stories.tsx |
Demonstrates configurable OSM marker tooltips. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
Hidden tooltips currently perform layout work per marker on every OpenLayers render frame, creating a scalability concern.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 1
- Review effort level: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Interactive tooltip semantics and dynamic focus-state enforcement have unresolved accessibility issues.
Review details
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
packages/devextreme/js/__internal/ui/map/provider.dynamic.osm.openlayers.tooltip.ts:75
- Focusable tooltip content is explicitly exercised by the new SelectBox and custom-button cases, but this configuration keeps the Popover's effective role as
tooltip; Popover only derivesdialogfrom toolbar items or a title-plus-Close configuration. A tooltip role must not contain interactive controls, and its dialog focus behavior is disabled, so keyboard and screen-reader users cannot reliably operate that content. Detect interactive content (including runtimecontentTemplatechanges) and switch to dialog semantics/focus handling, or disallow interactive marker-tooltip content.
packages/devextreme/js/__internal/ui/map/provider.dynamic.osm.openlayers.tooltip.ts:116 - The map's focus policy is only re-applied while the Popover is opening. If an already-visible tooltip on a map with
focusStateEnabled: falseis changed through the supported Popover options (toolbarItems, or title plus Close), Popover's_syncAriaAttributes()calls_syncFocusOptions()and resets both focus options totruefor the dialog role. The open tooltip then bypasses the map setting. Re-apply the map-level gate whenever role-affecting Popover options change, not only before showing.
- Files reviewed: 8/8 changed files
- Comments generated: 0 new
- Review effort level: Balanced
The built-in marker tooltip is intended for non-interactive text and basic HTML formatting. We therefore keep role="tooltip", aria-describedby, and focus on the marker. |
No description provided.