enhance: refine repo watching (#38835)

Follow-up to https://github.com/go-gitea/gitea/pull/37571.

"Participating and mentions" deleted the watch row, so choosing it
dropped you out of the watcher count. It is a watch like the others, so
it now keeps a row and simply subscribes to no events.

The dashboard feed ignored the per-event options, so a "Custom: issues"
watcher still got pull request activity there. It now gates on the same
options as mail and notifications. That also closes a gap where pull
request reviews bypassed the permission check.

Also, address
https://github.com/go-gitea/gitea/pull/37571#discussion_r3740487363 and
reword a UI text for clarity.

---------

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
silverwind
2026-08-09 12:54:31 +02:00
committed by GitHub
parent 76a81b24f9
commit ad6107ab88
14 changed files with 137 additions and 92 deletions
+6 -3
View File
@@ -57,9 +57,12 @@
</a>
{{$watch := and $.Watches (index $.Watches .ID)}}
{{if $watch}}
<button class="btn flex-text-inline" data-global-click="onRepoWatchOptionsClick"
data-url="{{.Link}}/action/watch/options"
data-issues="{{$watch.Issues}}" data-pull-requests="{{$watch.PullRequests}}" data-releases="{{$watch.Releases}}"
<button class="btn flex-text-inline show-modal"
data-modal="#repo-watch-options-modal"
data-modal-form.url="{{.Link}}/action/watch/options"
data-modal-issues="{{$watch.Issues}}"
data-modal-pull_requests="{{$watch.PullRequests}}"
data-modal-releases="{{$watch.Releases}}"
data-tooltip-content="{{ctx.Locale.Tr "notifications"}}"
>{{svg "octicon-gear" 16}}</button>
{{end}}