fix(view): park untagged leaves in non-Arrange modes; refresh TCP/MCP on apply

planToggle now enumerates all leaves in the FolderTree instead of only tagged
membership entries, so untagged (Arrange-member) tracks park in Design and
restore in Arrange. applyMode calls TrackList_AdjustWindows + UpdateArrange so
changes render immediately. Correct the stale "tagged-only" invariant comments.
This commit is contained in:
2026-07-23 04:59:50 -04:00
parent 60add4afc7
commit 4bf394b89c
5 changed files with 130 additions and 22 deletions
+11 -7
View File
@@ -232,8 +232,9 @@ struct TrackPlan {
// The plan for a whole toggle to a target mode: which tracks to park, and which to
// restore from their snapshots. Parents and show-both leaves never appear here —
// they are derived-visible and never parked (visibility is answered separately by
// visibleTracks). Untagged tracks never appear either (the tool owns only what it
// tagged).
// visibleTracks). Untagged LEAVES DO appear: an untagged leaf is an Arrange member,
// so it parks in every non-Arrange mode and restores in Arrange — the mode system
// manages all leaves, not only tagged ones.
struct TogglePlan {
std::vector<TrackPlan> park; // inactive leaves -> parked (fixed zeros)
std::vector<TrackPlan> restore; // active leaves returning -> snapshot values
@@ -278,11 +279,14 @@ public:
std::set<std::string> visibleTracks(const FolderTree& tree,
const std::string& modeId) const;
// Plans a toggle to `targetMode` against the current tree. Inactive tagged
// leaves (not show-both, not derived-visible-only) are parked with fixed zeros;
// leaves that become active AND have a stored snapshot are restored from it.
// Parents, show-both leaves, the master, and untagged tracks are never parked.
// Unknown/stale membership GUIDs absent from the tree are ignored (prune-safe).
// Plans a toggle to `targetMode` by enumerating EVERY leaf in the supplied tree.
// A leaf inactive in the target mode — tagged into another mode, or untagged and
// the target isn't Arrange — is parked with fixed zeros; a leaf that becomes
// active AND has a stored snapshot is restored from it. Parents (visibility-only)
// and show-both leaves (always visible) are never parked; the master is not in
// the tree. Untagged leaves ARE managed: they are Arrange members, so they park
// in non-Arrange modes and restore in Arrange. Tree membership is the enumeration
// source, so stale membership GUIDs absent from the tree are naturally ignored.
//
// Note: park plans emitted here have an empty fxOffline vector. The D2 shell
// expands per-FX offline writes using TrackFX_GetCount — the pure model has no