Skip to content

Commit 4d955b4

Browse files
authored
fix: allow overflow scroll for widget list and dashboard overlow list. (#2558)
Dashboard list overflows, but would not be selectable, made selectable and extend over to overflow. Panels list would wrap text (which worked before it was a spectrum list, which now needs same height items), now overflow scroll on x and y. Before: <img width="373" height="396" alt="image" src="https://github.com/user-attachments/assets/0e163165-363e-4375-a6a2-da49641ec545" /> After: <img width="361" height="402" alt="image" src="https://github.com/user-attachments/assets/e8fc258d-ea3b-4533-8051-cc2968fa04c5" />
1 parent e076af5 commit 4d955b4

File tree

5 files changed

+30
-33
lines changed

5 files changed

+30
-33
lines changed

packages/code-studio/src/main/WidgetList.scss

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ $widget-list-owner-hover-color: $gray-200;
99

1010
.widget-list-container {
1111
height: 25.6rem;
12-
padding: 0 0.5rem;
1312
text-align: left;
1413
width: 23rem;
1514

@@ -22,11 +21,21 @@ $widget-list-owner-hover-color: $gray-200;
2221
outline: none;
2322
}
2423

24+
.widget-list-header {
25+
padding: $spacer-2 $spacer-2 $spacer $spacer-2;
26+
}
27+
28+
.widget-list-footer {
29+
padding: $spacer-2;
30+
}
31+
2532
.widget-list {
26-
margin: 0.5rem -0.5rem 0;
33+
display: grid;
34+
align-content: start;
2735
padding: 0;
28-
text-align: left;
36+
margin: 0;
2937
overflow: auto;
38+
3039
li {
3140
list-style: none;
3241
padding: 0;
@@ -35,12 +44,15 @@ $widget-list-owner-hover-color: $gray-200;
3544
.btn {
3645
border: none;
3746
border-radius: 0;
38-
display: block;
47+
display: flex;
48+
justify-content: flex-start;
49+
align-items: center;
3950
text-align: left;
4051
margin: 0;
4152
padding: 0.35rem 0.5rem;
4253
width: 100%;
4354
color: $widget-list-color;
55+
4456
&:hover,
4557
&:focus {
4658
color: $widget-list-hover-color;
@@ -53,14 +65,4 @@ $widget-list-owner-hover-color: $gray-200;
5365
padding: 0 $spacer-2;
5466
}
5567
}
56-
57-
.widget-list-header,
58-
.widget-list-footer {
59-
padding-top: $spacer-2;
60-
padding-bottom: $spacer-2;
61-
62-
.btn .fa-md {
63-
margin-right: $spacer-2;
64-
}
65-
}
6668
}

packages/code-studio/src/main/WidgetList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export function WidgetList(props: WidgetListProps): JSX.Element {
196196
</div>
197197
<div className="widget-list-footer">
198198
<Button kind="ghost" onClick={onExportLayout}>
199-
<div className="fa-md fa-layers">
199+
<div className="fa-md fa-layers mr-1">
200200
<FontAwesomeIcon
201201
mask={vsPreview}
202202
icon={vsArrowSmallDown}
@@ -210,7 +210,7 @@ export function WidgetList(props: WidgetListProps): JSX.Element {
210210
Export Layout
211211
</Button>
212212
<Button kind="ghost" onClick={onImportLayout}>
213-
<div className="fa-md fa-layers">
213+
<div className="fa-md fa-layers mr-1">
214214
<FontAwesomeIcon
215215
mask={vsPreview}
216216
icon={vsArrowSmallUp}

packages/components/src/navigation/DashboardList.scss

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,26 @@ $dashboard-list-color: $gray-200;
44
$dashboard-list-hover-color: $foreground;
55
$dashboard-list-background-hover-color: var(--dh-color-highlight-hover);
66

7-
$dashboard-list-owner-color: $gray-400;
8-
$dashboard-list-owner-hover-color: $gray-200;
9-
107
.dashboard-list-container {
118
height: 25.6rem;
12-
padding: 0 0.5rem;
139
text-align: left;
1410
width: 23rem;
1511

1612
&:focus {
1713
outline: none;
1814
}
1915

16+
.dashboard-list-header {
17+
padding: $spacer-2 $spacer-2 $spacer $spacer-2;
18+
}
19+
2020
.dashboard-list {
21-
margin: 0.5rem -0.5rem 0;
21+
display: grid;
22+
align-content: start;
2223
padding: 0;
23-
text-align: left;
24+
margin: 0;
2425
overflow: auto;
26+
2527
li {
2628
list-style: none;
2729
padding: 0;
@@ -51,13 +53,4 @@ $dashboard-list-owner-hover-color: $gray-200;
5153
padding: 0 $spacer-2;
5254
}
5355
}
54-
55-
.dashboard-list-header {
56-
padding-top: $spacer-2;
57-
padding-bottom: $spacer-2;
58-
59-
.btn .fa-md {
60-
margin-right: $spacer-2;
61-
}
62-
}
6356
}

packages/components/src/navigation/NavTabList.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,12 @@ $tab-control-btn-offset: -8px;
159159
}
160160

161161
.tab-controls-btn-left {
162+
background-image: linear-gradient(270deg, transparent 0%, $background 25%);
162163
margin-right: $tab-control-btn-offset;
163164
}
164165

165166
.tab-controls-btn-right {
167+
background-image: linear-gradient(90deg, transparent 0%, $background 25%);
166168
margin-left: $tab-control-btn-offset;
167169
}
168170
}

packages/components/src/navigation/NavTabList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ function NavTabList({
277277
const { children } = containerRef.current;
278278
for (let i = 0; i < children.length; i += 1) {
279279
const child = children[i] as HTMLElement;
280-
// Add 5px to right edge to account for rounding of offset values
280+
// Subtract 5px from right edge to account for rounding of offset values
281281
if (
282-
child.offsetLeft + 5 >
282+
child.offsetLeft + child.offsetWidth - 5 >
283283
containerRef.current.scrollLeft + containerRef.current.offsetWidth
284284
) {
285285
child.scrollIntoView({

0 commit comments

Comments
 (0)