Skip to content

Commit 9ae973b

Browse files
authored
Merge pull request #1863 from binaricat/codex/fix-cpu-core-scroll
[codex] Fix CPU core stats scrolling
2 parents 2f7059f + fd3552d commit 9ae973b

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import test from "node:test";
2+
import assert from "node:assert/strict";
3+
import { readFileSync } from "node:fs";
4+
5+
test("CPU per-core stats list can scroll when many cores are reported", () => {
6+
const source = readFileSync(new URL("./TerminalServerStats.tsx", import.meta.url), "utf8");
7+
8+
assert.match(
9+
source,
10+
/className="grid gap-1\.5 max-h-\[\d+px\] overflow-y-auto/,
11+
);
12+
});

components/terminal/TerminalServerStats.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const TerminalServerStats: React.FC<TerminalServerStatsProps> = ({
7777
<div className="text-xs space-y-2">
7878
<div className="font-medium text-sm mb-2">{t("terminal.serverStats.cpuCores")}</div>
7979
{serverStats.cpuPerCore.length > 0 ? (
80-
<div className="grid gap-1.5" style={{ gridTemplateColumns: `repeat(${Math.min(4, serverStats.cpuPerCore.length)}, 1fr)` }}>
80+
<div className="grid gap-1.5 max-h-[260px] overflow-y-auto pr-1 overscroll-contain" style={{ gridTemplateColumns: `repeat(${Math.min(4, serverStats.cpuPerCore.length)}, 1fr)` }}>
8181
{serverStats.cpuPerCore.map((usage, index) => (
8282
<div key={index} className="flex flex-col items-center gap-1 min-w-[48px]">
8383
<div className="text-[10px] text-muted-foreground">Core {index}</div>

0 commit comments

Comments
 (0)