feat(view): D4 Design View action family + reapply-on-open wiring

Register toggle/activate/tag/untag/show-both actions driving the D2
shell and D3 model; reapply saved active mode on project load via a
persist load-signal seam. Shared guidString helper; pure nextModeId
unit-tested.
This commit is contained in:
2026-07-22 21:46:58 -04:00
parent 322581227c
commit ae41cad4f5
12 changed files with 418 additions and 16 deletions
+11
View File
@@ -313,4 +313,15 @@ TrackPlan makeParkPlan(const std::string& guid, int fxCount);
// restore-contract invariant directly.
TrackPlan makeRestorePlan(const std::string& guid, const TrackSnapshot& snap);
// The next mode id in the registry's ordinal order, cycling past `currentModeId`
// and wrapping to the first mode after the last (Arrange -> Design -> Arrange with
// the two seed modes; the same cycle scales to N modes with no call-site change).
// This is the pure decision behind the "toggle active mode" action: the shell reads
// the model's active mode, asks for the next one, and applies it.
// * empty registry -> "" (nothing to cycle to)
// * currentModeId not present -> the first mode's id (a sane home to jump to)
// Exposed as a free function (not a model member) so it is unit-testable against a
// bare ModeRegistry without a full ViewModeModel.
std::string nextModeId(const ModeRegistry& modes, const std::string& currentModeId);
} // namespace reasampler