Commit Graph

445 Commits

Author SHA1 Message Date
692362131e Add animation when mention pill appears (or a new message arrives) 2022-03-21 14:31:51 +09:00
11b050b66b Add slight fade when hovering ChannelListItems 2022-03-21 14:28:14 +09:00
9eda2f2df1 Remove box surrounding close button 2022-03-21 14:25:29 +09:00
f922a6b556 Rename renaming button/pill classes 2022-03-21 14:15:22 +09:00
812343b410 Merge branch 'master' into new-chat-channel-control 2022-03-21 14:14:02 +09:00
f3702fbefb Pass correct params to UpdateableAvatar ctor in ChannelListItem 2022-03-19 22:20:17 +00:00
ba5a43b526 Rename ControlItem -> ChannelListItem and associated classes 2022-03-19 21:49:14 +00:00
653bb47dd5 Use UpdateableAvatar and remove redundant ControlItemAvatar class 2022-03-19 21:36:11 +00:00
5373c3066f Use OsuAnimatedButton as base for ControlItemClose 2022-03-19 21:23:32 +00:00
a293e0c766 Remove redundant ControlItemText class 2022-03-19 16:44:58 +00:00
dfda093f4b Rename icon creation method 2022-03-18 14:03:52 +09:00
5d940ded09 Fix incorrect usage of nullable in ControlItemMention 2022-03-18 13:59:03 +09:00
d1fd14e287 Add missing nullable 2022-03-18 13:57:36 +09:00
b21fa78cbf Move dependencies out of fields to BDL args where possible 2022-03-16 21:55:36 +01:00
603527d72d Fix potential crash when highlighting chat messages
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()
```
2022-03-16 18:38:06 +09:00
e38d9eafa0 Use BindTarget instead of caching for ControlItem unread flow 2022-03-15 22:37:15 +00:00
49b74d7867 Use BindTarget instead of caching for ControlItem mentions bindable flow 2022-03-15 22:33:36 +00:00
481b8fe80b Use Orange1 for ControlItemMention background colour 2022-03-15 22:22:32 +00:00
7621e779fa Move ControlItem Action assignments into BDL 2022-03-15 22:19:58 +00:00
73a0373b4e Code quality fixes 2022-03-14 21:56:56 +00:00
ec61b88ec2 Adjust ControlItem padding 2022-03-14 21:39:57 +00:00
75958bf270 Refactor ControlItemText to use bindable flow for unread state 2022-03-14 21:32:30 +00:00
b01a809d55 Refactor ControlItemMention to use bindable flow 2022-03-14 21:26:33 +00:00
1f0f6990f0 Use ColourProvider.Content1 for ControlItemText colour 2022-03-14 21:16:28 +00:00
3aa343b987 Use OsuColour.YellowLight for ControlItemMention background 2022-03-14 21:14:33 +00:00
9621ef9437 Use OsuColour.Red1 for ControlItemClose hover colour 2022-03-14 21:10:39 +00:00
e91af664ef Adjust ControlItemAvatar placeholder animation and colour 2022-03-14 20:37:54 +00:00
12472593cc Mark required dependencies as non-nullable 2022-03-14 20:14:04 +00:00
c0d82dfb41 Code quality fixes 2022-03-14 19:42:55 +00:00
39c30516d0 Implement ChannelControlItem for new chat design
Adds new component `ChannelControlItem` and it's child components to be
used as the clickable control in the new chat sidebar for joined
channels.

Has public properties `HasUnread` and `MentionCount` to control the
display of the channel having unread messages or mentions of the user.

Channel select/join requests are exposed via `OnRequestSelect` and
`OnRequestLeave` events respectively which should be handled by a parent
component.

Requires a cached `Bindable<Channel>` instance to be managed by a parent
component.

Requires a cached `OveralayColourScheme` instance to be provided by a
parent component.
2022-03-14 18:55:27 +00:00
53c57661c7 Move implementtaion detail to inline comment 2022-03-11 18:34:22 +03:00
5b70139b33 Avoid running message highlight processing more than once 2022-03-11 18:32:49 +03:00
cc87563d57 Merge branch 'master' into chat-mention-highlight 2022-03-11 17:51:22 +03:00
d07e3101ea Improve message highlight handling in DrawableChannel 2022-03-10 23:07:15 +03:00
46f2db1712 Move ChannelListingItem spacing into item so input is always handled by an item in the list
Without this change, there would be a couple of pixels between each list
item where nothing would be hovered. This is a pretty annoying UX which
we should be avoiding we possible.
2022-03-10 15:58:57 +09:00
1a187d4dec Add animation to checkbox when joning/leaving a channel 2022-03-10 15:54:42 +09:00
b25c37ce62 Instantiate highlight background container on animation
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.
2022-03-10 03:49:42 +03:00
cf9671cafb Increase highlight delay to 1500ms 2022-03-10 02:50:15 +03:00
80c0df6af5 Scroll chat line to channel center
We may eventually want that encapsulated within `ScrollIntoView`, as it
would also come in handy for `GameplayLeaderboard`.
2022-03-10 02:50:15 +03:00
93cf93943f Schedule chat line highlight after children to handle non-loaded lines 2022-03-10 02:48:33 +03:00
2d8983383a Revert newMessagesArrived changes and always schedule highlight
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.
2022-03-10 01:11:27 +03:00
b67f9269f9 Remove NewChat namespace 2022-03-09 18:13:56 +00:00
5e0882df8d Simplify message highlighting transforms 2022-03-08 04:00:11 +03:00
d74064b94b Use Equals instead of reference equality operator 2022-03-08 03:56:27 +03:00
7f47be4680 Refactor message highlighting logic to rely on a Channel data bindable 2022-03-08 03:19:37 +03:00
30b38345aa Add ability to highlight chat lines 2022-03-07 05:08:36 +03:00
a13a087f5d Add xmldoc to trackNewContent to explain its purpose 2022-03-06 23:51:27 +03:00
9ec0e74813 Move scrolling to UpdateAfterChildren to avoid scheduling
At least that's what I believe "let FillFlow update to new size" means.
2022-03-06 23:50:58 +03:00
9bc1f3f014 Further refactor and simplify ChannelScrollContainer 2022-03-06 23:34:12 +03:00
5b3ffb12b7 Refactor channel scrolling container to handle manual scrolls resiliently 2022-03-05 23:27:07 +03:00