Skip to content

Commit

Permalink
Fix long branch name overflow in branch selector and issue list
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Apr 8, 2024
1 parent 908426a commit 3cccaba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions templates/repo/branch_dropdown.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{{/* show dummy elements before Vue componment is mounted, this code must match the code in BranchTagSelector.vue */}}
<div class="ui dropdown custom">
<button class="branch-dropdown-button gt-ellipsis ui basic small compact button tw-flex tw-m-0">
<span class="text tw-flex tw-items-center tw-mr-1">
<span class="text tw-flex tw-items-center tw-mr-1 gt-ellipsis">
{{if .release}}
{{ctx.Locale.Tr "repo.release.compare"}}
{{else}}
Expand All @@ -80,7 +80,7 @@
{{else}}
{{svg "octicon-git-branch"}}
{{end}}
<strong ref="dropdownRefName" class="tw-ml-2">{{if and .root.IsViewTag (not .noTag)}}{{.root.TagName}}{{else if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.CommitID}}{{end}}</strong>
<strong ref="dropdownRefName" class="tw-ml-2 tw-inline-block gt-ellipsis">{{if and .root.IsViewTag (not .noTag)}}{{.root.TagName}}{{else if .root.IsViewBranch}}{{.root.BranchName}}{{else}}{{ShortSha .root.CommitID}}{{end}}</strong>
{{end}}
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
Expand Down
5 changes: 3 additions & 2 deletions web_src/css/repo/issue-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}

#issue-list .flex-item-body .branches .branch {
background-color: var(--color-secondary-alpha-40);
background-color: var(--color-secondary-alpha-50);
border-radius: var(--border-radius);
padding: 0 4px;
}
Expand All @@ -48,7 +48,8 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 10em;
max-width: 200px;
display: block;
}

#issue-list .flex-item-body .checklist progress {
Expand Down
4 changes: 2 additions & 2 deletions web_src/js/components/RepoBranchTagSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@ export default sfc; // activate IDE's Vue plugin
<template>
<div class="ui dropdown custom">
<button class="branch-dropdown-button gt-ellipsis ui basic small compact button tw-flex tw-m-0" @click="menuVisible = !menuVisible" @keyup.enter="menuVisible = !menuVisible">
<span class="text tw-flex tw-items-center tw-mr-1">
<span class="text tw-flex tw-items-center tw-mr-1 gt-ellipsis">
<template v-if="release">{{ textReleaseCompare }}</template>
<template v-else>
<svg-icon v-if="isViewTag" name="octicon-tag"/>
<svg-icon v-else name="octicon-git-branch"/>
<strong ref="dropdownRefName" class="tw-ml-2">{{ refNameText }}</strong>
<strong ref="dropdownRefName" class="tw-ml-2 tw-inline-block gt-ellipsis">{{ refNameText }}</strong>
</template>
</span>
<svg-icon name="octicon-triangle-down" :size="14" class-name="dropdown icon"/>
Expand Down

0 comments on commit 3cccaba

Please sign in to comment.