From eda10cc2bb229a6b13ace76caea118384b381429 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 6 May 2024 15:17:22 +0800 Subject: Fix some UI problems (dropdown/container) (#30849) Follow #30345 Follow #30547 `ellipsis` / `white-space` shouldn't be put on the general dropdown components. --- web_src/css/base.css | 22 ++++++++++++++++++---- web_src/css/form.css | 4 ++++ web_src/css/modules/container.css | 22 ++++++++-------------- web_src/css/repo.css | 6 ++++++ web_src/js/components/RepoBranchTagSelector.vue | 4 ++-- web_src/js/features/repo-issue.js | 4 ++-- 6 files changed, 40 insertions(+), 22 deletions(-) (limited to 'web_src') diff --git a/web_src/css/base.css b/web_src/css/base.css index c0ced2955c..412d9094e3 100644 --- a/web_src/css/base.css +++ b/web_src/css/base.css @@ -342,8 +342,6 @@ a.label, .ui.dropdown .menu > .item { color: var(--color-text); - overflow: hidden; - text-overflow: ellipsis; } .ui.dropdown .menu > .item:hover { @@ -374,7 +372,6 @@ a.label, .ui.selection.dropdown .menu > .item { border-color: var(--color-secondary); - white-space: nowrap; } .ui.selection.visible.dropdown > .text:not(.default) { @@ -1342,7 +1339,11 @@ table th[data-sortt-desc] .svg { align-items: center; gap: .25rem; vertical-align: middle; - min-width: 0; + min-width: 0; /* make ellipsis work */ +} + +.ui.ui.dropdown.selection { + min-width: 14em; /* match the default min width */ } .ui.dropdown .ui.label .svg { @@ -1369,3 +1370,16 @@ table th[data-sortt-desc] .svg { gap: .5rem; min-width: 0; } + +.ui.dropdown.ellipsis-items-nowrap > .text { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.ellipsis-items-nowrap > .item, +.ui.dropdown.ellipsis-items-nowrap .menu > .item { + white-space: nowrap !important; + overflow: hidden !important; + text-overflow: ellipsis !important; +} diff --git a/web_src/css/form.css b/web_src/css/form.css index 7479af0c4e..66ead32762 100644 --- a/web_src/css/form.css +++ b/web_src/css/form.css @@ -448,6 +448,10 @@ textarea:focus, } } +.ui.form .field > .selection.dropdown { + min-width: 14em; /* matches the default min width */ +} + .new.webhook form .help { margin-left: 25px; } diff --git a/web_src/css/modules/container.css b/web_src/css/modules/container.css index 9f67ceb8d5..c9df6ab3f5 100644 --- a/web_src/css/modules/container.css +++ b/web_src/css/modules/container.css @@ -2,26 +2,20 @@ unused rules here after refactoring, please remove them. */ .ui.container { - display: block; - max-width: 100%; -} - -.ui.fluid.container { - width: 100%; -} - -.ui[class*="center aligned"].container { - text-align: center; -} - -/* overwrite width of containers inside the main page content div (div with class "page-content") */ -.page-content .ui.ui.ui.container:not(.fluid) { width: 1280px; max-width: calc(100% - calc(2 * var(--page-margin-x))); margin-left: auto; margin-right: auto; } +.ui.fluid.container { + width: 100%; +} + .ui.container.fluid.padded { padding: 0 var(--page-margin-x); } + +.ui[class*="center aligned"].container { + text-align: center; +} diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 7695b632b4..f02b2b7578 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -2860,6 +2860,10 @@ tbody.commit-list { margin-top: 4px; } +.ui.dropdown.branch-selector-dropdown .scrolling.menu { + max-width: min(400px, 90vw); +} + .branch-selector-dropdown .branch-dropdown-button { margin: 0; max-width: 340px; @@ -2909,6 +2913,8 @@ tbody.commit-list { } .branch-selector-dropdown .menu .item .rss-icon { + position: absolute; + right: 4px; visibility: hidden; /* only show RSS icon on hover */ } diff --git a/web_src/js/components/RepoBranchTagSelector.vue b/web_src/js/components/RepoBranchTagSelector.vue index 8a741b68da..87530225e3 100644 --- a/web_src/js/components/RepoBranchTagSelector.vue +++ b/web_src/js/components/RepoBranchTagSelector.vue @@ -246,7 +246,7 @@ export function initRepoBranchTagSelector(selector) { export default sfc; // activate IDE's Vue plugin