Skip to content

Commit 45bf116

Browse files
fix: workspace home model count submenus showing for every model on open (#569)
Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
1 parent e93a322 commit 45bf116

File tree

1 file changed

+47
-4
lines changed

1 file changed

+47
-4
lines changed

src/styles/workspace-home.css

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,20 +227,28 @@
227227
}
228228

229229
.workspace-home-model-dropdown {
230-
width: 190px !important;
230+
min-width: 190px !important;
231+
width: max-content !important;
231232
}
232233

233234
.workspace-home-model-option {
234235
position: relative;
235236
display: flex;
236237
align-items: center;
238+
width: 100%;
237239
border-radius: 8px;
238240
}
239241

240242
.workspace-home-model-option .workspace-home-model-toggle {
241-
width: 175px;
242-
flex: 1;
243-
justify-content: space-between;
243+
min-width: 175px;
244+
width: 100%;
245+
flex: 1 1 auto;
246+
padding-right: 48px;
247+
}
248+
249+
.workspace-home-model-option .workspace-home-model-toggle .ds-popover-item-label {
250+
flex: none;
251+
white-space: nowrap;
244252
}
245253

246254
.workspace-home-model-option.is-active .workspace-home-model-toggle,
@@ -270,6 +278,7 @@
270278
min-width: 80px;
271279
padding: 6px;
272280
opacity: 0;
281+
visibility: hidden;
273282
pointer-events: none;
274283
transform: translateX(-4px);
275284
transition: opacity 120ms ease, transform 120ms ease;
@@ -288,6 +297,7 @@
288297
.workspace-home-model-option:hover .workspace-home-model-submenu,
289298
.workspace-home-model-option:focus-within .workspace-home-model-submenu {
290299
opacity: 1;
300+
visibility: visible;
291301
pointer-events: auto;
292302
transform: translateX(0);
293303
}
@@ -479,6 +489,39 @@
479489
}
480490
}
481491

492+
@media (max-width: 560px) {
493+
.workspace-home-model-dropdown {
494+
max-width: calc(100vw - 24px) !important;
495+
}
496+
497+
.workspace-home-model-option .workspace-home-model-toggle .ds-popover-item-label {
498+
min-width: 0;
499+
flex: 1 1 auto;
500+
white-space: normal;
501+
overflow-wrap: anywhere;
502+
word-break: break-word;
503+
}
504+
505+
.workspace-home-model-submenu {
506+
top: calc(100% + 6px);
507+
left: auto;
508+
right: 6px;
509+
transform: translateY(-4px);
510+
}
511+
512+
.workspace-home-model-submenu::before {
513+
top: -8px;
514+
left: 0;
515+
width: 100%;
516+
height: 8px;
517+
}
518+
519+
.workspace-home-model-option:hover .workspace-home-model-submenu,
520+
.workspace-home-model-option:focus-within .workspace-home-model-submenu {
521+
transform: translateY(0);
522+
}
523+
}
524+
482525
@media (max-width: 720px) {
483526
.workspace-home {
484527
padding: 24px 20px;

0 commit comments

Comments
 (0)