Refactors `ChatLine` component to use more sensible override properties
and layout using grid container. Moves creation of username component
into its own method to simplify BDL.
Updates padding of base `DrawableChannel` flow padding.
Removes usage of `ChatOverlayDrawableChannel` since it's overrides are
no longer needed.
Updates usage of `StandAloneChatDisplay` to use new override properties
of `DrawableChannel`.
Moves `DaySeparator` chat component to it's own file and update it to
match new chat design. Makes use of several virtual attributes that can
be overridden to update spacing and layout in other usage contexts.
Remove redundant usage of `ChatOverlayDaySeparator`, since the new
design is now part of the base class.
Create `StandAloneDaySeparator` to use in `StandAloneChatDisplay` which
overrides attributes to match correct spacing and layout for its design.
Ensure that `DrawableChannel.CreateDaySeparator` returns type of
`DaySeparator` instead of `Drawable`.
Updates the `DaySeparator` component to have separately settable colours
for the text and the lines.
Updates existing overrides of the `DaySeparator` to use the new colour
setter.
Create new `ChatOverlayDrawableChannel` with adjusted spacing and new
`DaySeparator` colours.
Test failed locally in `TestPublicChannelMention`. This test seems to
specify that the same message may arrive twice with the same ID, so
rather than overthinking this one I propose we just use `FirstOrDefault`.
```csharp
TearDown : System.AggregateException : One or more errors occurred.
(Sequence contains more than one matching element)
----> System.InvalidOperationException : Sequence contains more than
one matching element
--TearDown
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean
includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout,
CancellationToken cancellationToken)
at osu.Framework.Extensions.TaskExtensions.WaitSafely(Task task)
at osu.Framework.Testing.TestScene.checkForErrors()
--InvalidOperationException
at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException()
at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable`1 source,
Func`2 predicate, Boolean& found)
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1
source, Func`2 predicate)
at
osu.Game.Overlays.Chat.DrawableChannel.<processMessageHighlighting>b__14_0()
in
/Users/dean/Projects/osu/osu.Game/Overlays/Chat/DrawableChannel.cs:line
102
at osu.Framework.Threading.ScheduledDelegate.RunTaskInternal()
```
Also removes the necessity of scheduling as it actually never worked as
intended, `Scheduler` will still update even when the chat line is
masked away, and the animation will never be held anyways.
The new duration of the animation should be enough for long scrolls
either way.
In the case a message arrives and the chat overlay is hidden, clicking
on the mention notification will not work as the `HighlightedMessage`
bindable callback will execute before the scheduled `newMessagesArrived`
logic (which was hanging since the message arrived until the chat
overlay became open because of the notification).
Simplify things by always scheduling the `HighlightedMessage` bindable
callback.
The callbacks are scheduled to the API thread, but hooked up in BDL
load. This causes a potential case of cross-thread collection
enumeration.
I've tested and it seems like the schedule logic should be fine for
short term. Longer term, we probably want to re-think how this works so
background operations aren't performed on the `DrawableChannel` in the
first place (chat shouldn't have an overhead like this when not
visible).
Closes#11231.