-
Notifications
You must be signed in to change notification settings - Fork 25
feat: show avatars in shares view #767
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds avatar support to the shares view by introducing a new composable for loading avatars, extending configuration to control avatar concurrency, and updating components to render user avatars.
- Extended the config schema and default options with an
avatarssetting. - Added a
useLoadAvatarscomposable with a request queue for fetching user photos. - Updated
ResourceTable.vue,UserAvatar.vue, andOcAvatars.vueto render avatars via slots.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/web-pkg/src/composables/piniaStores/config/types.ts | Added avatars to the Zod config schema |
| packages/web-pkg/src/composables/piniaStores/config/config.ts | Set default avatars concurrency in options |
| packages/web-pkg/src/composables/index.ts | Exported the new avatars composable |
| packages/web-pkg/src/composables/avatars/useLoadAvatars.ts | New composable to enqueue and fetch avatars |
| packages/web-pkg/src/composables/avatars/index.ts | Re-export of useLoadAvatars |
| packages/web-pkg/src/components/FilesList/ResourceTable.vue | Integrated <oc-avatars> slots and UserAvatar |
| packages/web-pkg/src/components/Avatars/UserAvatar.vue | Refactored to use useLoadAvatars instead of raw fetch |
| packages/design-system/src/components/OcAvatars/OcAvatars.vue | Added a named slot for custom avatar rendering |
Comments suppressed due to low confidence (3)
packages/web-pkg/src/composables/avatars/useLoadAvatars.ts:1
- [nitpick] New composable
useLoadAvatarsis not covered by tests. Consider adding unit tests to verify queue behavior and error handling.
import PQueue from 'p-queue'
packages/web-pkg/src/components/FilesList/ResourceTable.vue:736
- The computed property
shareTypereferences an undefined variableshareType. You likely intended to return the importedShareTypesor remove this redundant computed prop.
shareType() {
packages/web-pkg/src/composables/avatars/useLoadAvatars.ts:10
- If
configStore.options.concurrentRequests.avatarsis undefined,PQueuewill default to unbounded concurrency. Consider providing a fallback value (e.g.|| 1) to avoid accidental overload.
const queue = new PQueue({ concurrency: configStore.options.concurrentRequests.avatars })
| <template #userAvatars> | ||
| <user-avatar | ||
| v-for="avatar in getSharedByAvatarItems(item)" | ||
| :key="avatar.username" | ||
| :user-id="avatar.id" | ||
| :user-name="avatar.displayName" | ||
| :width="30" | ||
| /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kulmann
I can't think of a smarter solution here, that won't be blocking (await)
ccbbdd5 to
e469cb9
Compare
kulmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shared with two users and a group, the group is not stacked with the two users, but instead on the side. Also, something is off with the borders. The first item has no border, the stacked items do have a border. I've put another window below and zoomed in a bit, so that it's easier to see.
As soon as I add a third user and the +1 appears, the group is not standalone anymore.
packages/web-app-files/src/components/SideBar/ActivitiesPanel.vue
Outdated
Show resolved
Hide resolved
packages/web-app-files/src/components/SideBar/ActivitiesPanel.vue
Outdated
Show resolved
Hide resolved
packages/web-app-files/src/components/SideBar/ActivitiesPanel.vue
Outdated
Show resolved
Hide resolved
Co-authored-by: Benedikt Kulmann <b.kulmann@opencloud.eu>
kulmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it 😍 Especially positively surprised by the inline avatars in the activities panel 🥰
|
this is a bug |




Description
Related Issue
How Has This Been Tested?
Types of changes