Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: friends panel, RPC service, notifications & fixes #3166

Merged
merged 314 commits into from
Feb 17, 2025
Merged
Changes from 1 commit
Commits
Show all changes
314 commits
Select commit Hold shift + click to select a range
7492f44
fix compatibility issues with friend requests
lorux0 Jan 23, 2025
523f691
wip request events management
lorenzo-ranciaffi Jan 24, 2025
34c1b52
Merge branch 'dev' into feat/friends/friends-panel-ui
lorenzo-ranciaffi Jan 24, 2025
91d0524
open request panel
lorenzo-ranciaffi Jan 24, 2025
90527e3
removed background button
lorenzo-ranciaffi Jan 24, 2025
3b0baba
manage identity change
lorenzo-ranciaffi Jan 24, 2025
152e83b
added profile thumbnail caching
lorenzo-ranciaffi Jan 24, 2025
5762e14
fix test
lorux0 Jan 24, 2025
b3afaaf
added panel shortcuts
lorenzo-ranciaffi Jan 24, 2025
1a907f0
fix thread safe rpc connection
lorux0 Jan 24, 2025
dd7aa3d
sidebar friend button animation
lorenzo-ranciaffi Jan 27, 2025
9b8593b
friend list user and request height change
lorenzo-ranciaffi Jan 27, 2025
77c2bff
migrate friends panel to persistent UI
lorenzo-ranciaffi Jan 28, 2025
b784c52
Merge branch 'dev' into feat/friends/friends-panel-ui
lorenzo-ranciaffi Jan 28, 2025
9f1c8c1
Merge branch 'feat/friends/protocol-updates' into feat/friends/friend…
lorenzo-ranciaffi Jan 28, 2025
f81dd19
removed profile from generic context menu component
lorenzo-ranciaffi Jan 28, 2025
49eba62
moved from Profile to new object + fix Web3Address changes
lorenzo-ranciaffi Jan 28, 2025
290e3c2
fix fetch real data & add uniques only
lorux0 Jan 28, 2025
42ce9fa
Merge branch 'refs/heads/dev' into feat/friends/friends-panel-ui
lorux0 Jan 28, 2025
235eabf
hooked friend bus events
lorenzo-ranciaffi Jan 28, 2025
e8be2b8
Add envelope icon
RominaMarchetti Jan 28, 2025
c59cad3
wip - friend panel design aligned to figma
lorenzo-ranciaffi Jan 28, 2025
0cf1199
Polish Friend entries prefabs. Update Menu icon.
RominaMarchetti Jan 28, 2025
3a13b5e
Update EmptyEntry.prefab
RominaMarchetti Jan 28, 2025
40bdd7f
Update BlockedUser.prefab
RominaMarchetti Jan 28, 2025
f4d8bfa
Update pending entries and empty state
RominaMarchetti Jan 28, 2025
21e51ff
Polish loading view
RominaMarchetti Jan 28, 2025
c2101f8
Polish Friends panel. Update close button component.
RominaMarchetti Jan 28, 2025
3c3b3d1
Fix friends icon size jump into the animations
RominaMarchetti Jan 28, 2025
fe0b958
add friendship iteractions to passport
lorux0 Jan 28, 2025
df4bea0
update protocol
lorux0 Jan 28, 2025
c85cdbc
fixed scroll entries texts + RPC timestamps
lorenzo-ranciaffi Jan 29, 2025
9bd6aea
Increase quality to friends panel images
RominaMarchetti Jan 29, 2025
0083198
improved websocket handshake concurrency
lorux0 Jan 29, 2025
535041c
implement mutual friends on passport
lorux0 Jan 29, 2025
c22154d
fix mutual pagination param
lorux0 Jan 29, 2025
764f737
rename remove friend event
lorux0 Jan 29, 2025
2367e55
handle friend removal
lorenzo-ranciaffi Jan 29, 2025
be59119
fix fetch friend requests
lorux0 Jan 29, 2025
c24dcf0
fix requests pagination
lorenzo-ranciaffi Jan 29, 2025
5bd3e17
various fixes
lorenzo-ranciaffi Jan 29, 2025
96c4e08
fix removal of peer friendship
lorux0 Jan 29, 2025
7712c15
properly refresh list
lorenzo-ranciaffi Jan 30, 2025
2b4e2e1
context menu action and request buttons actions
lorenzo-ranciaffi Jan 30, 2025
f94c2e9
passport context menu
lorenzo-ranciaffi Jan 30, 2025
bb9eab7
Update hover color for StatusWrapper and UserEntry
RominaMarchetti Jan 30, 2025
c7f0c2f
fix missing request loading state
lorenzo-ranciaffi Jan 30, 2025
4e20448
Polish FriendRequestUser container
RominaMarchetti Jan 30, 2025
fc37fa7
Merge branch 'feat/friends/friends-panel-ui' of https://github.com/de…
RominaMarchetti Jan 30, 2025
8b8864f
add profile picture in context menus
lorenzo-ranciaffi Jan 30, 2025
b2fb85c
Merge branch 'feat/friends/friends-panel-ui' of github.com:decentrala…
lorenzo-ranciaffi Jan 30, 2025
32d2756
Revert "Merge branch 'feat/friends/friends-panel-ui' of https://githu…
RominaMarchetti Jan 30, 2025
b64ea71
Merge branch 'feat/friends/friends-panel-ui' of https://github.com/de…
RominaMarchetti Jan 30, 2025
b5af266
Revert "Polish FriendRequestUser container"
RominaMarchetti Jan 30, 2025
5c9770a
Polish user container for requests
RominaMarchetti Jan 30, 2025
2bfd68a
removed report function from context menus
lorenzo-ranciaffi Jan 30, 2025
e6c7026
PolishSendContainer
RominaMarchetti Jan 30, 2025
a04cbca
Merge branch 'feat/friends/friends-panel-ui' of https://github.com/de…
RominaMarchetti Jan 30, 2025
715d2b2
make thumbnail cache always return a sprite
lorenzo-ranciaffi Jan 30, 2025
3288365
Polish CancelContainer
RominaMarchetti Jan 30, 2025
8186331
wip - context menu user profile refactor
lorenzo-ranciaffi Jan 30, 2025
9a63cdd
Merge branch 'feat/friends/friends-panel-ui' of github.com:decentrala…
lorenzo-ranciaffi Jan 30, 2025
d61461f
Polish ReceivedContainer UI
RominaMarchetti Jan 30, 2025
100f0bb
Merge branch 'feat/friends/friends-panel-ui' of https://github.com/de…
RominaMarchetti Jan 30, 2025
973da85
Polish UI for request cancelled, rejected and accepted feedback
RominaMarchetti Jan 30, 2025
86052b0
Add animations to add link modal
RominaMarchetti Jan 30, 2025
255a5e2
Fix mutual friends masks
RominaMarchetti Jan 30, 2025
b7832a6
Polish passport friend button UI
RominaMarchetti Jan 30, 2025
20fed2a
Update copies
RominaMarchetti Jan 30, 2025
a62a1a2
reconnect rpc on logout & login
lorux0 Jan 30, 2025
b2ac1a5
add support to fetch user position by id
lorux0 Jan 30, 2025
ba98ee5
Decrease passport and add link modal overlay transparency
RominaMarchetti Jan 30, 2025
42879d4
refactor identity change with new cache event
lorenzo-ranciaffi Jan 31, 2025
4d44d29
fix copy info toasts
lorenzo-ranciaffi Jan 31, 2025
f16cc13
wip refactor userprofile context menu component buttons
lorenzo-ranciaffi Jan 31, 2025
36e8959
fix requests context menui
lorenzo-ranciaffi Jan 31, 2025
5130245
fix context menu interactions
lorenzo-ranciaffi Jan 31, 2025
3e048f7
Add rays and particles texture to friend request accepted
RominaMarchetti Jan 31, 2025
ace8733
Merge branch 'feat/friends/friends-panel-ui' of https://github.com/de…
RominaMarchetti Jan 31, 2025
d288f17
fix typo
lorenzo-ranciaffi Jan 31, 2025
c629ee3
fix passport & friend request converted to popup
lorux0 Jan 31, 2025
fa94c2c
revert passport soft mask
lorux0 Jan 31, 2025
c3e9fcc
fix friend request date format
lorux0 Jan 31, 2025
7aa59bb
minor date format refactor
lorux0 Jan 31, 2025
87dcbaa
hide user blocking behind feature flag
lorenzo-ranciaffi Jan 31, 2025
32548de
fix user hashtag on friend request
lorux0 Jan 31, 2025
4915354
fix cancel confirmation user representation
lorux0 Jan 31, 2025
7b1ed04
Update Passport section buttons
RominaMarchetti Jan 31, 2025
e613149
Fix photos panel, character and badges preview
RominaMarchetti Jan 31, 2025
6ec09c2
implement rays animation on friend request operation & rollback frien…
lorux0 Jan 31, 2025
564723a
refresh friendship status on passport when comeback from friend request
lorux0 Jan 31, 2025
3bfd92c
Mutual friends mascara moved to image asset as child
RominaMarchetti Jan 31, 2025
afec1e9
Merge branch 'feat/friends/friends-panel-ui' of https://github.com/de…
RominaMarchetti Jan 31, 2025
00928b5
avoid showing interactions from passport for our user
lorux0 Jan 31, 2025
6948741
Update EquippedItem_PassportField.prefab
RominaMarchetti Jan 31, 2025
f465301
Merge branch 'feat/friends/friends-panel-ui' of https://github.com/de…
RominaMarchetti Jan 31, 2025
434801e
Update photos section empty state copy
RominaMarchetti Jan 31, 2025
709f811
show/hide chat via bus
lorenzo-ranciaffi Feb 3, 2025
601004a
removed duplicated assembly reference
lorenzo-ranciaffi Feb 3, 2025
d97acba
fix async methods suffix
lorenzo-ranciaffi Feb 3, 2025
760875b
Merge branch 'refs/heads/dev' into feat/friends/friends-panel-ui
lorux0 Feb 3, 2025
52bb7c9
add online status logic
lorenzo-ranciaffi Feb 3, 2025
7a405ab
fix fast jump in button
lorenzo-ranciaffi Feb 3, 2025
4e31e7d
fix requests tab badge position
lorenzo-ranciaffi Feb 3, 2025
4f7a8c3
Merge branch 'feat/friends/friends-panel-ui' into feat/friends/friend…
lorenzo-ranciaffi Feb 3, 2025
537f30b
fix missing notifications (reverted web3 address comparison)
lorux0 Feb 3, 2025
737a4fd
fix reconnect rpc
lorux0 Feb 3, 2025
5234029
wip - notifications
lorenzo-ranciaffi Feb 4, 2025
6cd476d
fix reject friend request
lorux0 Feb 4, 2025
536454c
Merge branch 'feat/friends/friends-panel-ui' into feat/friends/friend…
lorenzo-ranciaffi Feb 4, 2025
9aea523
avoid friends notification parsing if flag is disabled
lorenzo-ranciaffi Feb 4, 2025
c22b071
add app arg for friend api url
lorux0 Feb 4, 2025
25351a5
fix request counter on user cancelling the request
lorux0 Feb 4, 2025
cda1ac0
added toast notifications
lorenzo-ranciaffi Feb 5, 2025
70ba825
Merge branch 'refs/heads/feat/friends/friends-panel-ui' into feat/fri…
lorux0 Feb 5, 2025
42c5641
Merge branch 'refs/heads/dev' into feat/friends/friends-panel-ui
lorux0 Feb 5, 2025
fa804e5
fix disconnect rpc on identity clear
lorux0 Feb 5, 2025
ccf8999
Merge branch 'refs/heads/feat/friends/friends-panel-ui' into feat/fri…
lorux0 Feb 5, 2025
a8bec32
add feature flag
lorux0 Feb 5, 2025
4a4c7bb
notifications menu entry
lorenzo-ranciaffi Feb 5, 2025
9dd7732
Merge branch 'refs/heads/feat/friends/friends-panel-ui-with-online-st…
lorux0 Feb 5, 2025
8d74cd7
align notification events models
lorenzo-ranciaffi Feb 5, 2025
393f484
add rpc prod url
lorux0 Feb 5, 2025
3e18aa3
keep streams open in case of errors
lorux0 Feb 5, 2025
96f9fc4
add comms-adapter program arg
lorux0 Feb 5, 2025
22fcdc4
fix user profile thumbnail render
lorenzo-ranciaffi Feb 6, 2025
5a4cc6d
untested - friend online status push notifications
lorenzo-ranciaffi Feb 6, 2025
20af603
implement passport context menu friendship operations
lorux0 Feb 6, 2025
a6ffd69
fix push notifications
lorenzo-ranciaffi Feb 6, 2025
f29c04c
fix friend list buttons on status update
lorenzo-ranciaffi Feb 6, 2025
205ff78
fix friend service crash
lorux0 Feb 6, 2025
3215feb
Merge branch 'refs/heads/dev' into feat/friends/friends-panel-ui
lorux0 Feb 6, 2025
68252db
fix jumpin coordinates
lorux0 Feb 6, 2025
7ff7413
fix nre on app quit
lorux0 Feb 6, 2025
eb08c45
moved from array to list to manage entry buttons
lorenzo-ranciaffi Feb 7, 2025
1d40b45
fix friends notification
lorenzo-ranciaffi Feb 7, 2025
9df6593
fix notification badge text size
lorenzo-ranciaffi Feb 7, 2025
466b633
fix notification name length problem
lorenzo-ranciaffi Feb 7, 2025
8d4978e
fix friend panel closure using the sidebar button
lorenzo-ranciaffi Feb 7, 2025
39b7807
fix broken chat messages after closing friend panel
lorenzo-ranciaffi Feb 7, 2025
17a0497
fix chat interactions on friend panel show
lorenzo-ranciaffi Feb 7, 2025
29d62e7
fix sorting
lorenzo-ranciaffi Feb 7, 2025
bc405f7
use of thumbnail cache on friend requests
lorux0 Feb 7, 2025
a6dfe50
stream reconnection attempts
lorux0 Feb 7, 2025
318ab50
use double collection in friend list if connectivity is enabled
lorenzo-ranciaffi Feb 10, 2025
38ea03a
reset scroll position on close/open
lorenzo-ranciaffi Feb 10, 2025
27d12c6
add top padding in panel sections scroll view
lorenzo-ranciaffi Feb 10, 2025
edcdc60
fix notification text
lorenzo-ranciaffi Feb 10, 2025
e365fea
reset scroll position after accepting/rejecting request
lorenzo-ranciaffi Feb 10, 2025
3535cd4
fix requests reset position
lorenzo-ranciaffi Feb 10, 2025
cc4412d
clean online status dictionary on friendship deletion
lorenzo-ranciaffi Feb 10, 2025
b31ae1f
rpc friend service minor cleanup
lorux0 Feb 10, 2025
f816e20
fix double fetch for empty 2nd collection
lorenzo-ranciaffi Feb 10, 2025
4ae7815
fix main ui error when friends is disabled
lorux0 Feb 10, 2025
c1d30a3
reenable friends on editor
lorux0 Feb 10, 2025
2a59b81
moved friend panel into main ui container
lorenzo-ranciaffi Feb 10, 2025
9a5bcc1
change page sizes & increased transport buffer size
lorux0 Feb 10, 2025
f766418
Merge branch 'dev' into feat/friends/friends-panel-ui
lorenzo-ranciaffi Feb 10, 2025
a2bf394
Merge branch 'dev' into feat/friends/friends-panel-ui
lorenzo-ranciaffi Feb 10, 2025
37c403a
fix friend panel position
lorenzo-ranciaffi Feb 10, 2025
05fcfb0
implement unfriend confirmation popup & moved friend request prefabs …
lorux0 Feb 10, 2025
4fb9773
add missing essentials addressable assets
lorux0 Feb 10, 2025
4f3c4cd
fix notification click
lorenzo-ranciaffi Feb 11, 2025
a230a2f
filter duplicate connectivity updates and handle it in a dedicated class
lorenzo-ranciaffi Feb 11, 2025
ad2ae99
fix friend panel position with resolutions
lorenzo-ranciaffi Feb 11, 2025
e817ab4
fix first click on status wrapper
lorenzo-ranciaffi Feb 11, 2025
822b2a5
fix pagination issue
lorenzo-ranciaffi Feb 11, 2025
f4b4cef
Merge branch 'dev' into feat/friends/friends-panel-ui
lorenzo-ranciaffi Feb 11, 2025
2e100ab
removed unused test data
lorenzo-ranciaffi Feb 11, 2025
5408760
Merge branch 'dev' into feat/friends/friends-panel-ui
lorenzo-ranciaffi Feb 11, 2025
b2bc8dd
Merge branch 'dev' into feat/friends/friends-panel-ui
lorenzo-ranciaffi Feb 11, 2025
2273ef3
Update notifications indicator in SidebarUI
RominaMarchetti Feb 11, 2025
5eb4955
Merge branch 'feat/friends/friends-panel-ui' of https://github.com/de…
RominaMarchetti Feb 11, 2025
20ef737
added missing async suffix
lorenzo-ranciaffi Feb 11, 2025
e1c2df5
Merge branch 'feat/friends/friends-panel-ui' of https://github.com/de…
RominaMarchetti Feb 11, 2025
bbb2566
friend panel can be closed by clicking outside - fix scrolling on the…
lorenzo-ranciaffi Feb 11, 2025
920ac7e
abort websocket on disposal
lorux0 Feb 11, 2025
71985f6
add jump in function in passport
lorenzo-ranciaffi Feb 11, 2025
fae20d8
added logs for rpc operations and web socket
lorux0 Feb 11, 2025
ee1246d
missing usages of profile images from cache
lorux0 Feb 11, 2025
e1e751a
disabled connectivity status on passport
lorux0 Feb 11, 2025
4dd9f66
fix passport mutual friend thumbnails
lorux0 Feb 11, 2025
a968d1e
fix friend request mutual thumbnails
lorux0 Feb 11, 2025
ce359b6
Fix passport friends button styles
RominaMarchetti Feb 11, 2025
d7b5319
Increase menu buttonright margin in every entry
RominaMarchetti Feb 11, 2025
2734a56
Update MenuVerticalIcn.png.meta
RominaMarchetti Feb 11, 2025
ee11b32
Increase menu button right margin for friend request
RominaMarchetti Feb 11, 2025
9f1e084
Polish friend push notification style
RominaMarchetti Feb 11, 2025
d2db3f0
Update vertical position, background color transparency, and close bu…
RominaMarchetti Feb 11, 2025
04db216
Update status wrapper's container heigh
RominaMarchetti Feb 11, 2025
8154119
Polish UserProfile UI
RominaMarchetti Feb 11, 2025
7e75d37
Capitalize C in 'Controls' tooltip
RominaMarchetti Feb 11, 2025
cb8fb4a
fix rpc logs
lorux0 Feb 11, 2025
f93cde7
make sidebar widgets mutually exclusive
lorenzo-ranciaffi Feb 12, 2025
cac454d
add sounds
lorenzo-ranciaffi Feb 12, 2025
adacfce
add verified icons
lorenzo-ranciaffi Feb 12, 2025
6c23b88
added missing sounds in context menu components
lorenzo-ranciaffi Feb 12, 2025
f078de4
fix notification badge indicator
lorenzo-ranciaffi Feb 12, 2025
33f9318
Merge branch 'dev' into feat/friends/friends-panel-ui
lorenzo-ranciaffi Feb 12, 2025
7e06eab
removed debug logs
lorenzo-ranciaffi Feb 12, 2025
70c4472
Merge branch 'dev' into feat/friends/friends-panel-ui
lorenzo-ranciaffi Feb 12, 2025
16062ac
migrated online status cache to address instead of friend profile
lorenzo-ranciaffi Feb 12, 2025
429e4f6
moved chat bus controller to friend assembly
lorenzo-ranciaffi Feb 12, 2025
a7d67a9
fix context menu position priority
lorenzo-ranciaffi Feb 12, 2025
e5bad8b
fix friend sortings
lorenzo-ranciaffi Feb 12, 2025
d1d33e7
fix timestamp format in notifications
lorenzo-ranciaffi Feb 12, 2025
7b9975e
poll connectivity status to archipelago api
lorux0 Feb 12, 2025
d0de002
prewarm friend list
lorux0 Feb 12, 2025
43f44c9
fix relogin rpc connection flow
lorux0 Feb 12, 2025
fa06bf4
dont show request confirmation on negative actions
lorux0 Feb 12, 2025
6b1ecef
close friend request on clicking any place of screen
lorux0 Feb 12, 2025
bb09e6c
add sounds to friend request confirmation
lorux0 Feb 12, 2025
0217505
unification of data reset and prewarm on identity change
lorux0 Feb 12, 2025
7287454
add audio to panel open/close and context menu
lorenzo-ranciaffi Feb 13, 2025
ad49b25
format code
lorenzo-ranciaffi Feb 13, 2025
94b8b0c
fix passport buttons positioning
lorenzo-ranciaffi Feb 13, 2025
8d8afbe
add sound on user coming online
lorenzo-ranciaffi Feb 13, 2025
9edd4c2
log failed profile fetching in passport
lorenzo-ranciaffi Feb 13, 2025
6460ab4
fix failing thumbnail loading
lorenzo-ranciaffi Feb 13, 2025
9bffaa2
fix friendship status after any operation on passport
lorux0 Feb 13, 2025
4d6dcfa
count whole page as fetched elements
lorenzo-ranciaffi Feb 13, 2025
3636cb5
add logs to friend notifications
lorux0 Feb 13, 2025
086a8fe
fix looplist item count + small data fetching refactor
lorenzo-ranciaffi Feb 13, 2025
9cbc40f
Merge branch 'feat/friends/friends-panel-ui' of github.com:decentrala…
lorenzo-ranciaffi Feb 13, 2025
047a57e
friend request non interactable on Cancel and Received
lorenzo-ranciaffi Feb 13, 2025
67947bc
prevent adding "already online" users to offline list
lorenzo-ranciaffi Feb 13, 2025
267d4c1
fix nre during loading when receiving connectivity update
lorux0 Feb 13, 2025
1072de1
Merge branch 'dev' into feat/friends/friends-panel-ui
lorenzo-ranciaffi Feb 13, 2025
e5bf434
disabled archipelago polling for connectivity status
lorux0 Feb 13, 2025
3be0cf4
fix nre when missing identity
lorux0 Feb 13, 2025
ce27653
fix online friend push notification
lorenzo-ranciaffi Feb 14, 2025
0bdb547
Merge branch 'dev' into feat/friends/friends-panel-ui
lorenzo-ranciaffi Feb 14, 2025
1f7e336
fix test
lorenzo-ranciaffi Feb 14, 2025
0178357
removed logs in rpc and websocket
lorux0 Feb 14, 2025
97b8df1
remove archipelago polling
lorux0 Feb 14, 2025
3e8d6bc
increased push notification duration
lorenzo-ranciaffi Feb 14, 2025
1682a03
changed friend panel opening/closing sounds
lorenzo-ranciaffi Feb 14, 2025
88dbfba
removed logs on friend notifications
lorux0 Feb 14, 2025
99a98a3
added AWAY status management + removed duplicated status update warni…
lorenzo-ranciaffi Feb 14, 2025
fd2caa6
Merge branch 'dev' into feat/friends/friends-panel-ui
lorenzo-ranciaffi Feb 14, 2025
ae4cf78
add sounds to friend new notification
lorenzo-ranciaffi Feb 14, 2025
ab488fc
changed connectivity status cache name
lorenzo-ranciaffi Feb 14, 2025
781ba72
removed unused commented code
lorenzo-ranciaffi Feb 14, 2025
5e535bd
cache comparisons for sorters
lorenzo-ranciaffi Feb 17, 2025
fe8f646
removed unused stuff
lorenzo-ranciaffi Feb 17, 2025
9f550d3
support foldable empty collections
lorenzo-ranciaffi Feb 17, 2025
5715fc2
Merge branch 'dev' into feat/friends/friends-panel-ui
lorenzo-ranciaffi Feb 17, 2025
fbcff03
prevent user duplication on accepting request
lorenzo-ranciaffi Feb 17, 2025
06876e4
Merge branch 'refs/heads/dev' into feat/friends/friends-panel-ui
lorux0 Feb 17, 2025
da45d67
update protocol
lorux0 Feb 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
moved actions to abstract methods + fix looplist logic + fix requests…
… panel
lorenzo-ranciaffi committed Jan 17, 2025
commit 9475252cb510e2de552921a80dca531faa33af92
Original file line number Diff line number Diff line change
@@ -18,9 +18,6 @@ public abstract class FriendPanelRequestManager<T> : IDisposable where T : Frien
private readonly int emptyElementIndex;
private readonly int userElementIndex;

