[GH-ISSUE #492] Show user avatars in User list #181

Open
opened 2026-02-27 08:15:43 +03:00 by kerem · 6 comments
Owner

Originally created by @pixelrazor on GitHub (Mar 22, 2023).
Original GitHub issue: https://github.com/lldap/lldap/issues/492

Can leverage the avatar component from #407

Originally created by @pixelrazor on GitHub (Mar 22, 2023). Original GitHub issue: https://github.com/lldap/lldap/issues/492 Can leverage the avatar component from #407
Author
Owner

@nitnelave commented on GitHub (Mar 23, 2023):

Some things to think about:

  • Caching (to avoid re-fetching all the users' avatars every time)
  • Keyed events in the avatar agent, with the username? We don't want to re-fetch all the users' avatars anytime a single one changes.
<!-- gh-comment-id:1481009393 --> @nitnelave commented on GitHub (Mar 23, 2023): Some things to think about: - Caching (to avoid re-fetching all the users' avatars every time) - Keyed events in the avatar agent, with the username? We don't want to re-fetch all the users' avatars anytime a single one changes.
Author
Owner

@pixelrazor commented on GitHub (Mar 23, 2023):

With rrespect those concerns, I'm leaning towards the ffollowing solution:

  • return avatar in GetUserDetail
  • Storing the user detail list in global state (whether that be Context or we end up using a lib like yewdux)
<!-- gh-comment-id:1481264107 --> @pixelrazor commented on GitHub (Mar 23, 2023): With rrespect those concerns, I'm leaning towards the ffollowing solution: - return avatar in GetUserDetail - Storing the user detail list in global state (whether that be Context or we end up using a lib like yewdux)
Author
Owner

@nitnelave commented on GitHub (Mar 23, 2023):

We could store the avatar in the agent: actually, you could move the request from the avatar display to the agent, and the agent would call you back with the avatar, either from cache or from asking the server.

<!-- gh-comment-id:1481485637 --> @nitnelave commented on GitHub (Mar 23, 2023): We could store the avatar in the agent: actually, you could move the request from the avatar display to the agent, and the agent would call you back with the avatar, either from cache or from asking the server.
Author
Owner

@pixelrazor commented on GitHub (Mar 23, 2023):

Well this is going to be multiple avatars, multiple users. I have an initial impl i'll throw up as a draft that loads them after page/table load - while t his is the simpler approach with less changes, i also like it because the initial table and isn't blocked on waiting for all the avatars (a potentially big payload if it's included in the main get of all the users). Anytime you navigate away from the users page, it will refresh when you go back to it anyways, so i don't see a big benefit from adding the complexity here personally.

If we can really justify the larger changes, i'd probably nuke the agent (the Context agents were actually removed, and context/hooks are the preferred way now) and write a component to handle that state and provide it through context or from some third party state lib

<!-- gh-comment-id:1481787835 --> @pixelrazor commented on GitHub (Mar 23, 2023): Well this is going to be multiple avatars, multiple users. I have an initial impl i'll throw up as a draft that loads them after page/table load - while t his is the simpler approach with less changes, i also like it because the initial table and isn't blocked on waiting for all the avatars (a potentially big payload if it's included in the main get of all the users). Anytime you navigate away from the users page, it will refresh when you go back to it anyways, so i don't see a big benefit from adding the complexity here personally. If we can really justify the larger changes, i'd probably nuke the agent (the Context agents were actually removed, and context/hooks are the preferred way now) and write a component to handle that state and provide it through context or from some third party state lib
Author
Owner

@nitnelave commented on GitHub (Mar 23, 2023):

Right, but the agent can have a hash map of the avatars, queried by username.
I was thinking that the user table would just instantiate the avatar components, which would request the avatar from the agent (maybe with some queueing/grouping if it makes sense? In a future update). The Avatar component could then use the suspense API from yew to render a placeholder, and then get called back by the agent when the image is received.
That's also not blocking the user table.

<!-- gh-comment-id:1481911046 --> @nitnelave commented on GitHub (Mar 23, 2023): Right, but the agent can have a hash map of the avatars, queried by username. I was thinking that the user table would just instantiate the avatar components, which would request the avatar from the agent (maybe with some queueing/grouping if it makes sense? In a future update). The Avatar component could then use the suspense API from yew to render a placeholder, and then get called back by the agent when the image is received. That's also not blocking the user table.
Author
Owner

@pixelrazor commented on GitHub (Mar 23, 2023):

I think i'm convinced enough. Also of note, agents are now called Workers in yew-agent 0.2.0

<!-- gh-comment-id:1482021611 --> @pixelrazor commented on GitHub (Mar 23, 2023): I think i'm convinced enough. Also of note, agents are now called Workers in yew-agent 0.2.0
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/lldap-lldap#181
No description provided.