#pragma once
// Pure I_FOLDERDEPTH -> FolderTree walk; REAPER reads stay in shell/view.
// See src/core/view/CLAUDE.md.

#include <string>
#include <vector>

#include "core/view/view_mode_model.h"

namespace reasampler::view {

// One track's contribution, read from REAPER in arrange order. folderDepth is
// I_FOLDERDEPTH verbatim: 0 normal, 1 opens a folder, <0 closes |depth| levels.
struct TrackFolderEntry {
    std::string guid;
    int         folderDepth = 0;
};

// Assigns each node its parentGuid (empty = top level) and isParent. Total: a
// malformed depth stream (close deeper than the stack) clamps rather than faults.
FolderTree buildFolderTree(const std::vector<TrackFolderEntry>& entries);

} // namespace reasampler::view
