Skip to content

Commit ea7ed84

Browse files
wxiaoguangKN4CK3R
andcommitted
Fix review comment context menu clipped bug (go-gitea#23523)
This is another regression of go-gitea#22959 (the first regression has been fixed by the Image Diff fix) Close go-gitea#23517 This is a quick fix. Luckily, there is no "dropdown menu" for image/csv view, so we could only add the "overflow-x: scroll" to the image/csv view. After fix: ![image](https://user-images.githubusercontent.com/2114189/225643575-9e964b4f-5543-4a69-86c2-2ffc8e40d9a6.png) ![image](https://user-images.githubusercontent.com/2114189/225643670-f0e575d0-f4af-41f4-b023-2d9ddb6462e9.png) Co-authored-by: KN4CK3R <[email protected]>
1 parent 68c9f1a commit ea7ed84

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

templates/repo/diff/box.tmpl

+2-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@
161161
{{end}}
162162
</div>
163163
{{if $showFileViewToggle}}
164-
<div id="diff-rendered-{{$file.NameHash}}" class="file-body file-code {{if $.IsSplitStyle}} code-diff-split{{else}} code-diff-unified{{end}}">
164+
{{/* for image or CSV, it can have a horizontal scroll bar, there won't be review comment context menu (position absolute) which would be clipped by "overflow" */}}
165+
<div id="diff-rendered-{{$file.NameHash}}" class="file-body file-code {{if $.IsSplitStyle}}code-diff-split{{else}}code-diff-unified{{end}} gt-overflow-x-scroll">
165166
<table class="chroma gt-w-100">
166167
{{if $isImage}}
167168
{{template "repo/diff/image_diff" dict "file" . "root" $ "blobBase" $blobBase "blobHead" $blobHead}}

web_src/css/helpers.css

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
/* below class names match Tailwind CSS */
2323
.gt-pointer-events-none { pointer-events: none !important; }
2424
.gt-relative { position: relative !important; }
25+
.gt-overflow-x-scroll { overflow-x: scroll !important; }
2526

2627
.gt-mono {
2728
font-family: var(--fonts-monospace) !important;

web_src/css/repository.css

-4
Original file line numberDiff line numberDiff line change
@@ -3337,10 +3337,6 @@ td.blob-excerpt {
33373337
min-width: 100px;
33383338
}
33393339

3340-
.diff-file-body {
3341-
overflow-x: scroll;
3342-
}
3343-
33443340
.diff-stats-bar {
33453341
display: inline-block;
33463342
background-color: var(--color-red);

0 commit comments

Comments
 (0)