Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a “TransportStopRouteDetails” secondary panel for transport stops, including route previews/details, stop-by-stop listing with navigation controls, and tighter integration between the stop list and map marker hover/selection behavior.
Changes:
- Introduces a new transport route details drawer (with stop list UI, prev/next navigation, and scroll-aware header styling).
- Updates transport stops map layer + marker selection logic to support route-stop hover/click behaviors and route-only marker rendering.
- Refactors secondary-drawer usage across menus (new
SecondaryMenuDrawer) and updates translations/UI building blocks (e.g.,DefaultItemright-side text).
Reviewed changes
Copilot reviewed 24 out of 28 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| map/src/util/hooks/useHasVerticalScroll.js | New hook to detect vertical overflow with debounce to prevent header flicker. |
| map/src/util/hooks/map/useSelectMarkerOnMap.js | Adds transport-stop-specific handling for hover pins and markerData extraction. |
| map/src/resources/translations/en/web-translation.json | Adds web namespace strings for transport UI labels. |
| map/src/resources/translations/en/translation.json | Adds shared strings (interval/min/prev/next, etc.) used by transport route details. |
| map/src/menu/navigation/NavigationSettings.jsx | Switches to shared SecondaryMenuDrawer component. |
| map/src/menu/MainMenu.js | Clears selected transport route when closing subpages; minor toolbar spacing tweak. |
| map/src/map/markers/SelectedPinMarker.js | Adjusts square pin icon offset ratio. |
| map/src/map/markers/MarkerOptions.js | Improves SVG path scaling to handle arc flags correctly. |
| map/src/map/layers/TransportStopsLayer.js | Adds route-stop marker layer drawing, hover/list integration, and selection hook usage. |
| map/src/infoblock/infoblock.module.css | Tweaks top container padding. |
| map/src/infoblock/components/wpt/wptDetails.module.css | Removes transport route item styles (moved to transport module). |
| map/src/infoblock/components/wpt/transport/transport.module.css | Adds extensive styling for route details header + stop list interactions. |
| map/src/infoblock/components/wpt/transport/TransportStopsRoutes.jsx | Adds nearby routes fetch + conditional rendering of new route details panel. |
| map/src/infoblock/components/wpt/transport/TransportStopRouteNavButtons.jsx | New prev/next navigation buttons for route stop list selection/highlight. |
| map/src/infoblock/components/wpt/transport/TransportStopRouteItem.jsx | Adds hover-preview loading + click-to-open full route details behavior. |
| map/src/infoblock/components/wpt/transport/TransportStopRouteDetails.jsx | New secondary drawer showing route details + stop list with collapsible “before” segment. |
| map/src/infoblock/components/wpt/transport/TransportStopActionIcon.jsx | New icon component for stop row hover action affordance. |
| map/src/infoblock/components/wpt/WptDetails.jsx | Refactors header usage + scroll layout, and fetches stop tags/OSM URL via routing API. |
| map/src/frame/components/other/SecondaryMenuDrawer.jsx | New shared drawer wrapper for “secondary” left-side panels. |
| map/src/frame/components/items/DefaultItem.jsx | Adds rightText support for list rows (used for travel time in stop list). |
| map/src/frame/components/header/header.module.css | Adds close/back button styling for shared header components. |
| map/src/frame/components/header/HeaderWithUnderline.jsx | Adds optional back button and applies new close/back button styling. |
| map/src/frame/components/header/HeaderNoUnderline.jsx | Adds optional back button and applies new close/back button styling. |
| map/src/frame/GlobalFrame.js | Accounts for route-details secondary drawer in total menu width calculation. |
| map/src/assets/icons/ic_action_transport_stop_stroke.svg | New transport stop action icon asset. |
| map/src/assets/icons/ic_action_transport_stop_list.svg | New transport stop list icon asset. |
| map/src/assets/icons/ic_action_transport_stop_bg.svg | New transport stop action background asset. |
| map/src/assets/icons/ic_action_back.svg | New back icon asset used by route nav buttons. |
Comments suppressed due to low confidence (1)
map/src/map/layers/TransportStopsLayer.js:23
- This file imports
useSelectMarkerOnMapwhile exportingTRANSPORT_STOPS_LAYER_ID;useSelectMarkerOnMapalso importsTRANSPORT_STOPS_LAYER_IDfrom this file, creating a circular import. This can causeTRANSPORT_STOPS_LAYER_IDto be undefined during initialization. Extract the constant(s) into a separate shared module to avoid the cycle.
import { useSelectMarkerOnMap } from '../../util/hooks/map/useSelectMarkerOnMap';
import debounce from 'lodash-es/debounce';
import { MENU_INFO_OPEN_SIZE, MAIN_URL_WITH_SLASH, STOP_URL } from '../../manager/GlobalManager';
export const TRANSPORT_STOPS_LAYER_ID = 'transport-stops-layer';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "shared_string_minute_lowercase": "min", | ||
| "shared_string_interval": "Interval", | ||
| "transport_stops": "stops", | ||
| "shared_string_previous": "Previous", | ||
| "shared_string_next": "Next" |
There was a problem hiding this comment.
The utility inserts imports incorrectly. I'll fix the utility separately later.
| let arcN = 0; // 1..7 inside A/a (4th and 5th are flags, must stay 0 or 1) | ||
| const newPathData = pathData.replace(/([Aa])|([MLHVCSQTZmlhvcsqtz])|([-+]?\d*\.?\d+)/g, (m, isArc, isCmd, num) => { | ||
| if (isArc) { | ||
| arcN = 1; | ||
| return m; | ||
| } | ||
| if (isCmd) { | ||
| arcN = 0; | ||
| return m; | ||
| } | ||
| if (num !== undefined) { | ||
| const n = Number.parseFloat(num); | ||
| if (arcN >= 4 && arcN <= 5 && (n === 0 || n === 1)) { | ||
| arcN = arcN === 5 ? 0 : arcN + 1; | ||
| return num; | ||
| } | ||
| if (arcN >= 1) arcN = arcN >= 7 ? 0 : arcN + 1; | ||
| return String(Math.round(n * scaleFactor)); | ||
| } | ||
| return m; | ||
| }); |
There was a problem hiding this comment.
How is it connected to TransportStopRouteDetails? Why was the previous "newPathData" code worse?
There was a problem hiding this comment.
This method scales SVG path data to fit any marker size. The bug was that the old code blindly scaled all numbers in the path, including the arc (A/a) flag parameters (large-arc-flag and sweep-flag), which are booleans (0 or 1) and must not be scaled. This fix adds proper parsing of SVG path commands so that arc flags are left untouched while all other coordinates are scaled correctly.
RZR-UA
left a comment
There was a problem hiding this comment.
Follow comments and fix conflicts, plz.
No description provided.