Skip to content

Improve flex-item overflow #31404

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion templates/shared/issuelist.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@
<div class="flex-item-main">
<div class="flex-item-header">
<div class="flex-item-title">
<div class="flex-item-title-inline">
<a class="tw-no-underline issue-title" href="{{if .Link}}{{.Link}}{{else}}{{$.Link}}/{{.Index}}{{end}}">{{RenderEmoji $.Context .Title | RenderCodeBlock}}</a>
{{if .IsPull}}
{{if (index $.CommitStatuses .PullRequest.ID)}}
{{template "repo/commit_statuses" dict "Status" (index $.CommitLastStatus .PullRequest.ID) "Statuses" (index $.CommitStatuses .PullRequest.ID)}}
{{end}}
{{end}}
<span class="labels-list tw-ml-1">
<span class="labels-list">
{{range .Labels}}
<a href="?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}{{if ne $.listType "milestone"}}&milestone={{$.MilestoneID}}{{end}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{RenderLabel $.Context ctx.Locale .}}</a>
{{end}}
</span>
</div>
</div>
{{if or .TotalTrackedTime .Assignees .NumComments}}
<div class="flex-item-trailing">
{{if .TotalTrackedTime}}
Expand Down
25 changes: 23 additions & 2 deletions web_src/css/shared/flex-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
display: flex;
gap: .25rem;
justify-content: space-between;
flex-wrap: wrap;
}

@media (max-width: 600px) {
.flex-item-header {
flex-direction: column;
}
}

.flex-item a:not(.label, .button):hover {
Expand All @@ -46,8 +51,15 @@
gap: 0.5rem;
align-items: center;
flex-grow: 0;
flex-shrink: 0;
flex-wrap: wrap;
justify-content: end;
justify-content: flex-end;
}

@media (max-width: 600px) {
.flex-item .flex-item-trailing {
justify-content: flex-start;
}
}

.flex-item .flex-item-title {
Expand All @@ -68,6 +80,15 @@
overflow-wrap: anywhere;
}

/* display:inline wrapper that makes labels overflow like text */
.flex-item-title-inline {
display: inline;
}
.flex-item-title-inline > * {
display: inline !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't look good to me.

  1. It introduces unclear style overriding game again.
  2. There could be "SVG/emoji" in the labels, so the "flex align item center" was done intentionally, but now I do not know whether "inline+vertical-align" works.

Copy link
Member Author

@silverwind silverwind Jun 17, 2024

Choose a reason for hiding this comment

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

At minimum the children must be display: inline. Parent actually does not need it. Could maybe check if we can get both elements to naturally display: inline, e.g. span/a without any CSS that alters display.

vertical-align: bottom;
}

.flex-item .flex-item-body {
display: flex;
align-items: center;
Expand Down