Fit the speed value pill to decimal peak rates

Tighten the fixed speed label module to nine character units with seven-pixel padding while preserving enough room for values such as 300.5 MB/s without moving the graph.
This commit is contained in:
Sucukdeluxe
2026-08-26 15:40:57 +02:00
parent dcb088feec
commit 6116e212db
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -643,10 +643,10 @@ body,
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end; justify-content: flex-end;
flex: 0 0 10ch; flex: 0 0 9ch;
width: 10ch; width: 9ch;
min-width: 10ch; min-width: 9ch;
padding: 0 8px; padding: 0 7px;
font-size: 12px; font-size: 12px;
font-weight: 600; font-weight: 600;
font-variant-numeric: tabular-nums; font-variant-numeric: tabular-nums;
+1 -1
View File
@@ -598,7 +598,7 @@ describe("bandwidth chart palette", () => {
const source = readFileSync(new URL("../src/renderer/App.tsx", import.meta.url), "utf8"); const source = readFileSync(new URL("../src/renderer/App.tsx", import.meta.url), "utf8");
expect(css).toMatch(/\.speed-sparkline-canvas\s*\{[^}]*width:\s*150px;/s); expect(css).toMatch(/\.speed-sparkline-canvas\s*\{[^}]*width:\s*150px;/s);
expect(css).toMatch(/\.speed-sparkline-value\s*\{[^}]*flex:\s*0 0 10ch;[^}]*width:\s*10ch;[^}]*min-width:\s*10ch;[^}]*padding:\s*0 8px;/s); expect(css).toMatch(/\.speed-sparkline-value\s*\{[^}]*flex:\s*0 0 9ch;[^}]*width:\s*9ch;[^}]*min-width:\s*9ch;[^}]*padding:\s*0 7px;/s);
expect(source).toContain('className="speed-sparkline-graph"'); expect(source).toContain('className="speed-sparkline-graph"');
expect(css).toMatch(/\.speed-sparkline-graph,\s*\.speed-sparkline-value\s*\{[^}]*background:\s*var\(--field\);[^}]*border:\s*1px solid var\(--border\);[^}]*border-radius:\s*8px;/s); expect(css).toMatch(/\.speed-sparkline-graph,\s*\.speed-sparkline-value\s*\{[^}]*background:\s*var\(--field\);[^}]*border:\s*1px solid var\(--border\);[^}]*border-radius:\s*8px;/s);
}); });