Repository navigation
Adds dynamic dropdown for track selection - #11
Merged
Merged
Conversation
Eddykasp
reviewed
Aug 4, 2026
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved migration, validation, loading, and field-behavior issues block approval.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds checkbox-based multi-track selection and converts TrackStatement from a dynamic dropdown block to a static block.
Changes:
- Adds
FieldMultiSelectDropdown. - Updates track generation, warnings, and localization.
- Removes the previous dynamic track block implementation.
File summaries
| File | Summary and review notes |
|---|---|
locales/en/en_tokens.js |
Adds English track-selection tokens. Tooltip still references the removed +/- control (nit, 1 vote). |
locales/de/de_tokens.js |
Adds German translations. Tooltip still references the removed +/- control (nit, 1 vote). |
frontend/main.js |
Adds empty-selection warnings, but initial restores and file loads are not fully covered (moderate, 3 votes). |
frontend/generator.js |
Generates commands from selected tracks, but empty selections can produce and submit invalid RailSL (critical, 1 vote). |
frontend/fields.js |
Implements the checkbox field. The popup content is not cleared between openings (moderate, 1 vote), and option values are replaced by labels (moderate, 1 vote). |
frontend/dynamic_blocks.js |
Removes the previous dynamic track block implementation. |
frontend/blocks.js |
Defines the static TrackStatement block. Saved workspaces can lose selections without migration (critical, 3 votes); its tooltip still references the removed +/- control (nit, 2 votes). |
Review details
Suppressed comments (4)
frontend/fields.js:272
DropDownDivreuses this shared content container; without clearing it, each time the field is reopened another checkbox list is appended, so the popup accumulates duplicate/stale rows. ClearcontentDivbefore appending the new list.
const contentDiv = Blockly.DropDownDiv.getContentDiv()
frontend/fields.js:230
FieldDropdownoption tuples use[label, value](as insegName), but this replaces every tuple with[label, label]. As a resultgetFieldValue('MULTI_FIELD')returns display labels instead of the configuredITEMnvalues, making the new field's API inconsistent with the Blockly field it extends and coupling the generator to this hidden behavior. Preserve the option values and map them to segment names in the generator instead.
this.menuOptions_ = options.map(([val]) => [val, val])
locales/de/de_tokens.js:72
- The TrackStatement no longer has a +/- field after this refactor, but this tooltip still tells users to click it. Please update the tooltip to describe selecting tracks through the checkbox dropdown; otherwise the new control is documented incorrectly.
RAILBLOCKS_TRACK_TEXT: 'Setze das Gleis %1 auf %2',
locales/en/en_tokens.js:72
- The TrackStatement no longer has a +/- field after this refactor, but this tooltip still tells users to click it. Please update the tooltip to describe selecting tracks through the checkbox dropdown; otherwise the new control is documented incorrectly.
RAILBLOCKS_TRACK_TEXT: 'Set track %1 to %2',
- Files reviewed: 7/7 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
FieldMultiSelectDropdownfield that allows selecting multiple options using checkboxes.TrackStatementfrom a dynamic block with a standard dropdown to a static block using the new multi-select dropdown field.