feat(ui): modernize hidden comment types checkboxes in appearance settings (#13044)

Changes

- use native fieldset and checkboxes instead of fomantic. As a result, the code is simpler and changing the checkbox state by clicking the text works without JS by native `label` behavior instead of fomantic scripted behavior.
- show tooltips as help hints. This is better because in a large list with only two items having tooltips the user doesn't have to guess which ones have a tooltip. And it is more touchscreen friendly.

Preview

|Old|New|
|-|-|
|![old](https://codeberg.org/attachments/d464e1b7-d490-4efe-ac2a-5c4eb1f70467)|![new](https://codeberg.org/attachments/decccca6-45b7-4c8a-9099-a28781aad7f3)|

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13044
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
0ko 2026-06-11 07:00:11 +02:00
commit 423b5c029c

View file

@ -97,94 +97,71 @@
{{ctx.Locale.Tr "settings.hidden_comment_types_description"}}
</p>
<form class="ui form" action="{{.Link}}/hidden_comments" method="post">
<div class="inline field">
<div class="ui checkbox" data-tooltip-content="{{ctx.Locale.Tr "settings.hidden_comment_types.ref_tooltip"}}">
<fieldset>
<label>
<input name="reference" type="checkbox" {{if(call .IsCommentTypeGroupChecked "reference")}}checked{{end}}>
<label>{{ctx.Locale.Tr "settings.comment_type_group_reference"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
{{ctx.Locale.Tr "settings.comment_type_group_reference"}}
<span class="help">
{{ctx.Locale.Tr "settings.hidden_comment_types.ref_tooltip"}}
</span>
</label>
<label>
<input name="label" type="checkbox" {{if (call .IsCommentTypeGroupChecked "label")}}checked{{end}}>
<label>{{ctx.Locale.Tr "settings.comment_type_group_label"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
{{ctx.Locale.Tr "settings.comment_type_group_label"}}
</label>
<label>
<input name="milestone" type="checkbox" {{if (call .IsCommentTypeGroupChecked "milestone")}}checked{{end}}>
<label>{{ctx.Locale.Tr "settings.comment_type_group_milestone"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
{{ctx.Locale.Tr "settings.comment_type_group_milestone"}}
</label>
<label>
<input name="assignee" type="checkbox" {{if (call .IsCommentTypeGroupChecked "assignee")}}checked{{end}}>
<label>{{ctx.Locale.Tr "settings.comment_type_group_assignee"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
{{ctx.Locale.Tr "settings.comment_type_group_assignee"}}
</label>
<label>
<input name="title" type="checkbox" {{if (call .IsCommentTypeGroupChecked "title")}}checked{{end}}>
<label>{{ctx.Locale.Tr "settings.comment_type_group_title"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
{{ctx.Locale.Tr "settings.comment_type_group_title"}}
</label>
<label>
<input name="branch" type="checkbox" {{if (call .IsCommentTypeGroupChecked "branch")}}checked{{end}}>
<label>{{ctx.Locale.Tr "settings.comment_type_group_branch"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
{{ctx.Locale.Tr "settings.comment_type_group_branch"}}
</label>
<label>
<input name="time_tracking" type="checkbox" {{if (call .IsCommentTypeGroupChecked "time_tracking")}}checked{{end}}>
<label>{{ctx.Locale.Tr "settings.comment_type_group_time_tracking"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
{{ctx.Locale.Tr "settings.comment_type_group_time_tracking"}}
</label>
<label>
<input name="deadline" type="checkbox" {{if (call .IsCommentTypeGroupChecked "deadline")}}checked{{end}}>
<label>{{ctx.Locale.Tr "settings.comment_type_group_deadline"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
{{ctx.Locale.Tr "settings.comment_type_group_deadline"}}
</label>
<label>
<input name="dependency" type="checkbox" {{if (call .IsCommentTypeGroupChecked "dependency")}}checked{{end}}>
<label>{{ctx.Locale.Tr "settings.comment_type_group_dependency"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
{{ctx.Locale.Tr "settings.comment_type_group_dependency"}}
</label>
<label>
<input name="lock" type="checkbox" {{if (call .IsCommentTypeGroupChecked "lock")}}checked{{end}}>
<label>{{ctx.Locale.Tr "settings.comment_type_group_lock"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
{{ctx.Locale.Tr "settings.comment_type_group_lock"}}
</label>
<label>
<input name="review_request" type="checkbox" {{if (call .IsCommentTypeGroupChecked "review_request")}}checked{{end}}>
<label>{{ctx.Locale.Tr "settings.comment_type_group_review_request"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
{{ctx.Locale.Tr "settings.comment_type_group_review_request"}}
</label>
<label>
<input name="pull_request_push" type="checkbox" {{if (call .IsCommentTypeGroupChecked "pull_request_push")}}checked{{end}}>
<label>{{ctx.Locale.Tr "settings.comment_type_group_pull_request_push"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui checkbox">
{{ctx.Locale.Tr "settings.comment_type_group_pull_request_push"}}
</label>
<label>
<input name="project" type="checkbox" {{if (call .IsCommentTypeGroupChecked "project")}}checked{{end}}>
<label>{{ctx.Locale.Tr "settings.comment_type_group_project"}}</label>
</div>
</div>
<div class="inline field">
<div class="ui checkbox" data-tooltip-content="{{ctx.Locale.Tr "settings.hidden_comment_types.issue_ref_tooltip"}}">
{{ctx.Locale.Tr "settings.comment_type_group_project"}}
</label>
<label>
<input name="issue_ref" type="checkbox" {{if (call .IsCommentTypeGroupChecked "issue_ref")}}checked{{end}}>
<label>{{ctx.Locale.Tr "settings.comment_type_group_issue_ref"}}</label>
</div>
</div>
<div class="field">
<button class="ui primary button">{{ctx.Locale.Tr "save"}}</button>
</div>
{{ctx.Locale.Tr "settings.comment_type_group_issue_ref"}}
<span class="help">
{{ctx.Locale.Tr "settings.hidden_comment_types.issue_ref_tooltip"}}
</span>
</label>
</fieldset>
<button class="primary button">{{ctx.Locale.Tr "save"}}</button>
</form>
</div>
</div>