Skip to content

feat(dashboard): add ITeamWidget and team scope to the dashboard API - #66521

Open
stediefan wants to merge 3 commits into
masterfrom
feat/3050-team-widgets
Open

stediefan wants to merge 3 commits into
masterfrom
feat/3050-team-widgets

Conversation

@stediefan

@stediefan stediefan commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add widget funcionality to teams. This extends the existing widget API to allow context aware widgets (user scope or team specific scope).
Assisted-by: Copilot:gpt-6.1-sol

Related

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Comment thread lib/public/Dashboard/ITeamWidget.php Resolved
@stediefan
stediefan force-pushed the feat/3050-team-widgets branch 2 times, most recently from b19b1b0 to 9220d5e Compare November 24, 2026 13:28
@stediefan stediefan moved this from Backlog to In review in 👥 Teams Nov 24, 2026
@stediefan
stediefan force-pushed the feat/3050-team-widgets branch 2 times, most recently from bd861ae to 23715fa Compare November 25, 2026 12:51
@stediefan

stediefan commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

@artonge i had a closer look here and merged the widget components together. should now have less duplications.
also added a way to provide sub teams for future dashboards including the items of sub teams.

@stediefan
stediefan force-pushed the feat/3050-team-widgets branch from 23715fa to 579f4a9 Compare November 25, 2026 13:05
@stediefan
stediefan marked this pull request as ready for review November 25, 2026 13:12
@stediefan
stediefan requested review from a team and provokateurin as code owners November 25, 2026 13:12
@stediefan
stediefan requested review from kristian-zendato, leftybournes, marcoambrosini and susnux and removed request for a team November 25, 2026 13:12
@stediefan stediefan added 3. to review Waiting for reviews enhancement labels Nov 25, 2026
@stediefan
stediefan force-pushed the feat/3050-team-widgets branch from 579f4a9 to e8f95de Compare November 25, 2026 14:18
@artonge

artonge commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

also added a way to provide sub teams

Let's remove that for now, as the concept hasn't been finalised yet.

@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@stediefan

Copy link
Copy Markdown
Contributor Author

also added a way to provide sub teams

Let's remove that for now, as the concept hasn't been finalised yet.

Done👍

@artonge
artonge requested review from julien-nc and juliusknorr and removed request for leftybournes, marcoambrosini, provokateurin and susnux November 26, 2026 10:52
Comment thread vite.config.ts Resolved
Comment thread apps/dashboard/src/dashboardApi.ts Resolved
@stediefan
stediefan force-pushed the feat/3050-team-widgets branch from 579f4a9 to 20c1355 Compare November 26, 2026 12:32
Comment thread vite.config.ts Resolved
Comment thread apps/dashboard/src/DashboardApp.vue Resolved
@stediefan
stediefan force-pushed the feat/3050-team-widgets branch 3 times, most recently from 37ac01e to 17058da Compare November 27, 2026 09:50
stediefan and others added 2 commits November 30, 2026 09:31
Add ITeamManager::isMemberOfTeam, reusing the member-only Circles probe, and
authorize team membership before resolving team-capable widgets while
preserving the personal dashboard paths. Isolate applicability, metadata and
item failures per provider: log a warning and omit only the broken widget from
the response.

Move the team dashboard UI into the dashboard app as an embeddable
`dashboard-team` widget. It shares widget loading, headings, picker tiles and
item rendering with the personal dashboard.

Assisted-by: Copilot:gpt-6.1-sol
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Stefan Dietrich <stefan.dietrich@dataport.de>
Only team-scoped widget listings need to check team membership.

Co-authored-by: Louis <louis@chmn.me>
Signed-off-by: Stefan D. <st.dietrich93@gmail.com>
Assisted-by: Copilot:gpt-6.2-sol
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@stediefan
stediefan force-pushed the feat/3050-team-widgets branch from 17058da to b8ee8cf Compare November 30, 2026 08:43
@artonge

artonge commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Can you share a example implementation of the new ITeamWidget API?

@stediefan
stediefan force-pushed the feat/3050-team-widgets branch from b8ee8cf to 260ba2b Compare November 30, 2026 13:18
@stediefan

Copy link
Copy Markdown
Contributor Author

Can you share a example implementation of the new ITeamWidget API?

https://github.com/nextcloud/collectives/pull/2932/changes#diff-56d53cffb6b1013946668055768dac97af53a2715071f6af8bde362357af04c5

I used collectives for local development and have my current iteration in the linked draft

@juliusknorr juliusknorr left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for pushing this, the membership check and the tests look good already. A few comments inside, mostly about the new OCP interface and the frontend embed 👍

Not a blocker: each team page load and each tab refocus checks team membership on both requests (/widgets and /widget-items) and calls isEnabledForTeam() on every team widget twice. That's fine for now, but it should stay cheap, so the docblock asking implementations not to fetch items is important

* Implementations must enforce the user's access to the team's resources.
*
* @since 36.0.0
*/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you specify in the docblock what "enforce access" means here? The controller already checks team membership, so is membership enough, or must the implementation check each resource (e.g. a collective shared with the team but with tighter permissions)? Implementers will copy whatever this says.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docblock does now specify what enforce means - is it clear enough?

* `richObject` is a {@link TeamDashboardOptions} object; the host owns the
* layout persistence and is notified when the dashboard becomes unavailable.
*/
registerWidget(type, (el, { accessible, richObject }) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to go through the reference widget registry here? richObject is meant to be serialisable reference data, and here it carries loadLayout/saveLayout/onUnavailable callbacks, so we're using the registry as a cross-app mount API. Should we rather export a small mount function (e.g. mountTeamDashboard(el, options)) that hosts call directly? That would also let the options be typed properly instead of checked by hand at runtime.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 the simpler mount function seems like a good approach - feels clenaer. mountTeamDashboard(el, options) returns an unmount function and is typed now

Keep team layout and widget requests under the same reload lifecycle so
an unavailable dashboard does not leave stale widgets or an open picker.

Co-authored-by: Louis <louis@chmn.me>
Assisted-by: Copilot:gpt-6.2-sol
Signed-off-by: Stefan D. <st.dietrich93@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Stefan Dietrich <stefan.dietrich@dataport.de>
@stediefan
stediefan force-pushed the feat/3050-team-widgets branch from 260ba2b to 86e3831 Compare December 1, 2026 19:27
@stediefan
stediefan enabled auto-merge December 2, 2026 07:03

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

4 participants