Skip to content

add TransportStopRouteDetails#1490

Merged
alisa911 merged 30 commits intomainfrom
270226_2
Mar 17, 2026
Merged

add TransportStopRouteDetails#1490
alisa911 merged 30 commits intomainfrom
270226_2

Conversation

@alisa911
Copy link
Copy Markdown
Contributor

No description provided.

@alisa911
Copy link
Copy Markdown
Contributor Author

#1251

@alisa911 alisa911 requested a review from Copilot March 10, 2026 09:48
@alisa911 alisa911 marked this pull request as ready for review March 10, 2026 09:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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., DefaultItem right-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 useSelectMarkerOnMap while exporting TRANSPORT_STOPS_LAYER_ID; useSelectMarkerOnMap also imports TRANSPORT_STOPS_LAYER_ID from this file, creating a circular import. This can cause TRANSPORT_STOPS_LAYER_ID to 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.

Comment thread map/src/infoblock/components/wpt/transport/TransportStopsRoutes.jsx
Comment thread map/src/map/layers/TransportStopsLayer.js
Comment thread map/src/util/hooks/map/useSelectMarkerOnMap.js
@alisa911 alisa911 requested a review from RZR-UA March 10, 2026 13:50
Comment thread map/src/util/hooks/useHasVerticalScroll.js Outdated
Comment on lines +6033 to +6037
"shared_string_minute_lowercase": "min",
"shared_string_interval": "Interval",
"transport_stops": "stops",
"shared_string_previous": "Previous",
"shared_string_next": "Next"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix indent

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The utility inserts imports incorrectly. I'll fix the utility separately later.

Comment on lines +275 to +295
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;
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is it connected to TransportStopRouteDetails? Why was the previous "newPathData" code worse?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

@RZR-UA RZR-UA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow comments and fix conflicts, plz.

@alisa911 alisa911 merged commit ec07101 into main Mar 17, 2026
@alisa911 alisa911 deleted the 270226_2 branch March 17, 2026 09:42
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.

3 participants