Skip to content

Commit a4bd257

Browse files
committed
Update UI based on UX recommendations
1 parent f3debee commit a4bd257

File tree

2 files changed

+77
-32
lines changed

2 files changed

+77
-32
lines changed

src/components/ProblemsTable.scss

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,47 @@
77
height: 100%;
88
flex: 1;
99
min-height: 0;
10+
11+
[class*='table-header'] [class*='table-cell'] {
12+
min-height: 32px;
13+
padding-block: 4px;
14+
}
15+
16+
// Hide filter button by default, show on hover
17+
[class*='table-header-actions-container'] button,
18+
.iui-table-header-actions-container button {
19+
&[class*='table-filter-button'],
20+
&.iui-table-filter-button {
21+
opacity: 0;
22+
visibility: hidden;
23+
transition: opacity 0.2s ease, visibility 0.2s ease;
24+
}
25+
}
26+
27+
// Show filter button when hovering over the header cell
28+
[class*='table-header'] [class*='table-cell']:hover,
29+
thead th:hover {
30+
[class*='table-header-actions-container'] button,
31+
.iui-table-header-actions-container button {
32+
&[class*='table-filter-button'],
33+
&.iui-table-filter-button {
34+
opacity: 1;
35+
visibility: visible;
36+
}
37+
}
38+
}
39+
40+
// Keep filter button visible when it's active
41+
[class*='table-header-actions-container'] button[data-iui-active='true'],
42+
.iui-table-header-actions-container button[data-iui-active='true'],
43+
[class*='table-header-actions-container'] button:focus-visible,
44+
.iui-table-header-actions-container button:focus-visible {
45+
&[class*='table-filter-button'],
46+
&.iui-table-filter-button {
47+
opacity: 1;
48+
visibility: visible;
49+
}
50+
}
1051
}
1152

1253
.isr-problems-message {
@@ -53,8 +94,10 @@
5394
min-width: 360px;
5495
border-radius: 2px;
5596
top: -6%;
97+
5698
.tour-Container {
5799
padding: 12px 12px 12px 12px;
100+
58101
.tour-arrow-left {
59102
position: absolute;
60103
background: #fff;
@@ -90,6 +133,7 @@
90133
border-width: 12px;
91134
margin-top: -12px;
92135
}
136+
93137
.tour-Got-It {
94138
padding: 10px 10px 10px 10px;
95139
border: none;

src/components/ProblemsTable.tsx

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,38 @@ export const ProblemsTable = ({
296296
const columns = React.useMemo(
297297
() =>
298298
[
299+
{
300+
id: 'level',
301+
accessor: 'level',
302+
Header: displayStrings.level,
303+
Filter: tableFilters.TextFilter(),
304+
minWidth: 50,
305+
maxWidth: 170,
306+
sortType: sortByLevel,
307+
cellRenderer: ({ cellElementProps, cellProps }: CellRendererProps<Report>) => {
308+
const level = cellProps.row.original.level;
309+
const _isError = level === 'Error' || level === 'Fatal' || level === 'Critical';
310+
const _isWarning = level === 'Warning';
311+
312+
return (
313+
<DefaultCell
314+
cellElementProps={cellElementProps}
315+
cellProps={cellProps}
316+
startIcon={
317+
_isError ? (
318+
<StatusIcon status='error' />
319+
) : _isWarning ? (
320+
<StatusIcon status='warning' />
321+
) : level ? (
322+
<StatusIcon status='informational' />
323+
) : undefined
324+
}
325+
>
326+
{level}
327+
</DefaultCell>
328+
);
329+
},
330+
},
299331
{
300332
id: 'issueid',
301333
accessor: 'issueid',
@@ -333,38 +365,6 @@ export const ProblemsTable = ({
333365
return <div>{row.value}</div>;
334366
},
335367
},
336-
{
337-
id: 'level',
338-
accessor: 'level',
339-
Header: displayStrings.level,
340-
Filter: tableFilters.TextFilter(),
341-
minWidth: 50,
342-
maxWidth: 170,
343-
sortType: sortByLevel,
344-
cellRenderer: ({ cellElementProps, cellProps }: CellRendererProps<Report>) => {
345-
const level = cellProps.row.original.level;
346-
const _isError = level === 'Error' || level === 'Fatal' || level === 'Critical';
347-
const _isWarning = level === 'Warning';
348-
349-
return (
350-
<DefaultCell
351-
cellElementProps={cellElementProps}
352-
cellProps={cellProps}
353-
startIcon={
354-
_isError ? (
355-
<StatusIcon status='error' />
356-
) : _isWarning ? (
357-
<StatusIcon status='warning' />
358-
) : level ? (
359-
<StatusIcon status='informational' />
360-
) : undefined
361-
}
362-
>
363-
{level}
364-
</DefaultCell>
365-
);
366-
},
367-
},
368368
{
369369
id: 'fileName',
370370
accessor: ({ fileName, fileId }: Partial<Report>) => fileName ?? getFileNameFromId(fileId),
@@ -519,6 +519,7 @@ export const ProblemsTable = ({
519519
<Table
520520
onRowClick={onRowClick}
521521
selectRowOnClick
522+
density='condensed'
522523
className={classnames('isr-problems-table', className)}
523524
columns={reorderColumn(columns) as Column<Record<string, any>>[]}
524525
data={data}

0 commit comments

Comments
 (0)