Swipe mode fix ups round 2: secondary layer style sync and selection routing#1616
Swipe mode fix ups round 2: secondary layer style sync and selection routing#1616
Conversation
Co-authored-by: jumpinjackie <563860+jumpinjackie@users.noreply.github.com>
|
@copilot Some observations.
Caused by the following sequence. Activate swipe mode |
…ss-map feature hit detection Co-authored-by: jumpinjackie <563860+jumpinjackie@users.noreply.github.com>
Fixed both remaining issues in commit Duplicate item error on map switch: The root cause was my secondary-layer-sync OL vector selection overlay not updating: OL's |
|
@copilot Another follow up. The duplicate item script error is gone 👍 but we still do not have the ability to select after selecting different maps in swipe mode. To assist, here's screenshots of the whole sequence after adding layers to both. Selecting a boundary on the primary map works and shows its feature popup. As an aside the swipe mode splitter is being drawn above the popup, when the popup should really be above it. Then selecting a boundary on the secondary map deselects from the primary and selects the boundary on the secondary map and shows its feature popup. If I select a boundary on the primary map again, the secondary map deselects, but I get no selected boundary or feature popup, only the hover selection state. If I were to switch to just the secondary map, selecting boundaries does not give me a selected boundary or feature popup, only the hover selection state. Browser console chatter suggests that the redux state is being updated. If I were to switch to just the primary map, selecting boundaries does not give me a selected boundary or feature popup, only the hover selection state. Browser console chatter suggests that the redux state is being updated. |
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot I think we're on the home stretch. Selection works on both sides in swipe-mode and also before/after toggling swipe mode. The only issue is that selection in general (swipe mode or not) does not seem to reliably visually update if there is a hover selection overlay currently over the boundary I just clicked in select mode. For example, in this screenshot, when I click the boundary with the red outline (from the hover selection), there is redux actions dispatched and the selection panel shows the properties of the boundary I selected, but the boundary itself does not visually become selected and there is no feature popup. |
|
@copilot Coveralls reported a drop in coverage. Pls add/update test to ensure any new or changed code has been covered. |
…amedMapLayers() Co-authored-by: jumpinjackie <563860+jumpinjackie@users.noreply.github.com>
Added tests in commit
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot Your most recent change has errors. Pls fix: |
…r instead of raw dispatch Co-authored-by: jumpinjackie <563860+jumpinjackie@users.noreply.github.com>
... Fixed in commit |






Two bugs in swipe mode: (1) layer style edits on the secondary map weren't reflected in the OL canvas until a map switch/re-activate cycle, and (2) clicking to select on the secondary side corrupted primary map selection state — and persisted after deactivating swipe.
Issue 1 — Secondary layer styles not applied live
useViewerSideEffectsonly watcheduseActiveMapLayers()(primary map). Redux updates to the secondary map's layer state never triggeredlayerManager.apply()for that map.containers/hooks.ts: AddeduseNamedMapLayers(mapName)— same equality semantics asuseActiveMapLayersbut for an arbitrary map name.containers/neo-map-viewer.tsx: When swipe is active, derivesecondaryMapNamefromuseMapSwipeInfo()and watch its layers viauseNamedMapLayers. A newuseEffectcallscontext.getLayerManager(secondaryMapName).apply(secondaryLayers)on change:Issue 2 — Selection routing when clicking secondary side
Two separate bugs compounding the problem:
queryWmsFeatures— wrong Redux target:addClientSelectedFeaturewas called withoutmapNameOverride, so WMS feature selections on the secondary side were stored under the primary map name in Redux. Fixed by passingmapNameto the callback.onMapClick— spurious primary query: When clicking the secondary side with no vector/WMS hit,onProviderMapClick(px)fired unconditionally. For MapGuide maps this dispatched aQUERYMAPFEATURESfor the primary map using secondary-side pixel coordinates, producing a phantom selection. AddedisClickOnPrimaryguard:After deactivation
_swipeSecondaryMapNameisundefined, soisClickOnPrimaryis alwaystrueand normal click behaviour is fully restored.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
storybook.js.org/opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node /home/REDACTED/work/mapguide-react-layout/mapguide-react-layout/node_modules/.bin/storybook build -c .storybook c/components/tooltips/selected-features.ts c/components/tooltips/feature.ts /home/REDACTED/work/_temp/copilot-developer-action-main/ebpf/in-path/mkcert(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.