Skip to content

Commit 714bb68

Browse files
committed
Add titles various items in artifact table
1 parent 495fb6c commit 714bb68

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

site/frontend/src/pages/compare/artifact-size/artifact-size-table.vue

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ function formatValue(value: number | undefined): string {
4444
return formatSize(value);
4545
}
4646
47+
function formatChangeTitle(
48+
a: number | undefined,
49+
b: number | undefined
50+
): string {
51+
if (!isValidValue(a) || !isValidValue(b)) {
52+
return "";
53+
}
54+
return (b - a).toLocaleString();
55+
}
56+
4757
function formatChange(a: number | undefined, b: number | undefined): string {
4858
if (!isValidValue(a) || !isValidValue(b)) {
4959
return "-";
@@ -108,12 +118,18 @@ function generateTitle(component: string): string {
108118
{{ isLibrary(component) ? "Library" : "Binary" }}
109119
</td>
110120
<td>
111-
<div class="aligned">
121+
<div
122+
class="aligned"
123+
:title="a.component_sizes[component].toLocaleString()"
124+
>
112125
{{ formatValue(a.component_sizes[component]) }}
113126
</div>
114127
</td>
115128
<td>
116-
<div class="aligned">
129+
<div
130+
class="aligned"
131+
:title="b.component_sizes[component].toLocaleString()"
132+
>
117133
{{ formatValue(b.component_sizes[component]) }}
118134
</div>
119135
</td>
@@ -125,7 +141,15 @@ function generateTitle(component: string): string {
125141
)
126142
"
127143
>
128-
<div class="aligned">
144+
<div
145+
class="aligned"
146+
:title="
147+
formatChangeTitle(
148+
a.component_sizes[component],
149+
b.component_sizes[component]
150+
)
151+
"
152+
>
129153
{{
130154
formatChange(
131155
a.component_sizes[component],

0 commit comments

Comments
 (0)