Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions res/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
--z-copy-table-warning: 4;
--z-tree-view: 0;
--z-tree-view-inner: 2;
--z-tree-view-header-divider: 1;
--z-overflow-edge-indicator: 3;
--z-chart-viewport-expanded: 1;
--z-timeline-selection: 1;
Expand Down
30 changes: 15 additions & 15 deletions src/components/calltree/CallTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class CallTreeImpl extends PureComponent<Props> {
{
propName: 'totalPercent',
titleL10nId: '',
initialWidth: 50,
initialWidth: 55,
hideDividerAfter: true,
},
{
Expand All @@ -120,28 +120,28 @@ class CallTreeImpl extends PureComponent<Props> {
minWidth: 30,
initialWidth: 70,
resizable: true,
headerWidthAdjustment: 50,
headerWidthAdjustment: 55 /* totalPercent initialWidth */,
},
{
propName: 'self',
titleL10nId: 'CallTree--tracing-ms-self',
minWidth: 30,
initialWidth: 70,
minWidth: 40,
initialWidth: 80,
resizable: true,
},
{
propName: 'icon',
titleL10nId: '',
component: Icon as any,
initialWidth: 10,
initialWidth: 20,
},
];
case 'samples':
return [
{
propName: 'totalPercent',
titleL10nId: '',
initialWidth: 50,
initialWidth: 55,
hideDividerAfter: true,
},
{
Expand All @@ -150,28 +150,28 @@ class CallTreeImpl extends PureComponent<Props> {
minWidth: 30,
initialWidth: 70,
resizable: true,
headerWidthAdjustment: 50,
headerWidthAdjustment: 55 /* totalPercent initialWidth */,
},
{
propName: 'self',
titleL10nId: 'CallTree--samples-self',
minWidth: 30,
initialWidth: 70,
minWidth: 40,
initialWidth: 80,
resizable: true,
},
{
propName: 'icon',
titleL10nId: '',
component: Icon as any,
initialWidth: 10,
initialWidth: 20,
},
];
case 'bytes':
return [
{
propName: 'totalPercent',
titleL10nId: '',
initialWidth: 50,
initialWidth: 55,
hideDividerAfter: true,
},
{
Expand All @@ -180,20 +180,20 @@ class CallTreeImpl extends PureComponent<Props> {
minWidth: 30,
initialWidth: 140,
resizable: true,
headerWidthAdjustment: 50,
headerWidthAdjustment: 55 /* totalPercent initialWidth */,
},
{
propName: 'self',
titleL10nId: 'CallTree--bytes-self',
minWidth: 30,
initialWidth: 90,
minWidth: 40,
initialWidth: 100,
resizable: true,
},
{
propName: 'icon',
titleL10nId: '',
component: Icon as any,
initialWidth: 10,
initialWidth: 20,
},
];
default:
Expand Down
12 changes: 6 additions & 6 deletions src/components/marker-table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -253,22 +253,22 @@ class MarkerTableImpl extends PureComponent<Props> {
{
propName: 'start',
titleL10nId: 'MarkerTable--start',
minWidth: 30,
initialWidth: 90,
minWidth: 35,
initialWidth: 95,
resizable: true,
},
{
propName: 'duration',
titleL10nId: 'MarkerTable--duration',
minWidth: 30,
initialWidth: 80,
minWidth: 40,
initialWidth: 90,
resizable: true,
},
{
propName: 'name',
titleL10nId: 'MarkerTable--name',
minWidth: 30,
initialWidth: 150,
minWidth: 40,
initialWidth: 160,
resizable: true,
},
];
Expand Down
37 changes: 30 additions & 7 deletions src/components/shared/TreeView.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
}

.treeViewHeader {
height: 15px;
padding: 4px 0;
height: 23px;
border-bottom: 1px solid var(--base-border-color);
background: var(--raised-background-color);
color: var(--raised-foreground-color);
Expand Down Expand Up @@ -118,33 +117,57 @@
white-space: nowrap;
}

.treeViewHeaderColumn,
.treeViewRowColumn,
.treeViewRowScrolledColumns {
box-sizing: border-box;
padding-right: 5px;
padding-left: 5px;
}

.treeViewFixedColumn {
overflow: hidden;
text-overflow: ellipsis;
}

.treeViewColumnDivider {
.treeViewHeaderColumnDivider,
.treeViewRowColumnDivider {
display: flex;
width: 20px;
width: 1px;
flex: none;
align-items: stretch;
justify-content: center;
padding-right: 5px;
padding-left: 5px;
margin-right: -5px;
margin-left: -5px;
}

.treeViewColumnDivider.isResizable,
.treeViewHeaderColumn,
.treeViewHeaderColumnDivider {
padding-top: 4px;
padding-bottom: 4px;
}

.treeViewHeaderColumnDivider.isResizable {
position: relative;
z-index: var(--z-tree-view-header-divider);
}

.treeViewHeaderColumnDivider.isResizable,
.treeView.isResizingColumns {
cursor: col-resize;
}

.treeViewColumnDivider::before {
.treeViewRowColumnDivider::before,
.treeViewHeaderColumnDivider::before {
border-right: 1px solid var(--base-border-color);
content: '';
}

.treeViewColumnDivider.isResizable::before {
.treeViewHeaderColumnDivider.isResizable::before {
width: 1px;
flex-shrink: 0;
border-left: 1px solid var(--base-border-color);
}

Expand Down
17 changes: 6 additions & 11 deletions src/components/shared/TreeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class TreeViewHeader<
{col.hideDividerAfter !== true ? (
<span
key={col.propName + 'Divider'}
className={classNames('treeViewColumnDivider', {
className={classNames('treeViewHeaderColumnDivider', {
isResizable: col.resizable,
})}
onMouseDown={
Expand Down Expand Up @@ -241,7 +241,7 @@ class TreeViewRowFixedColumns<
)}
</span>
{col.hideDividerAfter !== true ? (
<span className="treeViewColumnDivider"></span>
<span className="treeViewRowColumnDivider"></span>
) : null}
</React.Fragment>
);
Expand Down Expand Up @@ -380,14 +380,9 @@ class TreeViewRowScrolledColumns<
) : null
}
<span
className={classNames(
'treeViewRowColumn',
'treeViewMainColumn',
mainColumn.propName,
{
dim: displayData.isFrameLabel,
}
)}
className={classNames('treeViewMainColumn', mainColumn.propName, {
dim: displayData.isFrameLabel,
})}
>
{displayData.badge ? (
<Localized
Expand Down Expand Up @@ -415,7 +410,7 @@ class TreeViewRowScrolledColumns<
</span>
{appendageColumn ? (
<span
className={`treeViewRowColumn treeViewAppendageColumn ${appendageColumn.propName}`}
className={`treeViewAppendageColumn ${appendageColumn.propName}`}
>
{reactStringWithHighlightedSubstrings(
displayData[appendageColumn.propName],
Expand Down
10 changes: 5 additions & 5 deletions src/test/components/MarkerTable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,11 @@ describe('MarkerTable', function () {
);

let dividerForFirstColumn = ensureExists(
document.querySelector('.treeViewColumnDivider')
document.querySelector('.treeViewHeaderColumnDivider')
);
let firstColumn = screen.getByText('Start');
expect(firstColumn).toHaveStyle({ width: '90px' });
fireEvent.mouseDown(dividerForFirstColumn, { clientX: 90 });
expect(firstColumn).toHaveStyle({ width: '95px' });
fireEvent.mouseDown(dividerForFirstColumn, { clientX: 95 });

const body = ensureExists(document.body);

Expand Down Expand Up @@ -510,10 +510,10 @@ describe('MarkerTable', function () {

// Now double click to reset the style.
dividerForFirstColumn = ensureExists(
document.querySelector('.treeViewColumnDivider')
document.querySelector('.treeViewHeaderColumnDivider')
);
fireEvent.dblClick(dividerForFirstColumn, { detail: 2 });
expect(firstColumn).toHaveStyle({ width: '90px' });
expect(firstColumn).toHaveStyle({ width: '95px' });
});
});

Expand Down
Loading
Loading