mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Simplify review UI (#31062)
Instead of always displaying all available actions as buttons, merge them into a single dropdown menu, same as GitHub. That decreases visual overload and is more mobile-friendly, while not losing any functionality. ## Screenshots <details><summary>Before</summary>  </details> <details><summary>After (unexpanded)</summary>  </details> <details><summary>After (expanded)</summary>  </details>
This commit is contained in:
		@@ -159,25 +159,30 @@
 | 
				
			|||||||
								{{if and $isReviewFile $file.HasChangedSinceLastReview}}
 | 
													{{if and $isReviewFile $file.HasChangedSinceLastReview}}
 | 
				
			||||||
									<span class="changed-since-last-review unselectable not-mobile">{{ctx.Locale.Tr "repo.pulls.has_changed_since_last_review"}}</span>
 | 
														<span class="changed-since-last-review unselectable not-mobile">{{ctx.Locale.Tr "repo.pulls.has_changed_since_last_review"}}</span>
 | 
				
			||||||
								{{end}}
 | 
													{{end}}
 | 
				
			||||||
								{{if not (or $file.IsIncomplete $file.IsBin $file.IsSubmodule)}}
 | 
					 | 
				
			||||||
									<button class="ui basic tiny button unescape-button not-mobile">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button>
 | 
					 | 
				
			||||||
									<button class="ui basic tiny button escape-button tw-hidden">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
 | 
					 | 
				
			||||||
								{{end}}
 | 
					 | 
				
			||||||
								{{if and (not $file.IsSubmodule) (not $.PageIsWiki)}}
 | 
					 | 
				
			||||||
									{{if $file.IsDeleted}}
 | 
					 | 
				
			||||||
										<a class="ui basic tiny button" rel="nofollow" href="{{$.BeforeSourcePath}}/{{PathEscapeSegments .Name}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a>
 | 
					 | 
				
			||||||
									{{else}}
 | 
					 | 
				
			||||||
										<a class="ui basic tiny button" rel="nofollow" href="{{$.SourcePath}}/{{PathEscapeSegments .Name}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a>
 | 
					 | 
				
			||||||
										{{if and $.Repository.CanEnableEditor $.CanEditFile (not $file.IsLFSFile) (not $file.IsBin)}}
 | 
					 | 
				
			||||||
											<a class="ui basic tiny button" rel="nofollow" href="{{$.HeadRepoLink}}/_edit/{{PathEscapeSegments $.HeadBranchName}}/{{PathEscapeSegments $file.Name}}?return_uri={{print $.BackToLink "#diff-" $file.NameHash | QueryEscape}}">{{ctx.Locale.Tr "repo.editor.edit_this_file"}}</a>
 | 
					 | 
				
			||||||
										{{end}}
 | 
					 | 
				
			||||||
									{{end}}
 | 
					 | 
				
			||||||
								{{end}}
 | 
					 | 
				
			||||||
								{{if $isReviewFile}}
 | 
													{{if $isReviewFile}}
 | 
				
			||||||
									<label data-link="{{$.Issue.Link}}/viewed-files" data-headcommit="{{$.AfterCommitID}}" class="viewed-file-form unselectable{{if $file.IsViewed}} viewed-file-checked-form{{end}}">
 | 
														<label data-link="{{$.Issue.Link}}/viewed-files" data-headcommit="{{$.AfterCommitID}}" class="viewed-file-form unselectable{{if $file.IsViewed}} viewed-file-checked-form{{end}}">
 | 
				
			||||||
										<input type="checkbox" name="{{$file.GetDiffFileName}}" autocomplete="off"{{if $file.IsViewed}} checked{{end}}> {{ctx.Locale.Tr "repo.pulls.has_viewed_file"}}
 | 
															<input type="checkbox" name="{{$file.GetDiffFileName}}" autocomplete="off"{{if $file.IsViewed}} checked{{end}}> {{ctx.Locale.Tr "repo.pulls.has_viewed_file"}}
 | 
				
			||||||
									</label>
 | 
														</label>
 | 
				
			||||||
								{{end}}
 | 
													{{end}}
 | 
				
			||||||
 | 
													<div class="ui dropdown basic">
 | 
				
			||||||
 | 
														{{svg "octicon-kebab-horizontal" 18 "icon tw-mx-2"}}
 | 
				
			||||||
 | 
														<div class="ui menu">
 | 
				
			||||||
 | 
															{{if not (or $file.IsIncomplete $file.IsBin $file.IsSubmodule)}}
 | 
				
			||||||
 | 
																<button class="unescape-button item">{{ctx.Locale.Tr "repo.unescape_control_characters"}}</button>
 | 
				
			||||||
 | 
																<button class="escape-button tw-hidden item">{{ctx.Locale.Tr "repo.escape_control_characters"}}</button>
 | 
				
			||||||
 | 
															{{end}}
 | 
				
			||||||
 | 
															{{if and (not $file.IsSubmodule) (not $.PageIsWiki)}}
 | 
				
			||||||
 | 
																{{if $file.IsDeleted}}
 | 
				
			||||||
 | 
																	<a class="item" rel="nofollow" href="{{$.BeforeSourcePath}}/{{PathEscapeSegments .Name}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a>
 | 
				
			||||||
 | 
																{{else}}
 | 
				
			||||||
 | 
																	<a class="item" rel="nofollow" href="{{$.SourcePath}}/{{PathEscapeSegments .Name}}">{{ctx.Locale.Tr "repo.diff.view_file"}}</a>
 | 
				
			||||||
 | 
																	{{if and $.Repository.CanEnableEditor $.CanEditFile (not $file.IsLFSFile) (not $file.IsBin)}}
 | 
				
			||||||
 | 
																		<a class="item" rel="nofollow" href="{{$.HeadRepoLink}}/_edit/{{PathEscapeSegments $.HeadBranchName}}/{{PathEscapeSegments $file.Name}}?return_uri={{print $.BackToLink "#diff-" $file.NameHash | QueryEscape}}">{{ctx.Locale.Tr "repo.editor.edit_this_file"}}</a>
 | 
				
			||||||
 | 
																	{{end}}
 | 
				
			||||||
 | 
																{{end}}
 | 
				
			||||||
 | 
															{{end}}
 | 
				
			||||||
 | 
														</div>
 | 
				
			||||||
 | 
													</div>
 | 
				
			||||||
							</div>
 | 
												</div>
 | 
				
			||||||
						</h4>
 | 
											</h4>
 | 
				
			||||||
						<div class="diff-file-body ui attached unstackable table segment" {{if and $file.IsViewed $.IsShowingAllCommits}}data-folded="true"{{end}}>
 | 
											<div class="diff-file-body ui attached unstackable table segment" {{if and $file.IsViewed $.IsShowingAllCommits}}data-folded="true"{{end}}>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user