Skip to content

feat(dashboard): implement Zulip dashboard widget#126

Merged
edward-ly merged 1 commit into
nextcloud:mainfrom
Thomas-git:dashboard-squashed
Jun 14, 2026
Merged

feat(dashboard): implement Zulip dashboard widget#126
edward-ly merged 1 commit into
nextcloud:mainfrom
Thomas-git:dashboard-squashed

Conversation

@Thomas-git

Copy link
Copy Markdown

Add a dashboard widget showing recent or unread Zulip messages.

  • Register ZulipDashboardWidget implementing IReloadableWidget and IButtonWidget for standardised item fetching (getItemsV2), auto-reload every 60s (getReloadInterval), and a "show more" button (getWidgetButtons) pointing to /#feed or /#inbox depending on mode
  • Add getRecentMessages() and getUnreadMessages() to ZulipAPIService; both share a cleanMessageContent() helper that converts Zulip emoji spans (emoji-1f603 class) to Unicode and strips remaining HTML tags
  • Expose a "Show only unread messages" toggle in PersonalSettings, stored as dashboard_show_unread; the widget adapts its empty-state copy and button link accordingly
  • Add Vue dashboard component with polling fallback, avatar display, channel/topic subtitle, and direct-message support
  • Register the widget in Application bootstrap and add webpack entry

Assisted-by: Claude Sonnet 4.6 noreply@anthropic.com

🤖 AI (if applicable)

  • The content of this PR was partly generated using AI

@Thomas-git

Copy link
Copy Markdown
Author

This PR improve on my previous #123

Here is a dashboard widget screenshot
zulip
Dashboard with unread messages
zulip2
Params screen
zulip3

Please tell me if I need to add or modify something.

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

Nice work with the unread messages feature and the IReloadableWidget! Just a few more improvements to go:

  1. Along with IReloadableWidget, it might be a good idea to implement IIconWidget as well. Its getIconUrl method would allow you to import the Zulip icon without the need for any external CSS such as css/dashboard.css.
  2. Implementing IReloadableWidget also means that the src/views/Dashboard.vue component is no longer necessary, along with src/dashboard.js and the changes to webpack.js. As a consequence, the widget's load method can be empty too.
  3. Also make sure in the getItemsV2 method to check that a Zulip account $isConnected before fetching messages, perhaps.
  4. (Optional) Small point, but we typically prefix private class methods with a _ for added clarity.
  5. And please resolve the errors found by PHP-CS-Fixer and Psalm in the CI checks as well.

And FYI, if you want to clean up your PR without creating a new one, a combination of git rebase and git push -f would allow you to do just that.

Comment thread lib/Controller/ZulipAPIController.php
@Thomas-git Thomas-git force-pushed the dashboard-squashed branch from 024d861 to 4957c6b Compare June 12, 2026 11:14
@Thomas-git

Copy link
Copy Markdown
Author

I think your requested changes are done. Code seems cleaner by the way.

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

It sure does! I can take care of the remaining CI checks and rebase the branch from here. Thanks a lot for your contribution!

Actually, would you mind running composer run cs:fix and commit the result to resolve the last failing check, and rebase the branch so that the branch starts from the tip of main? I don't think I have the ability to modify your branch.

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

Copy link
Copy Markdown
Author

Sure, I will do it. But composer run cs:fix don't work on my setup, so I need to figure why first.

@Thomas-git Thomas-git force-pushed the dashboard-squashed branch 2 times, most recently from 531e18e to b5a0692 Compare June 13, 2026 09:53
Add a dashboard widget showing recent or unread Zulip messages.

- Register ZulipDashboardWidget implementing IReloadableWidget,
  IButtonWidget, and IIconWidget for standardised server-side item
  fetching (getItemsV2), auto-reload every 60s (getReloadInterval),
  a "show more" button (getWidgetButtons) pointing to /#feed or /#inbox
  depending on mode, and a theme-aware icon (getIconUrl)
- Add getRecentMessages() and getUnreadMessages() to ZulipAPIService;
  both share a _cleanMessageContent() helper that converts Zulip emoji
  spans (emoji-1f603 class) to Unicode and strips remaining HTML tags
- Expose a "Show only unread messages" toggle in PersonalSettings,
  stored as dashboard_show_unread; the widget adapts its empty-state
  copy and button link accordingly
- Register the widget in Application bootstrap and appinfo/info.xml

Assisted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Thomas Ritou <thomas@ritou.me>
@Thomas-git Thomas-git force-pushed the dashboard-squashed branch from b5a0692 to bb54541 Compare June 13, 2026 09:58
@Thomas-git

Copy link
Copy Markdown
Author

Done!

@edward-ly edward-ly merged commit 4567f8b into nextcloud:main Jun 14, 2026
18 checks passed
@edward-ly

Copy link
Copy Markdown
Collaborator

Perfect, thanks again!

@Thomas-git

Copy link
Copy Markdown
Author

Any chance you push the new version to Nextcloud apps soon ?

@edward-ly

Copy link
Copy Markdown
Collaborator

Any chance you push the new version to Nextcloud apps soon ?

Sure, I'll see if I have time by the end of this week.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dashboard

2 participants