Files
Netcatty/application/app/AppView.activeTabIsolation.test.ts
T
bincxz 57af825706 perf(app): cut remaining top-tab switch jank on the renderer path
Stop AppView from re-subscribing to activeTabId so shell composition no
longer rebuilds on every top-tab click; move plugin keybindings and host
editor surface visibility into leaf subscribers. Patch session-restore
activeTabId without re-serializing every session on tab switches, defer
chrome theme CSS work with fingerprint short-circuit + rAF, let terminal
workspace chrome read active workspace from the live store, apply TopTabs
presentation per tab, and keep hibernate wake chunked/idle with leaner
focus scheduling.
2026-07-30 22:33:31 +08:00

24 lines
1.2 KiB
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
const appViewSource = readFileSync(new URL("./AppView.tsx", import.meta.url), "utf8");
const pluginHostSource = readFileSync(new URL("./AppPluginKeybindingHost.tsx", import.meta.url), "utf8");
const editorSurfaceSource = readFileSync(new URL("./AppHostEditorSurface.tsx", import.meta.url), "utf8");
test("AppView shell does not subscribe to useActiveTabId", () => {
// Top-tab switches must not rebuild the AppView shell. Leaves own the subscription.
assert.doesNotMatch(appViewSource, /useActiveTabId\s*\(/);
assert.doesNotMatch(appViewSource, /useActiveTabId/);
// Still uses activeTabStore for imperative tab close / neighbor activation.
assert.match(appViewSource, /activeTabStore/);
});
test("plugin keybindings and host-editor surface subscribe as leaves", () => {
assert.match(pluginHostSource, /useActiveTabId/);
assert.match(pluginHostSource, /resolveActivePluginKeybindingContext/);
assert.match(editorSurfaceSource, /useWorkSurfaceVisible/);
assert.match(editorSurfaceSource, /useActiveTabId/);
assert.match(appViewSource, /AppPluginKeybindingHost/);
});