Compare commits

...
Author SHA1 Message Date
陈大猫 894dd85ab2 ci: retrigger lint-and-test after plugin-contract runner shutdown 2026-11-08 12:15:56 +08:00
陈大猫 94f03aafc5 fix(system-manager): show all CPU cores in the overview list
The overview CPU card hardcoded cpuPerCore.slice(0, 12), so a 16-thread
host showed "16 核" at the top but only C1–C12 below. Render every
reported core and allow the list to scroll when it overflows.

Fixes #4183
2026-11-08 11:41:38 +08:00
2 changed files with 15 additions and 2 deletions

No files matched your search

@@ -0,0 +1,13 @@
import test from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
test("overview CPU cores list renders every reported core and can scroll", () => {
const source = readFileSync(new URL("./SystemOverviewTab.tsx", import.meta.url), "utf8");
assert.doesNotMatch(source, /cpuPerCore\.slice\(/);
assert.match(
source,
/className="grid grid-cols-2 gap-x-3 gap-y-1\.5 max-h-\[\d+px\] overflow-y-auto pr-1 overscroll-contain"/,
);
});
@@ -358,8 +358,8 @@ export const SystemOverviewTab = memo(function SystemOverviewTab({
</span>
</div>
{stats.cpuPerCore.length > 0 ? (
<div className="grid grid-cols-2 gap-x-3 gap-y-1.5">
{stats.cpuPerCore.slice(0, 12).map((core, index) => (
<div className="grid grid-cols-2 gap-x-3 gap-y-1.5 max-h-[260px] overflow-y-auto pr-1 overscroll-contain">
{stats.cpuPerCore.map((core, index) => (
<ResourceBar key={`core-${index}`} label={`C${index + 1}`} value={core} />
))}
</div>