Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new pro-only line path type (ray-guided) exposed as Arbitrary angle path, integrating it across rendering, UI, persistence, and parallel-line handling.
Changes:
- Introduces the
ray-guidedline path with undirected-angle storage (0..179), angle normalization, and a circular-slider editor UI. - Gates parallel-line features via
supportsParallelLinePath()to excludesimpleandray-guided, and updates creation/import/process flows accordingly. - Bumps save version to 69, adds upgrade + tests, updates i18n strings and style/path compatibility lists.
Reviewed changes
Copilot reviewed 52 out of 53 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/util/save.ts | Bumps save version to 69 and adds 68→69 upgrade step. |
| src/util/save.test.ts | Adds coverage for the 68→69 upgrade. |
| src/util/process-elements.ts | Skips parallel processing for unsupported line path types via supportsParallelLinePath. |
| src/util/parallel.ts | Centralizes parallel support gating and updates parallel grouping/types accordingly. |
| src/util/parallel.test.ts | Adds a unit test asserting ray-guided disables parallel indexing. |
| src/util/clipboard.ts | Ensures pasted edges don’t retain/recompute parallel index for unsupported path types. |
| src/util/change-types.ts | Prevents auto-parallel index generation when switching to unsupported path types. |
| src/constants/lines.ts | Adds LinePathType.RayGuided and registers its external attributes type. |
| src/components/svgs/lines/paths/ray-guided.tsx | Implements ray-guided path generation + attribute editor UI and marks it as pro-only. |
| src/components/svgs/lines/paths/ray-guided.test.ts | Adds tests for path generation, normalization, and disabled slider values. |
| src/components/svgs/lines/lines.ts | Registers the new ray-guided path in linePaths. |
| src/components/svgs/nodes/fill.tsx | Handles ray-guided reversal correctly for fill path generation. |
| src/components/svg-wrapper.tsx | Restricts startFrom toggling logic to parallel-supporting path types only. |
| src/components/svg-canvas-graph.tsx | Avoids assigning parallel indices for unsupported path types during edge creation. |
| src/components/panels/tools/tools.tsx | Displays pro-only paths for unsubscribed users as disabled with a PRO badge. |
| src/components/panels/details/info-section.tsx | Disables parallel controls for unsupported path types via supportsParallelLinePath. |
| src/i18n/translations/en.json | Adds rayGuided displayName and start/end angle labels. |
| src/i18n/translations/ja.json | Adds rayGuided displayName and start/end angle labels. |
| src/i18n/translations/ko.json | Adds rayGuided displayName and start/end angle labels. |
| src/i18n/translations/zh-Hans.json | Adds rayGuided displayName and start/end angle labels. |
| src/i18n/translations/zh-Hant.json | Adds rayGuided displayName and start/end angle labels. |
| src/components/svgs/lines/styles/single-color.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/shmetro-virtual-int.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/shanghai-suburban-railway.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/river.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/mtr-unpaid-area.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/mtr-race-day.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/mtr-paid-area.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/mtr-light-rail.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/mrt-under-construction.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/mrt-sentosa-express.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/lrt-single-color.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/london-tube-terminal.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/london-tube-internal-int.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/london-tube-10-min-walk.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/london-sandwich.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/london-rail.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/london-ifs-cloud-cable-car.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/london-DART.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/jr-east-single-color.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/jr-east-single-color-pattern.tsx | Adds RayGuided to supported line path types (expanded list formatting). |
| src/components/svgs/lines/styles/gzmtr-virtual-int.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/gzmtr-loop.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/guangdong-intercity-railway.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/chongqingrt-loop.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/chongqingrt-line-badge.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/china-railway.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/chengdurt-outside-fare-gates.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/bjsubway-tram.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/bjsubway-single-color.tsx | Adds RayGuided to supported line path types. |
| src/components/svgs/lines/styles/bjsubway-dotted.tsx | Adds RayGuided to supported line path types. |
| package.json | Upgrades @railmapgen/rmg-components to ^10.1.13. |
| package-lock.json | Locks @railmapgen/rmg-components to 10.1.13. |
You can also share your feedback on Copilot code review. Take the survey.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new pro-only line path,
ray-guided, exposed to users as Arbitrary angle path.Changes
ray-guidedline path with:@railmapgen/rmg-componentsto10.1.13and useRmgCircularSlider0..179range0and180as the same direction00..359dial while normalizing stored values to0..179±5°around the opposite angle on both halves of the dialray-guidedfor nowray-guidedpathsray-guidedreversal correctly in fill generationray-guidedas a pro-only line path:PRObadgeray-guidedpaths remain editable, matching the currentsimplebehaviorTests
ray-guidedpath generationray-guidedVerification
npx tsc --noEmitnpm run lintnpm test -- --run