Cap the folder indent at eight levels and test against the track's own folder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-11-03 09:56:05 -05:00
co-authored by Claude Opus 5.5
parent 7dfa7e470f
commit 7546ab992b
2 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -89,7 +89,8 @@ pub fn tracks_and_groups(app: &mut SoundApp, ui: &mut Ui) {
}
ui.painter().rect_filled(Rect::from_min_size(pos2(r.min.x + 20.0, r.min.y + 3.0), vec2(4.0, 11.0)), 0.0, rgb(color));
ui.painter().with_clip_rect(r).text(
pos2(r.min.x + 30.0 + depth as f32 * 10.0, r.center().y),
// Indent stops growing at eight levels so a deep name keeps room in the column.
pos2(r.min.x + 30.0 + depth.min(8) as f32 * 10.0, r.center().y),
Align2::LEFT_CENTER,
&name,
regular(11.5),
+4 -2
View File
@@ -127,6 +127,8 @@ fn deeply_nested_tracks_keep_indenting_past_six_folders() {
}
r.frame(vec![]);
let parent_name = r.app.engine.session().track(parent).unwrap().name.clone();
assert!(r.text_x(&child_name) > r.text_x(&parent_name), "deeply nested child is not indented under its parent");
// "Folder 1" is the child's own folder and the seventh level; "Folder 7" is the outermost.
assert_eq!(r.app.engine.session().track(parent).unwrap().name, "Folder 7");
assert!(r.text_x(&child_name) > r.text_x("Folder 1"), "deeply nested child is not indented under its own folder");
assert!(r.text_x("Folder 1") > r.text_x("Folder 2"), "each level indents further");
}