Skip to content

Commit

Permalink
Add shadow to table head (#1835)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
rogermparent and mattseddon authored Jun 10, 2022
1 parent 8eecddf commit d22127e
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 22 deletions.
25 changes: 12 additions & 13 deletions webview/src/experiments/components/table/MergeHeaderGroups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,21 @@ export const MergedHeaderGroups: React.FC<{
return (
<div
{...headerGroup.getHeaderGroupProps({
className: cx(styles.tr, styles.headerRow)
className: cx(styles.tr, styles.headRow)
})}
>
{headerGroup.headers.map((column: HeaderGroup<Experiment>) => (
<div key={column.id}>
<TableHeader
orderedColumns={orderedColumns}
column={column}
columns={columns}
sorts={sorts}
filters={filters}
onDragOver={onDragUpdate}
onDragStart={onDragStart}
onDrop={onDragEnd}
/>
</div>
<TableHeader
key={column.id}
orderedColumns={orderedColumns}
column={column}
columns={columns}
sorts={sorts}
filters={filters}
onDragOver={onDragUpdate}
onDragStart={onDragStart}
onDrop={onDragEnd}
/>
))}
</div>
)
Expand Down
1 change: 1 addition & 0 deletions webview/src/experiments/components/table/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export const RowContent: React.FC<
className: cx(
className,
styles.tr,
styles.bodyRow,
getExperimentTypeClass(original),
flatIndex % 2 === 0 || styles.oddRow,
isWorkspace ? styles.workspaceRow : styles.normalRow,
Expand Down
5 changes: 4 additions & 1 deletion webview/src/experiments/components/table/TableHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ const getHeaderPropsArgs = (
[styles.sortingHeaderCellDesc]:
sortOrder === SortOrder.DESCENDING && !column.placeholderOf
}
)
),
style: {
position: undefined
}
}
}

Expand Down
24 changes: 16 additions & 8 deletions webview/src/experiments/components/table/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -251,25 +251,27 @@ $workspace-row-edge-margin: $edge-padding - $cell-padding;
width: 1rem;
}

.thead {
border-bottom: $row-border;
}

.tr {
position: relative;
& > *:first-child {
background-color: $row-bg-color;
position: sticky;
left: 0;
z-index: 3;
border-right: 2px solid var(--editor-foreground-transparency-4);
}

&.oddRow > *:first-child {
background-color: $row-bg-alt-color;
}
}

.headerRow {
.bodyRow {
& > *:first-child {
background-color: $row-bg-color;
}
}

.headRow {
font-size: 0.7rem;

.headerCellWrapper {
Expand All @@ -286,6 +288,10 @@ $workspace-row-edge-margin: $edge-padding - $cell-padding;
}
}

& > *:first-child {
background-color: $header-bg-color;
}

&:last-child,
.firstLevelHeader {
.paramHeaderCell,
Expand Down Expand Up @@ -387,7 +393,7 @@ $workspace-row-edge-margin: $edge-padding - $cell-padding;
position: relative;
}
.th {
height: 100%;
height: auto;
}
.td {
height: auto;
Expand Down Expand Up @@ -557,8 +563,10 @@ $workspace-row-edge-margin: $edge-padding - $cell-padding;
}

.thead {
background-color: $bg-color;
border-bottom: $row-border;
box-shadow: 0 5px 8px -2px var(--vscode-widget-shadow);
position: sticky;
top: 0;
z-index: 4;
background-color: $bg-color;
}

0 comments on commit d22127e

Please sign in to comment.