Dashboard Widget#123
Conversation
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>
|
Commits now signed |
edward-ly
left a comment
There was a problem hiding this comment.
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 likeIReloadableWidgetinstead which is basicallyIWidgetbut with additional standardized functions to implement includinggetItemsV2orgetReloadInterval. 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 { |
There was a problem hiding this comment.
Any reason why you chose 7 for the default limit?
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
And what's the purpose of going past the limit here (especially when you slice the list later)?
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
I’ve been quite busy this week. I'll try to do that by the next week. Thanks for your insights. |
|
Please see my cleaned pull request #126 |
|
Hello there, 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.) |



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 ?