Files
openidea/src/features/coverage/Coverage.module.css
T
l0ng-ai 4a5d90a91e fix(coverage): make report columns adjustable (#5331)
Make the Coverage table's Line and Branch columns adjustable. The divider next to Element gives space to the file tree, and the divider between the metrics redistributes space between them. Each column shows the full covered/total count when it has room. Compact columns keep the percentage visible and show the full count on hover.

Drag a divider or focus it and use the arrow keys. Double-click a divider to restore the default widths. The table remembers widths across reloads and fits them to smaller docks.
2026-11-23 13:52:09 +08:00

190 lines
3.4 KiB
CSS

.view {
--coverage-metrics: 2;
--coverage-tracks: minmax(0, 1fr) var(--coverage-lines-width) var(--coverage-branches-width);
--coverage-column-gap: var(--space-2);
container-type: inline-size;
height: 100%;
display: flex;
flex-direction: column;
min-height: 0;
}
.noBranches {
--coverage-metrics: 1;
--coverage-tracks: minmax(0, 1fr) var(--coverage-lines-width);
}
.tabs {
min-width: 0;
border: 0;
background: none;
}
.banner {
padding: 2px 10px;
font-size: var(--fs-small);
color: var(--fg-muted);
border-bottom: 1px solid var(--border);
}
.header,
.row {
display: grid;
grid-template-columns: var(--coverage-tracks);
align-items: center;
column-gap: var(--coverage-column-gap);
font-size: var(--fs-ui);
}
.header {
flex: none;
height: 24px;
padding-inline: 30px 14px;
border-bottom: 1px solid var(--border);
overflow: hidden;
}
.header,
.tree [role="tree"] {
scrollbar-gutter: stable;
}
.header::-webkit-scrollbar {
width: 10px;
}
.heading {
position: relative;
min-width: 0;
height: 100%;
}
.headerCell {
display: flex;
align-items: center;
width: 100%;
height: 100%;
gap: var(--space-0-5);
min-width: 0;
padding: 0;
border: 0;
background: none;
font: inherit;
color: var(--fg-secondary);
text-align: left;
cursor: default;
}
.headerCell:hover {
color: var(--fg-strong);
}
.headerCell svg {
flex: none;
}
.divider {
position: absolute;
inset-block: 0;
inset-inline-start: calc(-1 * var(--coverage-column-gap));
width: var(--coverage-column-gap);
cursor: col-resize;
touch-action: none;
}
.divider::after {
position: absolute;
inset: var(--space-1) 50% var(--space-1) auto;
width: 1px;
background: var(--border);
content: "";
}
.divider:hover::after,
.divider:focus-visible::after,
.divider:active::after {
background: var(--accent);
}
.tree {
flex: 1;
min-height: 0;
/* Keep the chevron and icon in the name column at deeper levels. */
--coverage-max-row-inset: max(
4px,
calc(100% - var(--coverage-stats-width) - var(--coverage-metrics) * var(--coverage-column-gap) - 72px)
);
}
.row {
flex: 1;
min-width: 0;
}
.name {
display: flex;
align-items: center;
gap: var(--space-1-5);
min-width: 0;
}
.icon {
flex: none;
}
.label,
.value {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.value {
font-variant-numeric: tabular-nums;
color: var(--fg-secondary);
}
@container (width < 360px) {
.header,
.tree {
--coverage-column-gap: var(--space-1);
}
}
.compactCount {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
}
.link {
padding: 0;
border: 0;
background: none;
font: inherit;
color: var(--link);
cursor: pointer;
}
.link:hover {
color: var(--link-hover);
}
.links {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-1-5);
}
/* Manage Coverage Reports */
.reports {
height: 260px;
margin: 12px;
border: 1px solid var(--border);
display: flex;
flex-direction: column;
}
.reportRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
min-width: 0;
flex: 1;
white-space: nowrap;
}
.reportDetail {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
color: var(--fg-subtle);
}
.reportTime {
flex: none;
font-size: var(--fs-small);
color: var(--fg-muted);
}
.reportsEmpty {
padding: 12px;
color: var(--fg-muted);
}