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 "Reference in new issue" modal #30547

Merged
merged 5 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
34 changes: 16 additions & 18 deletions templates/repo/issue/view_content/reference_issue_dialog.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,24 @@
<div class="content tw-text-left">
<form class="ui form form-fetch-action" action="{{printf "%s/issues/new" .Repository.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="ui segment content">
<div class="field">
<span class="text"><strong>{{ctx.Locale.Tr "repository"}}</strong></span>
<div class="ui search normal selection dropdown issue_reference_repository_search">
<div class="default text">{{.Repository.FullName}}</div>
<div class="menu"></div>
</div>
</div>
<div class="field">
<span class="text"><strong>{{ctx.Locale.Tr "repo.milestones.title"}}</strong></span>
<input name="title" value="" autofocus required maxlength="255" autocomplete="off">
</div>
<div class="field">
<span class="text"><strong>{{ctx.Locale.Tr "repo.issues.reference_issue.body"}}</strong></span>
<textarea name="content" class="form-control"></textarea>
</div>
<div class="text right">
<button class="ui primary button">{{ctx.Locale.Tr "repo.issues.create"}}</button>
<div class="field">
<label><strong>{{ctx.Locale.Tr "repository"}}</strong></label>
<div class="ui search normal selection dropdown issue_reference_repository_search">
<div class="default text">{{.Repository.FullName}}</div>
<div class="menu"></div>
</div>
</div>
<div class="field">
<label><strong>{{ctx.Locale.Tr "repo.milestones.title"}}</strong></label>
<input name="title" value="" autofocus required maxlength="255" autocomplete="off">
</div>
<div class="field">
<label><strong>{{ctx.Locale.Tr "repo.issues.reference_issue.body"}}</strong></label>
<textarea name="content" class="form-control"></textarea>
</div>
<div class="text right">
<button class="ui primary button">{{ctx.Locale.Tr "repo.issues.create"}}</button>
</div>
</form>
</div>
</div>
7 changes: 7 additions & 0 deletions web_src/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,13 @@ a.label,

.ui.selection.dropdown .menu > .item {
border-color: var(--color-secondary);
white-space: nowrap;
}

.ui.search.dropdown > .text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why only "search dropdown" has these styles, but all ".ui.dropdown .menu > .item" also have "text-overflow: ellipsis" ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if that's the best selector but it was one of the matching ones in this case. The classname on it is certainly some kind of abuse ui search normal selection dropdown.

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed the search class from the selector, but would not do any more change to this currently. Actually I'm not sure I understand the question.

Copy link
Contributor

@wxiaoguang wxiaoguang Apr 21, 2024

Choose a reason for hiding this comment

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

OK, I think the problem is clear now. We can't "overflow: hidden" to any general "dropdown" selector.

Because even .ui.selection or .ui.search it might contain images like avatars.

The dropdown was not designed to work this way.

Ref: Broken avatar css on main page #30624

image

}

.ui.selection.visible.dropdown > .text:not(.default) {
Expand Down