mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-10-09 15:58:34 +00:00
71687491f0
Keep connection dialog and chrome surfaces in sync when toggling follow-app vs manual themes, and isolate side-panel live state per tab so switching workspace tabs no longer re-renders every mounted panel. Co-authored-by: Cursor <cursoragent@cursor.com>
36 lines
995 B
TypeScript
36 lines
995 B
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
|
|
import {
|
|
getSidePanelLiveSnapshot,
|
|
sidePanelLiveStore,
|
|
SIDE_PANEL_INACTIVE_LIVE_SNAPSHOT,
|
|
} from './sidePanelLiveStore.ts';
|
|
|
|
test('sidePanelLiveStore skips notify when snapshot is unchanged', () => {
|
|
let notifications = 0;
|
|
const unsubscribe = sidePanelLiveStore.subscribe(() => {
|
|
notifications += 1;
|
|
});
|
|
|
|
const snapshot = {
|
|
...SIDE_PANEL_INACTIVE_LIVE_SNAPSHOT,
|
|
activeTerminalCwd: '/tmp',
|
|
};
|
|
sidePanelLiveStore.update(snapshot);
|
|
sidePanelLiveStore.update({ ...snapshot });
|
|
unsubscribe();
|
|
|
|
assert.equal(notifications, 1);
|
|
});
|
|
|
|
test('getSidePanelLiveSnapshot returns inactive snapshot when disabled', () => {
|
|
sidePanelLiveStore.update({
|
|
...SIDE_PANEL_INACTIVE_LIVE_SNAPSHOT,
|
|
activeTerminalCwd: '/var/log',
|
|
});
|
|
|
|
assert.equal(getSidePanelLiveSnapshot(false), SIDE_PANEL_INACTIVE_LIVE_SNAPSHOT);
|
|
assert.equal(getSidePanelLiveSnapshot(true).activeTerminalCwd, '/var/log');
|
|
});
|