mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-10-09 15:58:34 +00:00
037b85bd66
Replace immersive instant-switch with animated active chrome theme sync so top tabs match terminal sessions immediately on tab click, and clamp autocomplete popups to the active pane so they stay anchored to the cursor in split workspaces. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
1.1 KiB
TypeScript
21 lines
1.1 KiB
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import { readFileSync } from "node:fs";
|
|
|
|
test("active tab changes notify chrome theme before react subscribers", () => {
|
|
const storeSource = readFileSync(new URL("./activeTabStore.ts", import.meta.url), "utf8");
|
|
const syncSource = readFileSync(new URL("./activeChromeThemeSync.ts", import.meta.url), "utf8");
|
|
|
|
const setActiveTabIdBody = storeSource.match(/setActiveTabId = \(id: string\) => \{[\s\S]*?\n {2}\};/)?.[0] ?? "";
|
|
assert.match(setActiveTabIdBody, /this\.syncListeners\.forEach\(\(listener\) => listener\(id\)\)/);
|
|
assert.match(setActiveTabIdBody, /this\.scheduleNotify\(\)/);
|
|
assert.ok(
|
|
setActiveTabIdBody.indexOf("syncListeners.forEach") < setActiveTabIdBody.indexOf("scheduleNotify"),
|
|
"sync chrome theme listeners must run before deferred react notify",
|
|
);
|
|
assert.match(syncSource, /activeTabStore\.subscribeSync\(notifyActiveChromeThemeForTab\)/);
|
|
assert.match(syncSource, /isActiveChromeThemeResolvable/);
|
|
assert.match(syncSource, /clearTopTabsChromeThemeVars/);
|
|
});
|