Skip to content

feat(chat): offer a notification when a reply is ready - #697

Open
WSHAPER wants to merge 5 commits into
nextcloud:mainfrom
WSHAPER:feat/chat-notify-when-ready
Open

WSHAPER wants to merge 5 commits into
nextcloud:mainfrom
WSHAPER:feat/chat-notify-when-ready

Conversation

@WSHAPER

@WSHAPER WSHAPER commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #695

Browser notifications need the background push click fix from nextcloud/notifications#3477, implemented in nextcloud/notifications#3478.

Assisted-by: opencode:glm-5.3

Fixes nextcloud#695

Assisted-by: opencode:glm-5.3
Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 36 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f125e7f4-46f8-42a8-be7a-826d19b984dc
📥 Commits

Reviewing files that changed from the base of the PR and between f2fa07d and 20c12b8.

📒 Files selected for processing: 2
  • lib/Service/NotificationService.php
  • src/components/ChattyLLM/InputArea.vue
📝 Walkthrough

Chat generation tasks now produce chat-specific success or failure notifications with links to the conversation. The chat interface adds a per-generation notification toggle and browser permission handling. The assistant form also uses a URL session ID to select the chat task type.

Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to f2fa0

On supported installations without the background-push click fix, a notification may arrive without reopening the chat when clicked after the page is closed. Ensure the fix is available or provide a fallback before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.83% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 7 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly summarizes the main change: offering notifications when a chat reply is ready.
Description check Passed The description is related to the changeset because it identifies the tracked issue and the required browser notification background-click fix.
Linked Issues check Passed The changes satisfy the coding requirements in #695. InputArea shows a dismissible banner after 12 seconds and provides a per-reply notification toggle. ChattyLLMInputForm tracks active and resume…
Out of Scope Changes check Passed The changes remain within #695. Backend notification handling supports per-reply success and failure delivery and conversation navigation. Frontend changes implement the banner, delayed display, permi…
Full details: Docstring Coverage

Explanation

