Skip to content

Commit d22127e

Browse files
Add shadow to table head (#1835)
* Add width/height: 100% styles in Storybook preview * Add shadow to sticky header * Remove preview marker from marketplace listing (#1860) * Add init to command palette when there is no DVC project in the workspace (#1861) * Upgrade dev dependencies and resolutions (security) (#1864) * Remove div wrapper on header cells and add special exp cell border * Make head and body rows have different background colors * Fix style suppression Co-authored-by: mattseddon <[email protected]>
1 parent 8eecddf commit d22127e

File tree

4 files changed

+33
-22
lines changed

4 files changed

+33
-22
lines changed

webview/src/experiments/components/table/MergeHeaderGroups.tsx

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,21 @@ export const MergedHeaderGroups: React.FC<{
3333
return (
3434
<div
3535
{...headerGroup.getHeaderGroupProps({
36-
className: cx(styles.tr, styles.headerRow)
36+
className: cx(styles.tr, styles.headRow)
3737
})}
3838
>
3939
{headerGroup.headers.map((column: HeaderGroup<Experiment>) => (
40-
<div key={column.id}>
41-
<TableHeader
42-
orderedColumns={orderedColumns}
43-
column={column}
44-
columns={columns}
45-
sorts={sorts}
46-
filters={filters}
47-
onDragOver={onDragUpdate}
48-
onDragStart={onDragStart}
49-
onDrop={onDragEnd}
50-
/>
51-
</div>
40+
<TableHeader
41+
key={column.id}
42+
orderedColumns={orderedColumns}
43+
column={column}
44+
columns={columns}
45+
sorts={sorts}
46+
filters={filters}
47+
onDragOver={onDragUpdate}
48+
onDragStart={onDragStart}
49+
onDrop={onDragEnd}
50+
/>
5251
))}
5352
</div>
5453
)

webview/src/experiments/components/table/Row.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ export const RowContent: React.FC<
149149
className: cx(
150150
className,
151151
styles.tr,
152+
styles.bodyRow,
152153
getExperimentTypeClass(original),
153154
flatIndex % 2 === 0 || styles.oddRow,
154155
isWorkspace ? styles.workspaceRow : styles.normalRow,

webview/src/experiments/components/table/TableHeader.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ const getHeaderPropsArgs = (
105105
[styles.sortingHeaderCellDesc]:
106106
sortOrder === SortOrder.DESCENDING && !column.placeholderOf
107107
}
108-
)
108+
),
109+
style: {
110+
position: undefined
111+
}
109112
}
110113
}
111114

webview/src/experiments/components/table/styles.module.scss

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,25 +251,27 @@ $workspace-row-edge-margin: $edge-padding - $cell-padding;
251251
width: 1rem;
252252
}
253253

254-
.thead {
255-
border-bottom: $row-border;
256-
}
257-
258254
.tr {
259255
position: relative;
260256
& > *:first-child {
261-
background-color: $row-bg-color;
262257
position: sticky;
263258
left: 0;
264259
z-index: 3;
260+
border-right: 2px solid var(--editor-foreground-transparency-4);
265261
}
266262

267263
&.oddRow > *:first-child {
268264
background-color: $row-bg-alt-color;
269265
}
270266
}
271267

272-
.headerRow {
268+
.bodyRow {
269+
& > *:first-child {
270+
background-color: $row-bg-color;
271+
}
272+
}
273+
274+
.headRow {
273275
font-size: 0.7rem;
274276

275277
.headerCellWrapper {
@@ -286,6 +288,10 @@ $workspace-row-edge-margin: $edge-padding - $cell-padding;
286288
}
287289
}
288290

291+
& > *:first-child {
292+
background-color: $header-bg-color;
293+
}
294+
289295
&:last-child,
290296
.firstLevelHeader {
291297
.paramHeaderCell,
@@ -387,7 +393,7 @@ $workspace-row-edge-margin: $edge-padding - $cell-padding;
387393
position: relative;
388394
}
389395
.th {
390-
height: 100%;
396+
height: auto;
391397
}
392398
.td {
393399
height: auto;
@@ -557,8 +563,10 @@ $workspace-row-edge-margin: $edge-padding - $cell-padding;
557563
}
558564

559565
.thead {
566+
background-color: $bg-color;
567+
border-bottom: $row-border;
568+
box-shadow: 0 5px 8px -2px var(--vscode-widget-shadow);
560569
position: sticky;
561570
top: 0;
562571
z-index: 4;
563-
background-color: $bg-color;
564572
}

0 commit comments

Comments
 (0)