Repository navigation
feat(editor): Map ↔ Scenario mode, and the p8-s2 docs (#246) - #532
Merged
Merged
Conversation
The issue's own acceptance is "mode switch preserves both documents; placed actors serialize to OpenSCENARIO and round-trip". The second half landed in #527/#528 with a byte-identical round-trip test; this is the first. View > Scenario Mode switches which document is authored. BOTH stay open: the roads remain visible and selectable for reference, and switching back returns to the map with its undo history intact — which is free, because both documents already share one undo stack. ★ THE GATE IS DERIVED, NOT HAND-WRITTEN. apply_editor_mode() walks the shortcut registry and gates each action by shortcuts::toolbar_tab_of(). Every tool already declares its toolbar group and toolbar_violations() fails the build for one that does not — so a tool added by a later pillar is gated correctly the day it lands, with nothing here to update. A hand-written list would silently leave it enabled in BOTH modes, and nothing would notice: a tool that is merely available when it should not be still works. The core strip is never withheld. Taking Select or Delete away with the mode would leave the user unable to inspect anything. A tool disabled by a mode switch is also DEACTIVATED. Left active it would keep receiving viewport events behind a greyed-out button. The mode persists per SCENE in <scene>.rmscene.json rather than in QSettings: it describes the scene you were working on, not a preference. Restoring it blocks the action's signal, so a restore does not look like the user toggling it and immediately write itself back. DOCS, AND WHAT THEY NOW ADMIT GW-6 steps 1-4 are refined to what shipped, and step 1's wording is AMENDED: it said "the scenario toolbar tab activates", describing UI that #377 removed when it replaced the tabbed toolbar with one flat row. Steps 3 and 4 now carry explicit warnings that the Attributes pane rows, the scene-tree branch, actor picking and Delete routing are follow-up work rather than implying they shipped. Step 3's original "distinct from props" also had nothing to contrast against — props are not in the scene tree at all today. ADR-0014 gains a dated amendment: §9's "teaching the project model about scenario files is p8-s2's" is discharged (the .xosc is derived from the scene's stem, never stored), and the two model changes a reader must not miss are recorded — the position variant, and <PrivateAction> gaining a second arm with one element emitted per set arm. The one known asymmetry is recorded rather than hidden: a file that omitted @offset gains offset="0" on rewrite. Local: ctest 3094/3094 (exit code checked), format clean. 6 new tests.
This was referenced Jul 31, 2026
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.
Part of #246 (
p8-s2). Follows #527, #528, #529, #531. Does not close the issue — see the scope note at the end.The issue's own acceptance
The second half landed in #527/#528 with a byte-identical round-trip test. This is the first half.
View ▸ Scenario Mode switches which document is authored. Both stay open: the roads remain visible and selectable for reference, and switching back returns to the map with its undo history intact — which is free, because both documents already share one undo stack.
★ The gate is derived, not hand-written
apply_editor_mode()walks the shortcut registry and gates each action byshortcuts::toolbar_tab_of(). Every tool already declares its toolbar group, andtoolbar_violations()fails the build for one that does not — so a tool added by a later pillar is gated correctly the day it lands, with nothing here to update.A hand-written list would silently leave it enabled in both modes, and nothing would notice: a tool that is merely available when it shouldn't be still works. The test suite asserts the property the derived gate rests on — every
Toolsrow carries a group — so the dependency is explicit rather than incidental.Two consequences worth stating:
Persistence
The mode persists per scene in
<scene>.rmscene.json, not inQSettings— it describes the scene you were working on, not a preference. Restoring it blocks the action's signal, so a restore does not look like the user toggling it and immediately write itself back.Docs, and what they now admit
GW-6 steps 1–4 are refined to what shipped, and step 1's wording is amended: it said "the scenario toolbar tab activates", describing UI that #377 removed when it replaced the tabbed toolbar with a single flat row. Rather than build a tab to satisfy a stale sentence, the sentence is corrected.
Steps 3 and 4 now carry explicit ⚠ warnings that the Attributes pane rows, the scene-tree branch, actor picking and Delete routing are follow-up work — rather than reading as though they shipped. Step 3's original "distinct from props" also had nothing to contrast against: props are not in the scene tree at all today.
ADR-0014 gains a dated amendment. §9's "teaching the project model about scenario files is
p8-s2's" is discharged — the.xoscis derived from the scene's stem and never stored, because a stored copy of a derivable path can only ever disagree with the scene. It also records the two model changes a reader must not miss (the position variant;<PrivateAction>'s second arm and one-element-per-set-arm emission), and the one known asymmetry: a file that omitted@offsetgainsoffset="0"on rewrite.Verification
ctest --preset ci-macos— 3094/3094, exit code checkedclang-formatclean via CI's exact commandScope: what remains on #246
Deliberately not claimed as done — viewport picking of actors, Delete routing, the scene-tree scenario branch, and the Attributes pane actor rows. The issue's stated acceptance is met; these are GW-6 refinements and want their own change.