Skip to content

Dashboard Widget#123

Closed
Thomas-git wants to merge 5 commits into
nextcloud:mainfrom
Thomas-git:main
Closed

Dashboard Widget#123
Thomas-git wants to merge 5 commits into
nextcloud:mainfrom
Thomas-git:main

Conversation

@Thomas-git

Copy link
Copy Markdown

This is a dashboard widget like the one for Mattermost. It respond to my own issue #120
It was made with Claude help and tested successfully on my own NextCloud and Zulip hosting.
Is there anything to add about translations ? Maybe I should bump version ?

Signed-off-by: Thomas Ritou <thomas@ritou.me>
Signed-off-by: Thomas Ritou <thomas@ritou.me>
Signed-off-by: Thomas Ritou <thomas@ritou.me>
When Topic is empty (general chat), dont show it.

Signed-off-by: Thomas Ritou <thomas@ritou.me>
@Thomas-git

Copy link
Copy Markdown
Author

Commits now signed

@edward-ly edward-ly linked an issue Jun 2, 2026 that may be closed by this pull request

@edward-ly edward-ly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there anything to add about translations ? Maybe I should bump version ?

Thanks for your contribution! No need to worry about the actual l10n translations; those will be handled automatically. And I will take care of bumping the version later, so don't worry about that either.

A few questions and changes before this can be merged:

  • Generally, "fixup" commits can be squashed together with the original commit. That will make the commit history look cleaner/nicer.
  • Please use the Conventional Commits specification for commit messages.
  • AI-assisted commits should include an Assisted-by: trailer according to our new AI policy.
  • Optional but nice to have: include screenshots of all front-end changes in the PR description (taken from your dev environment).
  • Also optional: instead of implementing IWidget, we may want to implement something like IReloadableWidget instead which is basically IWidget but with additional standardized functions to implement including getItemsV2 or getReloadInterval. This can be done in a separate PR.

Let us know if you need any assistance or have any questions!

#[NoAdminRequired]
#[FrontpageRoute(verb: 'GET', url: '/feed')]
public function getFeed(int $limit = 10): DataResponse {
public function getFeed(int $limit = 7): DataResponse {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Any reason why you chose 7 for the default limit?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Only 6 items are shown. If I fetch 6, there is no "see more button". If I fetch 7 and there is 7 or more items, button will be shown if needed.

$result = $this->request($userId, 'messages', [
'anchor' => 'newest',
'num_before' => $limit,
'num_before' => $limit * 3,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

And what's the purpose of going past the limit here (especially when you slice the list later)?

@Thomas-git Thomas-git Jun 5, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That’s because I choose to filter user own messages to show only useful messages.
I tried to ask Zulip to filter user own messages but it seems not to be possible.

'num_before' => $limit * 3,
'num_after' => 0,
'narrow' => '[]',
'client_gravatar' => 'true',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Have you tried adding the 'apply_markdown' => 'false', parameter? This will return Markdown instead of HTML for the message content which may avoid the need to post-process the HTML or emojis. Also, topic names should always be non-empty as long as allow_empty_topic_name defaults to false, so you may not need to add placeholders either.

@Thomas-git Thomas-git Jun 5, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I tried this approach at first but markdown lakes smiley processing informations. And it seems better to show smiley than to strip them completely.
About allow_empty_topic_name, maybe I misunderstood API, but empty topic do exist, that's "general chat". We want to see those messages, but showing "general chat" in the UI later is not needed.

@Thomas-git

Copy link
Copy Markdown
Author

Let us know if you need any assistance or have any questions!

I’ve been quite busy this week. I'll try to do that by the next week. Thanks for your insights.

@Thomas-git

Thomas-git commented Jun 11, 2026

Copy link
Copy Markdown
Author

I’m working on it right now.
Here is a dashboard widget screenshot
zulip
Dashboard with unread messages
zulip2
Params screen
zulip3

There is now choices between unread and recent messages.

@Thomas-git

Copy link
Copy Markdown
Author

Please see my cleaned pull request #126

@github-actions

Copy link
Copy Markdown

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.)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard

2 participants