diff --git a/osu.Game.Tests/Visual/Online/TestSceneCommentsContainer.cs b/osu.Game.Tests/Visual/Online/TestSceneCommentsContainer.cs index acc3c9b8b4..eb805b27cb 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneCommentsContainer.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneCommentsContainer.cs @@ -17,6 +17,7 @@ using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays.Comments; +using osu.Game.Overlays.Comments.Buttons; namespace osu.Game.Tests.Visual.Online { @@ -58,6 +59,11 @@ namespace osu.Game.Tests.Visual.Online AddStep("show comments", () => commentsContainer.ShowComments(CommentableType.Beatmapset, 123)); AddUntilStep("show more button hidden", () => commentsContainer.ChildrenOfType().Single().Alpha == 0); + + if (withPinned) + AddAssert("pinned comment replies collapsed", () => commentsContainer.ChildrenOfType().First().Expanded.Value, () => Is.False); + else + AddAssert("first comment replies expanded", () => commentsContainer.ChildrenOfType().First().Expanded.Value, () => Is.True); } [TestCase(false)] @@ -302,7 +308,7 @@ namespace osu.Game.Tests.Visual.Online bundle.Comments.Add(new Comment { Id = 20, - Message = "Reply to pinned comment", + Message = "Reply to pinned comment initially hidden", LegacyName = "AbandonedUser", CreatedAt = DateTimeOffset.Now, VotesCount = 0, diff --git a/osu.Game/Overlays/Comments/DrawableComment.cs b/osu.Game/Overlays/Comments/DrawableComment.cs index afd4b96c68..296f90872e 100644 --- a/osu.Game/Overlays/Comments/DrawableComment.cs +++ b/osu.Game/Overlays/Comments/DrawableComment.cs @@ -47,7 +47,7 @@ namespace osu.Game.Overlays.Comments public readonly BindableList Replies = new BindableList(); - private readonly BindableBool childrenExpanded = new BindableBool(true); + private readonly BindableBool childrenExpanded; private int currentPage; @@ -92,6 +92,8 @@ namespace osu.Game.Overlays.Comments { Comment = comment; Meta = meta; + + childrenExpanded = new BindableBool(!comment.Pinned); } [BackgroundDependencyLoader]