-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve code comment review on mobile #21461
Conversation
- Fix placement of avatar image, this was not placed in the `comment-header-left` and add CSS to cover the limiting of width+height of avatar for code-review comment on "Files changed" page. This fixes the big noticeable avatar issue. - Apply `margin-bottom` to the "next" button, so it's consistent with the "previous" button. - Make sure the "next"/"previous" start at `flex-start` on mobile and not off-screen at `flex-end`. - Add `flex: 1` to the text, so the browser will nicely wrap the "XXX commented XXX ago" text besides the avatar and make the header a bit more compact, still not ideal. - Resolves go-gitea#20074
Never noticed it was a speech bubble. |
Would be an option to remove the "speech bubble icon"?, it's the only comment form that still has this, all other ones are already in the header. |
You mean removing the triangle? I think we want to keep these as the speech bubble effect is still present during regular issue comments. |
af142d3 keeps the speech bubble effect as well fix the overflowing "previous/next" buttons. "After" screenshot also updated. |
CI failure is related |
Ideally avatar should move into empty space on the left, but I'm afraid that's not easily possible with that table layout in place. |
Try this patch: diff --git a/web_src/less/_review.less b/web_src/less/_review.less
index 52f10a4daa..c2f85fff62 100644
--- a/web_src/less/_review.less
+++ b/web_src/less/_review.less
@@ -47,8 +47,21 @@
margin-bottom: .5em;
}
}
+tr.add-comment {
+ position: relative;
+ left: -90px;
+}
+
+tr.add-comment .comment-code-cloud {
+ width: calc(100% + 90px);
+}
+
+tr.add-comment .comment-code-cloud .comment-container {
+ width: calc(100% - 50px);
+}
+
.show-outdated,
.hide-outdated {
&:extend(.unselectable);
display: block !important;
@@ -75,20 +88,20 @@
}
.ui.buttons {
width: 100%;
+ margin: 0 !important;
.button {
flex: 1;
}
}
}
.comments .comment {
- margin: 0;
+ padding: 0;
@media @mediaSm {
- padding: 0;
display: flex;
.comment-header-right.actions .ui.basic.label {
display: none; |
I don't mind it as much even on desktop, but yes, I can probably increase right side margin a bit. |
If we break such "user are used to this" it should be minimal, so adding right-side margin(on non-mobile) is fine with me. |
This should be better (and simpler). Full width on mobile only, on desktop, align comment left side with line numbers: diff --git a/web_src/less/_review.less b/web_src/less/_review.less
index 52f10a4daa..93c7ecab81 100644
--- a/web_src/less/_review.less
+++ b/web_src/less/_review.less
@@ -61,10 +61,13 @@
.comment-code-cloud {
padding: .5rem !important;
position: relative;
margin: 0 auto;
+ left: -56px;
@media @mediaSm {
+ left: -90px;
+ width: calc(100% + 80px);
padding: .75rem !important;
.code-comment-buttons {
margin: .5rem 0 .25rem !important;
@@ -75,20 +78,20 @@
}
.ui.buttons {
width: 100%;
+ margin: 0 !important;
.button {
flex: 1;
}
}
}
.comments .comment {
- margin: 0;
+ padding: 0;
@media @mediaSm {
- padding: 0;
display: flex;
.comment-header-right.actions .ui.basic.label {
display: none; |
Indeed, split diff is a problem because line numbers are not as wide. |
I give up, there is no clean way via CSS. the Pushed a few small margin/padding changes that are non-destructive. |
Actually, I think I found something that works. |
make L-G-T-M work |
@Gusted can you review once more? |
Alright, this looks good to me as well. |
* upstream/main: Fix issues count bug (go-gitea#21557) Improve code comment review on mobile (go-gitea#21461) Consolidate remaining colors into variables (go-gitea#21582)
comment-header-left
and add CSS to cover the limiting of width+height of avatar for code-review comment on "Files changed" page. This fixes the big noticeable avatar issue.margin-bottom
to the "next" button, so it's consistent with the "previous" button.flex-start
on mobile and not off-screen atflex-end
. As well force them to haveflex: 1
so they won't overflow on x-asis. This also requires thewidth: 100%
for the.ui.buttons
div.Before
After