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
+12
View File
@@ -123,6 +123,18 @@ TrackPlan makeRestorePlan(const std::string& guid, const TrackSnapshot& snap) {
return p;
}
std::string nextModeId(const ModeRegistry& modes, const std::string& currentModeId) {
const std::vector<Mode>& all = modes.all();
if (all.empty()) return {}; // nothing to cycle to
for (std::size_t i = 0; i < all.size(); ++i) {
if (all[i].id == currentModeId)
return all[(i + 1) % all.size()].id; // wrap past the last
}
// Active mode not in the registry (stale/unknown) — jump to the first mode as a
// sane home rather than returning "".
return all.front().id;
}
// ---------------------------------------------------------------------------
// ViewModeModel
// ---------------------------------------------------------------------------