nextcloud / circles

👪 Create groups with other users on a Nextcloud instance and share with them
GNU Affero General Public License v3.0
142 stars 47 forks source link

feat: Implement teams dashboard widget #1510

Closed juliushaertl closed 6 months ago

juliushaertl commented 6 months ago

Resolves #1506

Screenshot 2024-02-20 at 15 31 56

@marcoambrosini @jancborchardt I used the generated avatars as they are also used in contacts right now

Needs upstream adjustments in the dashboard API:

Follow up requiring server / API adjustments

juliushaertl commented 6 months ago

The avatar placeholders only fit for individual people, in this case it's better to just use the teams icon for each team.

We currently don't have one. Once the stretch goal https://github.com/nextcloud/circles/issues/1508 is there we can do that, but for now this is based on what we have there in the existing circles UI already:

Screenshot 2024-02-20 at 18 20 01

Also (apart from the vertical alignment you noted), the icons should be horizontally aligned below the heading icon of the widget, just like the text should be left-aligned with the heading text. Currently everything is a bit shifted to the right.

Noted, will check how we can address that generally (as the other widgets show the same issue)

juliushaertl commented 6 months ago

Quick note on the button, currently we only have options to specify a more text and a button when the list is empty (please ignore the missing icon):

empty more
Screenshot 2024-02-20 at 20 36 55 Screenshot 2024-02-20 at 20 36 33

@jancborchardt Is that enough? Otherwise we need a generic design spec on how list widgets should handle this as I'd like to keep the implementation without custom frontend implementation to account for the dashboard load performance improvements that this brings and also make sure it works on client integrations.

marcoambrosini commented 6 months ago

@juliushaertl could we use the empty content component with an add icon and an explanation of what a team is?

juliushaertl commented 6 months ago

Yes, though we need to extend the server API for that, would follow up in separate PRs then to keep things moving

Took notes in the description to collect that

ArtificialOwl commented 6 months ago

Do we need to display all circles or only the one current user is member of ? It might be heavy on resources to use getCircles() from the dashboard. This method should only be used from the contact app to display all available/visible circles.

probeCircles() is lighter and will returns all circles current user is a member of.

Now, if we display circles based on membership, we can also imagine:

The result would be that top of the list are showing circles with more recent activity

juliushaertl commented 6 months ago

Do we need to display all circles or only the one current user is member of ? It might be heavy on resources to use getCircles() from the dashboard. This method should only be used from the contact app to display all available/visible circles.

probeCircles() is lighter and will returns all circles current user is a member of.

Ah thanks, I switched that as we're only interested in the ones where a user is member

Now, if we display circles based on membership, we can also imagine:

* create a newfield in circles table to store a `'last_event'` value in database,

* update `last_event` when a new share to circle is created/updated (or any other event),

* add a way to order by `'last_event'` when calling `probeCircles()` _(DataProbe)_

The result would be that top of the list are showing circles with more recent activity

Won't get to that in this iteration, we can track this as a follow up of course as it generally makes sense I think.

juliushaertl commented 6 months ago

@ArtificialOwl Mind to double check the fixup commit for the prope adjustment? I'm also not sure what effect the details have but not requesting any also gives us enough information i think.