private Action<T>? elementCustomizer;
private Func<int, Profile> firstCollectionAccessor;
private Func<int, Profile> secondCollectionAccessor;
private int pageNumber = 0;
private int totalFetched = 0;

@@ -53,20 +50,16 @@ protected FriendPanelRequestManager(IFriendsService friendsService,
this.userElementIndex = userElementIndex;
}

protected void SetElementCustomizer(Action<T> customizer) { elementCustomizer = customizer; }

protected void ConfigureAccessors(Func<int, Profile> firstAccessor,
Func<int, Profile> secondAccessor)
{
this.firstCollectionAccessor = firstAccessor;
this.secondCollectionAccessor = secondAccessor;
}

public abstract void Dispose();

protected abstract int GetFirstCollectionCount();
protected abstract int GetSecondCollectionCount();

protected abstract Profile GetFirstCollectionElement(int index);
protected abstract Profile GetSecondCollectionElement(int index);

protected virtual void CustomiseElement(T element) { }

public LoopListViewItem2 GetLoopListItemByIndex(LoopListView2 loopListView, int index)
{
LoopListViewItem2 listItem = null;
@@ -91,8 +84,8 @@ public LoopListViewItem2 GetLoopListItemByIndex(LoopListView2 loopListView, int
{
listItem = loopListView.NewListViewItem(loopListView.ItemPrefabDataList[userElementIndex].mItemPrefab.name);
T friendListUserView = listItem.GetComponent<T>();
friendListUserView.Configure(firstCollectionAccessor(index - 1));
elementCustomizer?.Invoke(friendListUserView);
friendListUserView.Configure(GetFirstCollectionElement(index - 1));
CustomiseElement(friendListUserView);
friendListUserView.RemoveMainButtonClickListeners();
friendListUserView.MainButtonClicked += profile => FriendElementClicked?.Invoke(profile);
}
@@ -113,8 +106,8 @@ public LoopListViewItem2 GetLoopListItemByIndex(LoopListView2 loopListView, int
{
listItem = loopListView.NewListViewItem(loopListView.ItemPrefabDataList[userElementIndex].mItemPrefab.name);
T friendListUserView = listItem.GetComponent<T>();
friendListUserView.Configure(secondCollectionAccessor(index - onlineFriendMarker - 2));
elementCustomizer?.Invoke(friendListUserView);
friendListUserView.Configure(GetSecondCollectionElement(index - onlineFriendMarker - 2));
CustomiseElement(friendListUserView);
friendListUserView.RemoveMainButtonClickListeners();
friendListUserView.MainButtonClicked += profile => FriendElementClicked?.Invoke(profile);
}
Original file line number Diff line number Diff line change
@@ -96,7 +96,6 @@ protected virtual async UniTaskVoid Init(CancellationToken ct)
if (friendListPagedRequestManager.HasElements)
{
view.LoopList.SetListItemCount(friendListPagedRequestManager.GetElementsNumber(), false);
view.LoopList.RefreshAllShownItem();
friendListPagedRequestManager.FirstFolderClicked += FolderClicked;
friendListPagedRequestManager.SecondFolderClicked += FolderClicked;
}
Original file line number Diff line number Diff line change
@@ -15,40 +15,41 @@ public class FriendListPagedRequestManager : FriendPanelRequestManager<FriendLis
private List<Profile> onlineFriends = new ();
private List<Profile> offlineFriends = new ();

public event Action<Profile> JumpInClicked;
public event Action<Profile> ContextMenuClicked;
public event Action<Profile>? JumpInClicked;
public event Action<Profile>? ContextMenuClicked;

public FriendListPagedRequestManager(IFriendsService friendsService,
IFriendsEventBus friendEventBus,
int pageSize) : base(friendsService, friendEventBus, pageSize, FriendPanelStatus.ONLINE, FriendPanelStatus.OFFLINE, STATUS_ELEMENT_INDEX, EMPTY_ELEMENT_INDEX, USER_ELEMENT_INDEX)
{
ConfigureAccessors(GetOnlineProfile, GetOfflineProfile);
SetElementCustomizer(friendListUserView =>
{
friendListUserView.ContextMenuButton.onClick.RemoveAllListeners();
friendListUserView.ContextMenuButton.onClick.AddListener(() => ContextMenuClicked?.Invoke(friendListUserView.UserProfile));
friendListUserView.JumpInButton.onClick.RemoveAllListeners();
friendListUserView.JumpInButton.onClick.AddListener(() => JumpInClicked?.Invoke(friendListUserView.UserProfile));
});
}

private Profile GetOnlineProfile(int index) =>
onlineFriends[index];

private Profile GetOfflineProfile(int index) =>
offlineFriends[index];
}

public override void Dispose()
{

}

protected override Profile GetFirstCollectionElement(int index) =>
onlineFriends[index];

protected override Profile GetSecondCollectionElement(int index) =>
offlineFriends[index];

protected override int GetFirstCollectionCount() =>
onlineFriends.Count;

protected override int GetSecondCollectionCount() =>
offlineFriends.Count;

protected override void CustomiseElement(FriendListUserView element)
{
element.ContextMenuButton.onClick.RemoveAllListeners();
element.ContextMenuButton.onClick.AddListener(() => ContextMenuClicked?.Invoke(element.UserProfile));
element.JumpInButton.onClick.RemoveAllListeners();
element.JumpInButton.onClick.AddListener(() => JumpInClicked?.Invoke(element.UserProfile));
}

protected async override UniTask FetchInitialData(CancellationToken ct)
{
// PaginatedFriendsResult result = await friendsService.GetFriendsAsync(pageNumber, pageSize, ct);
Original file line number Diff line number Diff line change
@@ -17,39 +17,39 @@ public class RequestsRequestManager : FriendPanelRequestManager<RequestUserView>
private List<FriendRequest> receivedRequests = new ();
private List<FriendRequest> sentRequests = new ();

public event Action<Profile> ContextMenuClicked;
public event Action<Profile>? ContextMenuClicked;

public RequestsRequestManager(IFriendsService friendsService, IFriendsEventBus friendEventBus, int pageSize, IProfileCache profileCache)
: base(friendsService, friendEventBus, pageSize, FriendPanelStatus.ONLINE, FriendPanelStatus.OFFLINE, STATUS_ELEMENT_INDEX, EMPTY_ELEMENT_INDEX, USER_ELEMENT_INDEX)
: base(friendsService, friendEventBus, pageSize, FriendPanelStatus.RECEIVED, FriendPanelStatus.SENT, STATUS_ELEMENT_INDEX, EMPTY_ELEMENT_INDEX, USER_ELEMENT_INDEX)
{
this.profileCache = profileCache;
ConfigureAccessors(GetReceivedRequest, GetSentRequest);
SetElementCustomizer(requestUserView =>
{
requestUserView.ContextMenuButton.onClick.RemoveAllListeners();
requestUserView.ContextMenuButton.onClick.AddListener(() => ContextMenuClicked?.Invoke(requestUserView.UserProfile));
//TODO (Lorenzo): set the request date
// requestUserView.RequestDate = ???
});
}

public override void Dispose()
{
throw new NotImplementedException();
}

private Profile GetReceivedRequest(int index) =>
profileCache.Get(receivedRequests[index].From);

private Profile GetSentRequest(int index) =>
profileCache.Get(sentRequests[index].To);
}

protected override int GetFirstCollectionCount() =>
receivedRequests.Count;

protected override int GetSecondCollectionCount() =>
sentRequests.Count;

protected override Profile GetFirstCollectionElement(int index) =>
profileCache.Get(receivedRequests[index].From);

protected override Profile GetSecondCollectionElement(int index) =>
profileCache.Get(sentRequests[index].To);

protected override void CustomiseElement(RequestUserView element)
{
element.ContextMenuButton.onClick.RemoveAllListeners();
element.ContextMenuButton.onClick.AddListener(() => ContextMenuClicked?.Invoke(element.UserProfile));
//TODO (Lorenzo): set the request date
// requestUserView.RequestDate = ???
}

protected async override UniTask FetchInitialData(CancellationToken ct)
{

Original file line number Diff line number Diff line change
@@ -40,9 +40,7 @@ protected override async UniTaskVoid Init(CancellationToken ct)
friendListInitCts = friendListInitCts.SafeRestart();
await friendListPagedRequestManager.Init(ct);

view.SetEmptyState(!friendListPagedRequestManager.HasElements);
view.SetLoadingState(false);
view.SetScrollView(friendListPagedRequestManager.HasElements);

view.LoopList.SetListItemCount(friendListPagedRequestManager.GetElementsNumber(), false);
view.LoopList.RefreshAllShownItem();