Skip to content

Every agent's model. One place. Codex on DeepSeek, Claude Code on Kimi, from the menu bar.

gui: the usage heatmap scrolls under the app's thin thumb, not the system's bar (cybercaius on Discord)

yetone47689f9fd916
diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css
index 2c5439c32..31f2fe9f2 100644
--- a/internal/gui/assets/app.css
+++ b/internal/gui/assets/app.css
@@ -540,11 +540,12 @@ body.window :is(#view-agents, #view-sessions, #view-providers, #view-routing, #v
/* a page, a dialog and a framed editor that run longer than the window
show where the reader is in them with a thin thumb, on the Mac too
(PAMI on Discord: no page had a scrollbar) — the WebView draws the
- Mac's overlay one only while a trackpad scrolls, and a mouse never */
-body.mac :is(.view, .modal .dialog, .modal .editor.framed > .ebody)::-webkit-scrollbar { width: 8px; height: 8px; background: transparent; } /* across as thin as at the side (#1623) */
-body.mac :is(.view, .modal .dialog, .modal .editor.framed > .ebody)::-webkit-scrollbar-thumb { background: var(--faint); border: 2px solid transparent; border-radius: 8px; background-clip: padding-box; }
-body.mac :is(.view, .modal .dialog, .modal .editor.framed > .ebody)::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
-body.mac :is(.view, .modal .dialog, .modal .editor.framed > .ebody)::-webkit-scrollbar-corner { background: transparent; }
+ Mac's overlay one only while a trackpad scrolls, and a mouse never;
+ the heatmap's weeks that scroll sideways in their card too */
+body.mac :is(.view, .modal .dialog, .modal .editor.framed > .ebody, .heat-scroll)::-webkit-scrollbar { width: 8px; height: 8px; background: transparent; } /* across as thin as at the side (#1623) */
+body.mac :is(.view, .modal .dialog, .modal .editor.framed > .ebody, .heat-scroll)::-webkit-scrollbar-thumb { background: var(--faint); border: 2px solid transparent; border-radius: 8px; background-clip: padding-box; }
+body.mac :is(.view, .modal .dialog, .modal .editor.framed > .ebody, .heat-scroll)::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
+body.mac :is(.view, .modal .dialog, .modal .editor.framed > .ebody, .heat-scroll)::-webkit-scrollbar-corner { background: transparent; }
/* WebKit lays a framed editor's grid out at the full width and then lets
the 8px bar take its right edge, so a body that scrolled ran 8px wide
and scrolled sideways; the bar's room is always kept, out of the right
@@ -1314,7 +1315,10 @@ body.window .field.solo { grid-column: auto; }
.heat-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.heat-title b { font-size: 12.5px; font-weight: 600; }
.heat-title span { font-size: 11px; color: var(--muted); }
-.heat-scroll { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; padding-bottom: 4px; }
+/* no scrollbar-width: Chromium (WebView2) then drops every ::-webkit-scrollbar
+ rule and draws the system's bar under the weeks, not the app's thin thumb
+ every other list has (cybercaius on Discord) */
+.heat-scroll { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; padding-bottom: 4px; }
.heat-grid { display: grid; grid-template-columns: auto repeat(53, minmax(10px, 1fr)); grid-template-rows: auto repeat(7, auto); gap: 3px; min-width: min-content; max-width: calc(3em + 53 * 21px); font-size: 10px; color: var(--muted); }
.heat-grid i { aspect-ratio: 1; border-radius: 3px; min-width: 0; }
.heat-grid i:hover { outline: 1px solid var(--fg-2); outline-offset: -1px; }
diff --git a/internal/gui/tests/heatmap-scrollbar.test.cjs b/internal/gui/tests/heatmap-scrollbar.test.cjs
new file mode 100644
index 000000000..55149107a
--- /dev/null
+++ b/internal/gui/tests/heatmap-scrollbar.test.cjs
@@ -0,0 +1,55 @@
+// Run with Node's test runner and Playwright on the module path; see README.md.
+// cybercaius on Discord: the usage heatmap's scrollbar looked out of place
+// beside the rest of the window. Its weeks scrolled under scrollbar-width:
+// thin, which in Chromium (so WebView2) drops every ::-webkit-scrollbar rule
+// and draws the system's bar, and on a Mac left the overlay bar a mouse never
+// shows. The weeks now scroll under the same thin thumb as the page around
+// them: the same gutter as a .view's, on a Mac and off one, in both engines.
+const assert = require("node:assert/strict");
+const fs = require("node:fs/promises");
+const path = require("node:path");
+const { test } = require("node:test");
+const playwright = require("playwright");
+
+const css = path.resolve(__dirname, "../assets/app.css");
+const engines = process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"];
+
+async function gutters(engine, mac) {
+ // headless Chromium hides scrollbars unless asked not to
+ const browser = await playwright[engine].launch(engine === "chromium" ? { ignoreDefaultArgs: ["--hide-scrollbars"] } : {});
+ try {
+ const page = await browser.newPage({ viewport: { width: 420, height: 400 } });
+ const cells = Array.from({ length: 53 * 7 }, () => "<i></i>").join("");
+ await page.setContent(`<style>${await fs.readFile(css, "utf8")}</style>
+ <body class="window${mac ? " mac" : ""}">
+ <div class="view" id="v" style="height:300px;overflow:auto;display:block"><div style="height:900px;width:2000px">
+ <div class="led-heat" style="width:360px"><div class="heat-scroll" id="h"><div class="heat-grid"><span></span>${cells}</div></div></div>
+ </div></div>
+ </body>`);
+ return await page.evaluate(() => {
+ const bar = (el, side) => {
+ const cs = getComputedStyle(el);
+ return side === "bottom"
+ ? el.offsetHeight - el.clientHeight - parseFloat(cs.borderTopWidth) - parseFloat(cs.borderBottomWidth)
+ : el.offsetWidth - el.clientWidth - parseFloat(cs.borderLeftWidth) - parseFloat(cs.borderRightWidth);
+ };
+ const h = document.querySelector("#h");
+ const v = document.querySelector("#v");
+ return { scrolls: h.scrollWidth > h.clientWidth, width: getComputedStyle(h).scrollbarWidth, heat: bar(h, "bottom"), view: bar(v, "right") };
+ });
+ } finally {
+ await browser.close();
+ }
+}
+
+for (const engine of engines) {
+ for (const mac of [false, true]) {
+ test(`${engine}${mac ? ", on a Mac" : ", off a Mac"}: the heatmap's weeks scroll under the app's thin thumb, as the page does`, async () => {
+ const g = await gutters(engine, mac);
+ assert.ok(g.scrolls, "a narrow card's weeks overflow: " + JSON.stringify(g));
+ assert.equal(g.width, "auto", "no scrollbar-width, or Chromium draws the system's bar: " + JSON.stringify(g));
+ assert.ok(g.view > 0, "the page draws its thumb: " + JSON.stringify(g));
+ assert.equal(g.heat, g.view, "the heatmap's bar is the page's: " + JSON.stringify(g));
+ });
+ }
+}