Extend the header speed sparkline

Use twelve pixels of unused zero-speed label spacing for a longer graph while preserving the overall header control width and room for wider speed values.
This commit is contained in:
Sucukdeluxe
2026-08-26 15:07:54 +02:00
parent 5931c8de75
commit a087e11b52
2 changed files with 12 additions and 5 deletions
+8 -1
View File
@@ -557,7 +557,7 @@ describe("bandwidth chart palette", () => {
expect(theme).toMatch(/:focus-visible\s*\{[^}]*outline:\s*2px solid var\(--ui-focus\);/s);
expect(shell).toContain("color: var(--ui-update-text);");
expect(collector.match(/color:\s*var\(--ui-primary-text\);/g)).toHaveLength(3);
expect(collector.match(/color:\s*var\(--ui-primary-text\);/g)).toHaveLength(1);
});
it("requests only the semantic UI color properties and keeps the computed font family", () => {
@@ -593,6 +593,13 @@ describe("bandwidth chart palette", () => {
expect(palette).toEqual({ accent: "rgb(74, 222, 128)" });
});
it("uses the spare zero-speed label space for a longer sparkline", () => {
const css = readFileSync(new URL("../src/renderer/styles.css", import.meta.url), "utf8");
expect(css).toMatch(/\.speed-sparkline-canvas\s*\{[^}]*width:\s*128px;/s);
expect(css).toMatch(/\.speed-sparkline-value\s*\{[^}]*min-width:\s*54px;/s);
});
it("aligns the idle speed line to one physical pixel at every display scale", () => {
expect(getIdleSparklineStroke(22, 1)).toEqual({ y: 20.5, lineWidth: 1 });
expect(getIdleSparklineStroke(22, 1.25)).toEqual({ y: 20.4, lineWidth: 0.8 });