Docstring coverage is 20.83% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 7 files. (2 skipped: 2 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@WSHAPER
WSHAPER requested a review from julien-nc October 13, 2026 10:55

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

I think the added UI element should be more discreet. On a system that will execute the task in a short time, it feels weird to see this big note card appear.

Maybe only adding a button on the right, next to the submit/audio one, would be enough. We would loose the "you can close the page" explanation text but we would keep the "click this if you want to be notified when the assistant produced a response" as the HTML title of the button.
Wdyt?

Comment thread lib/Service/NotificationService.php Outdated
Comment thread lib/Service/NotificationService.php Outdated
@WSHAPER

WSHAPER commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor Author

I think the added UI element should be more discreet. On a system that will execute the task in a short time, it feels weird to see this big note card appear.

Maybe only adding a button on the right, next to the submit/audio one, would be enough. We would loose the "you can close the page" explanation text but we would keep the "click this if you want to be notified when the assistant produced a response" as the HTML title of the button. Wdyt?

The prominent banner is deliberate, it follows how Claude does it: the opt-in is one shot and easy to miss when it hides behind a tooltip, and the "you can close the page" part is half of what the issue (Fu) asks for, imo. A bare button with a title attribute would drop that entirely.

But I would agree with the "weird on a quick action" part (from what I assume you mean), so I'd lean towards gating the visibility conditionally. Only issue on my part is a possible scope creep, doing it "properly" would involve context_agent additions.

I'd be up to gating it behind a set 10-15s timer, if that helps. Achieves a comparable compromise with less coupling.

wdyt @julien-nc

@julien-nc

Copy link
Copy Markdown
Member

I'd be up to gating it behind a set 10-15s timer

Sounds good. But then, one cannot immediately enable notification for a task after submitting the message. Fair enough.

The note card label could be improved IMO.
A reply is generated in the background, you can close the assistant. Do you want to be notified when the reply is ready?
Wdyt?

Assisted-by: opencode:glm-5.3
Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>
@WSHAPER

WSHAPER commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

I'd be up to gating it behind a set 10-15s timer

Sounds good. But then, one cannot immediately enable notification for a task after submitting the message. Fair enough.

The note card label could be improved IMO. A reply is generated in the background, you can close the assistant. Do you want to be notified when the reply is ready? Wdyt?

I'd keep the current label though: it's one line by design, the longer variant wraps and doubles the card height, and the Notify action next to it is self-explanatory.

Timer gate it is, will push it shortly. The tradeoff after submitting is fine by me.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
tests/unit/Notification/NotifierTest.php (1)

99-150: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add tests for success and failure with a null target.

The current tests cover only chat subjects. A test with target => null for success would expose the issue at Line 74 of Notifier.php.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 32a9facd-ba9c-4965-a2fc-0902bd98cf50
📥 Commits

Reviewing files that changed from the base of the PR and between d5a4cf0 and 5a01e2b.

📒 Files selected for processing (10)
  • lib/Listener/TaskFailedListener.php
  • lib/Listener/TaskSuccessfulListener.php
  • lib/Notification/Notifier.php
  • lib/Service/NotificationService.php
  • src/components/AssistantTextProcessingForm.vue
  • src/components/ChattyLLM/ChattyLLMInputForm.vue
  • src/components/ChattyLLM/InputArea.vue
  • src/utils.js
  • tests/unit/Notification/NotifierTest.php
  • tests/unit/Service/NotificationServiceTest.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread lib/Notification/Notifier.php
Comment thread src/components/ChattyLLM/ChattyLLMInputForm.vue
Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>
Assisted-by: opencode:glm-5.3
Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Require the background-push click fix for chat notifications. · Notifier.php:413-455

lib/Notification/Notifier.php:413-455
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Require the background-push click fix for chat notifications.

NotificationService::sendNotification() emits chat_success and chat_failure for chat tasks. Notifier assigns the target to both the notification link and the IAction::TYPE_WEB action. When the page is closed, opening that target depends on the Nextcloud notifications background-push click handler.

Nextcloud 35 is supported, but its stable-35 backport of fix #3478 is not merged. A supported deployment can therefore deliver the notification while failing to open the chat. Require a notifications release containing #3478, or add an equivalent local fallback before relying on this behavior.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0cc06753-dd46-4bef-8730-510b293d2f74
📥 Commits

Reviewing files that changed from the base of the PR and between 5a01e2b and f2fa07d.

📒 Files selected for processing (4)
  • lib/Notification/Notifier.php
  • src/components/ChattyLLM/ChattyLLMInputForm.vue
  • src/components/ChattyLLM/InputArea.vue
  • tests/unit/Notification/NotifierTest.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/unit/Notification/NotifierTest.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@WSHAPER

WSHAPER commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Require the background-push click fix for chat notifications. · Notifier.php:413-455

lib/Notification/Notifier.php:413-455
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Require the background-push click fix for chat notifications.
NotificationService::sendNotification() emits chat_success and chat_failure for chat tasks. Notifier assigns the target to both the notification link and the IAction::TYPE_WEB action. When the page is closed, opening that target depends on the Nextcloud notifications background-push click handler.
Nextcloud 35 is supported, but its stable-35 backport of fix #3478 is not merged. A supported deployment can therefore deliver the notification while failing to open the chat. Require a notifications release containing #3478, or add an equivalent local fallback before relying on this behavior.

ℹ️ Review info

Background (closed-tab) notification clicks fully resolve once nextcloud/notifications#3478 ships

Comment thread src/components/ChattyLLM/InputArea.vue Outdated
thinkingText: t('assistant', 'Processing…'),
scheduledText: t('assistant', 'Waiting…'),
submitBtnAriaText: t('assistant', 'Submit'),
notifyBannerText: t('assistant', 'You can close this page. Want to be notified when the reply is ready?'),

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.

Suggested change
notifyBannerText: t('assistant', 'You can close this page. Want to be notified when the reply is ready?'),
notifyBannerText: t('assistant', 'You can close this page. Do you want to be notified when the reply is ready?'),

Comment thread src/components/ChattyLLM/InputArea.vue Outdated
Comment on lines +194 to +195
notifyBtnLabel: t('assistant', 'Notify'),
notifyingBtnLabel: t('assistant', 'Notifying'),

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.

Suggested change
notifyBtnLabel: t('assistant', 'Notify'),
notifyingBtnLabel: t('assistant', 'Notifying'),
notifyBtnLabel: t('assistant', 'Get notified'),
notifyingBtnLabel: t('assistant', 'Notifying'),

Let's try to stay consistent with what the generic form does. We could add an icon to the button.

  • The icon could be BellOutlineIcon when the notification is disabled and BellRingOutlineIcon when it's on.
  • The button html title could change from No notification to You will be notified.
  • The label can be Get notified at all times IMO
  • Not sure about using the aria-pressed prop. We could conditionally change the variant or just keep secondary and just be happy with the conditional icon

Wdyt?

Comment thread lib/Service/NotificationService.php Outdated
$params = [
'appId' => $task->getAppId(),
'id' => $task->getId(),
'inputs' => $task->getInput(),

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.

We should omit the task input in the notification when it's a chat task. The input can be huge here and we don't use it to render the notification.
This could make the notification system crash if the input is larger than the related column in the notifications table.

- align the notify banner button with the generic task form
- omit the task input from chat notifications
- wrap the notify banner text instead of truncating it

Assisted-by: opencode:glm-5.3
Signed-off-by: WSHAPER <42714629+WSHAPER@users.noreply.github.com>

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

  • Test issue, simple fix: do not assert that a notification will have the task input

Otherwise, good to go.

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.

Chat: offer to notify when a reply is ready, and say the page can be closed

3 participants