Skip to content

Add allow notification option to comment forms - #190

Merged
ruibaby merged 4 commits into
mainfrom
feat/allow-notification
Oct 23, 2026
Merged

ruibaby merged 4 commits into
mainfrom
feat/allow-notification

Conversation

@ruibaby

@ruibaby ruibaby commented Aug 12, 2025 •

Copy link
Copy Markdown
Member

Summary

  • Add an "Allow notification" checkbox to the comment and reply forms, enabled by default.
  • Send the selected allowNotification value with comment and reply requests instead of always sending true.
  • Add a plugin setting (allowNotificationConfigurable, "允许用户选择是否接收通知") that controls whether the checkbox is available. It is disabled by default; when disabled the checkbox is hidden and notifications are always allowed, preserving the previous behavior.

Backend support for respecting this preference is available in Halo 2.27.0 (halo-dev/halo#10313), which this plugin already requires (>=2.27.0). Only an explicit false disables notifications, so forms that do not set the field keep the previous behavior.

Behavior

Plugin setting Form Request
Off (default) Checkbox hidden Always sends allowNotification: true
On Checkbox shown, checked by default Sends the user's choice

Validation

  • pnpm -C comment-widget test — 33 files, 181 tests passed
  • pnpm -C comment-widget exec tsc --noEmit — passed
  • pnpm -C comment-widget build — passed
  • biome check on the changed files — passed
  • ./gradlew compileJava — passed

End-to-end against a real Halo 2.27.0 instance with this plugin installed:

  • Checked/unchecked comments and replies persist spec.allowNotification as true/false via the Halo APIs.
  • Halo creates someone-replied-to-you subscriptions only for the allowed cases, and emits no notification reason when replying to a comment whose allowNotification is false.
  • With the setting off, the checkbox is hidden and requests send true; with it on, the checkbox appears checked, and unchecking it sends false.
支持在评论和回复表单中选择是否接收后续回复的通知,并可在插件设置中控制是否允许用户自行设置(默认关闭)

@f2c-ci-robot f2c-ci-robot Bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Aug 12, 2025
@f2c-ci-robot
f2c-ci-robot Bot requested review from JohnNiang and guqing August 12, 2025 07:22
@f2c-ci-robot

f2c-ci-robot Bot commented Aug 12, 2025

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign guqing for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 18, 2025
@f2c-ci-robot

f2c-ci-robot Bot commented Aug 18, 2025

Copy link
Copy Markdown

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ruibaby ruibaby changed the title WIP: Add allow notification option to comment forms Add allow notification option to comment forms Oct 23, 2026
@ruibaby ruibaby removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 23, 2026
@ruibaby
ruibaby merged commit 6db71d9 into main Oct 23, 2026
2 checks passed
@ruibaby
ruibaby deleted the feat/allow-notification branch October 23, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note-none Denotes a PR that doesn't merit a release note.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant