Skip to content
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 issue card #26561

Closed
wants to merge 5 commits into from
Closed

Improve issue card #26561

wants to merge 5 commits into from

Conversation

yp05327
Copy link
Contributor

@yp05327 yp05327 commented Aug 17, 2023

Before:
image
image

After:
image
image

ps:

  • I think we don't need attachment images in issue cards, as if there are too many images in this issue, it will take too many spaces.
  • maybe we don't need target="_blank" here.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 17, 2023
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 17, 2023
@yp05327 yp05327 added the topic/ui Change the appearance of the Gitea UI label Aug 17, 2023
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 17, 2023
@silverwind
Copy link
Member

Wonder whether we should show assignees, milestones and labels at all. I think I prefer a lightweight display like GitHub.

@delvh
Copy link
Member

delvh commented Aug 17, 2023

Depends.
I can see arguments for both sides, so I'll stay neutral to that.
Perhaps leaning a bit more towards keeping it.

@silverwind
Copy link
Member

Those things are mostly only relevant to project members, but I think the primary purpose of pinned issues is to guide users to known issues and users usually wouldn't care about these things.

@silverwind
Copy link
Member

I guess we should have a option in the issue card template to render full (projects) or reduced (pins). But that is material for another PR.

@@ -82,12 +83,18 @@
.card-attachment-images img {
display: inline-block;
max-height: 50px;
max-width: 100%;
border-radius: var(--border-radius);
margin-right: 2px;
Copy link
Member

@silverwind silverwind Aug 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
margin-right: 2px;
margin-right: 2px;
aspect-ratio: 1;

Better to have this just in case, to ensure the image maintains aspect ratio when scaling width/height.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this overlap be a problem?

https://jsfiddle.net/fmapw0ye/

image

Copy link
Member

@silverwind silverwind Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fix that overlap, does require max-height on the parent. Better would be direct max-height on the img without any parent.

max-width: 100%;
max-height: 100%;
aspect-ratio: 1;

Comment on lines 57 to 58
<a {{if $.Page.PageIsProjects}}target="_blank"{{end}} href="{{$.Page.RepoLink}}/issues?labels={{.ID}}">{{RenderLabel ctx .}}</a>
{{end}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{{if $.Page.PageIsProjects}} should it be {{if .PageIsProjects}} 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not possible in this case.
Go templates are weird when it comes to range:
What is happening here is implicitly a

for _, . := range(Labels) { … }

, with . being the base variable the Go templates can use.
In other words, all previous variables get removed leaving only the properties of a label for a whole iteration.
That's why you need to reference a template global variable by prefixing it with $.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ps: in other places, the "Page" variable is usually called "root" or "ctxData", which means the root context data of this request (aka: ctx.Data in backend code)

@silverwind
Copy link
Member

I think the image width issue may have been already fixed.

SimonPistache added a commit to SimonPistache/gitea that referenced this pull request Jul 23, 2024
As discussed in go-gitea#31667 & go-gitea#26561, when a card on a Project contains images, they can overflow the card on its containing column. This aims to fix this issue via snapping scrollbars .
@yp05327
Copy link
Contributor Author

yp05327 commented Aug 12, 2024

Replaced by #31683

@yp05327 yp05327 closed this Aug 12, 2024
lunny pushed a commit that referenced this pull request Aug 12, 2024
…31683)

As discussed in #31667 & #26561, when a card on a Project contains
images, they can overflow the card on its containing column. This aims
to fix this issue via snapping scrollbars.

---
Issue #31667 is open to discussion as there should be room for
improvement.
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Aug 12, 2024
…o-gitea#31683)

As discussed in go-gitea#31667 & go-gitea#26561, when a card on a Project contains
images, they can overflow the card on its containing column. This aims
to fix this issue via snapping scrollbars.

---
Issue go-gitea#31667 is open to discussion as there should be room for
improvement.
lunny pushed a commit that referenced this pull request Aug 13, 2024
…31683) (#31823)

Backport #31683 by @SimonPistache

As discussed in #31667 & #26561, when a card on a Project contains
images, they can overflow the card on its containing column. This aims
to fix this issue via snapping scrollbars.

---
Issue #31667 is open to discussion as there should be room for
improvement.

Co-authored-by: Simon Priet <[email protected]>
4kProgrammer pushed a commit to 4kProgrammer/gitea that referenced this pull request Aug 20, 2024
Squashed commit:

[e1468e2] Fixes for unreachable project issues when transfer repository from organization (go-gitea#31770)
dfhgfdhfghfg
When transferring repositories that have issues linked to a project
board to another organization, the issues remain associated with the
original project board. This causes the columns in the project board to
become bugged, making it difficult to move other issues in or out of the
affected columns. As a solution, I removed the issue relations since the
other organization does not have this project table.

Fix for go-gitea#31538

Co-authored-by: Jason Song <[email protected]>

[c39643f] fghfghf

[38a09ea] render plain text file if the LFS object doesn't exist (go-gitea#31812)gfgdfg

We had an issue where a repo was using LFS to store a file, but the user
did not push the file. When trying to view the file, Gitea returned a
500 HTTP status code referencing `ErrLFSObjectNotExist`. It appears the
intent was the render this file as plain text, but the conditional was
flipped. I've also added a test to verify that the file is rendered as
plain text.

[2477511] Add spacing to global error message (go-gitea#31826)

Fixes go-gitea#31717.

Include Typescript files in Tailwind config so they can be
pre-processed.

![Screenshot from 2024-08-13
08-44-33](https://github.com/user-attachments/assets/196d7801-e299-4000-8b39-cd9f89917f17)

[5bcab0b] [skip ci] Updated translations via Crowdin

[fe7c941] Scroll images in project issues separately from the remaining issue (go-gitea#31683)

As discussed in go-gitea#31667 & go-gitea#26561, when a card on a Project contains
images, they can overflow the card on its containing column. This aims
to fix this issue via snapping scrollbars.

---
Issue go-gitea#31667 is open to discussion as there should be room for
improvement.

[8883d99] Support issue template assignees (go-gitea#31083)

Resolve go-gitea#13955
4kProgrammer pushed a commit to 4kProgrammer/gitea that referenced this pull request Aug 20, 2024
Squashed commit:

[e1468e2] Fixes for unreachable project issues when transfer repository from organization (go-gitea#31770)
dfhgfdhfghfg
When transferring repositories that have issues linked to a project
board to another organization, the issues remain associated with the
original project board. This causes the columns in the project board to
become bugged, making it difficult to move other issues in or out of the
affected columns. As a solution, I removed the issue relations since the
other organization does not have this project table.

Fix for go-gitea#31538

Co-authored-by: Jason Song <[email protected]>

[c39643f] fghfghf

[38a09ea] render plain text file if the LFS object doesn't exist (go-gitea#31812)gfgdfg

We had an issue where a repo was using LFS to store a file, but the user
did not push the file. When trying to view the file, Gitea returned a
500 HTTP status code referencing `ErrLFSObjectNotExist`. It appears the
intent was the render this file as plain text, but the conditional was
flipped. I've also added a test to verify that the file is rendered as
plain text.

[2477511] Add spacing to global error message (go-gitea#31826)

Fixes go-gitea#31717.

Include Typescript files in Tailwind config so they can be
pre-processed.

![Screenshot from 2024-08-13
08-44-33](https://github.com/user-attachments/assets/196d7801-e299-4000-8b39-cd9f89917f17)

[5bcab0b] [skip ci] Updated translations via Crowdin

[fe7c941] Scroll images in project issues separately from the remaining issue (go-gitea#31683)

As discussed in go-gitea#31667 & go-gitea#26561, when a card on a Project contains
images, they can overflow the card on its containing column. This aims
to fix this issue via snapping scrollbars.

---
Issue go-gitea#31667 is open to discussion as there should be room for
improvement.

[8883d99] Support issue template assignees (go-gitea#31083)

Resolve go-gitea#13955
4kProgrammer pushed a commit to 4kProgrammer/gitea that referenced this pull request Aug 20, 2024
Squashed commit:

[e1468e2] Fixes for unreachable project issues when transfer repository from organization (go-gitea#31770)
dfhgfdhfghfg
When transferring repositories that have issues linked to a project
board to another organization, the issues remain associated with the
original project board. This causes the columns in the project board to
become bugged, making it difficult to move other issues in or out of the
affected columns. As a solution, I removed the issue relations since the
other organization does not have this project table.

Fix for go-gitea#31538

Co-authored-by: Jason Song <[email protected]>

[c39643f] fghfghf

[38a09ea] render plain text file if the LFS object doesn't exist (go-gitea#31812)gfgdfg

We had an issue where a repo was using LFS to store a file, but the user
did not push the file. When trying to view the file, Gitea returned a
500 HTTP status code referencing `ErrLFSObjectNotExist`. It appears the
intent was the render this file as plain text, but the conditional was
flipped. I've also added a test to verify that the file is rendered as
plain text.

[2477511] Add spacing to global error message (go-gitea#31826)

Fixes go-gitea#31717.

Include Typescript files in Tailwind config so they can be
pre-processed.

![Screenshot from 2024-08-13
08-44-33](https://github.com/user-attachments/assets/196d7801-e299-4000-8b39-cd9f89917f17)

[5bcab0b] [skip ci] Updated translations via Crowdin

[fe7c941] Scroll images in project issues separately from the remaining issue (go-gitea#31683)

As discussed in go-gitea#31667 & go-gitea#26561, when a card on a Project contains
images, they can overflow the card on its containing column. This aims
to fix this issue via snapping scrollbars.

---
Issue go-gitea#31667 is open to discussion as there should be room for
improvement.

[8883d99] Support issue template assignees (go-gitea#31083)

Resolve go-gitea#13955
4kProgrammer pushed a commit to 4kProgrammer/gitea that referenced this pull request Aug 20, 2024
Squashed commit:

[e1468e2] Fixes for unreachable project issues when transfer repository from organization (go-gitea#31770)
dfhgfdhfghfg
When transferring repositories that have issues linked to a project
board to another organization, the issues remain associated with the
original project board. This causes the columns in the project board to
become bugged, making it difficult to move other issues in or out of the
affected columns. As a solution, I removed the issue relations since the
other organization does not have this project table.

Fix for go-gitea#31538

Co-authored-by: Jason Song <[email protected]>

[c39643f] fghfghf

[38a09ea] render plain text file if the LFS object doesn't exist (go-gitea#31812)gfgdfg

We had an issue where a repo was using LFS to store a file, but the user
did not push the file. When trying to view the file, Gitea returned a
500 HTTP status code referencing `ErrLFSObjectNotExist`. It appears the
intent was the render this file as plain text, but the conditional was
flipped. I've also added a test to verify that the file is rendered as
plain text.

[2477511] Add spacing to global error message (go-gitea#31826)

Fixes go-gitea#31717.

Include Typescript files in Tailwind config so they can be
pre-processed.

![Screenshot from 2024-08-13
08-44-33](https://github.com/user-attachments/assets/196d7801-e299-4000-8b39-cd9f89917f17)

[5bcab0b] [skip ci] Updated translations via Crowdin

[fe7c941] Scroll images in project issues separately from the remaining issue (go-gitea#31683)

As discussed in go-gitea#31667 & go-gitea#26561, when a card on a Project contains
images, they can overflow the card on its containing column. This aims
to fix this issue via snapping scrollbars.

---
Issue go-gitea#31667 is open to discussion as there should be room for
improvement.

[8883d99] Support issue template assignees (go-gitea#31083)

Resolve go-gitea#13955
DennisRasey pushed a commit to DennisRasey/forgejo that referenced this pull request Aug 20, 2024
…issue (gitea#31683)

As discussed in go-gitea/gitea#31667 &
go-gitea/gitea#26561, when a card on a Project
contains images, they can overflow the card on its containing column.
This aims to fix this issue via snapping scrollbars.

---
Conflict resolution: none

(cherry picked from commit fe7c9416777243264e8482d3af29e30c2b671074)
(cherry picked from commit 8e46efe)
DennisRasey pushed a commit to DennisRasey/forgejo that referenced this pull request Aug 20, 2024
…issue (gitea#31683)

As discussed in go-gitea/gitea#31667 &
go-gitea/gitea#26561, when a card on a Project
contains images, they can overflow the card on its containing column.
This aims to fix this issue via snapping scrollbars.

---
Conflict resolution: none

(cherry picked from commit fe7c9416777243264e8482d3af29e30c2b671074)
DennisRasey pushed a commit to DennisRasey/forgejo that referenced this pull request Aug 21, 2024
…issue (gitea#31683)

As discussed in go-gitea/gitea#31667 &
go-gitea/gitea#26561, when a card on a Project
contains images, they can overflow the card on its containing column.
This aims to fix this issue via snapping scrollbars.

---
Backport: #5029
Conflict resolution: none
Modification: Remove the snapping of the images on the projects cards, the images are way too small to notice that when scrolling you're being snapped to these images and when you do notice it, it doesn't make sense as you wouldn't expect it to be snapped.

(cherry picked from commit 8e46efe)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 1 This PR needs approval from one additional maintainer to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants