feat(config): add configuration window (#70)

This commit is contained in:
2026-05-21 04:16:21 -07:00
committed by GitHub
parent a54f03f0cd
commit dc52bc2fba
287 changed files with 14507 additions and 8134 deletions
+32 -3
View File
@@ -3,6 +3,7 @@ import assert from 'node:assert/strict';
import {
createBuildTrayMenuTemplateHandler,
createResolveTrayIconPathHandler,
shouldShowTexthookerTrayEntry,
} from './tray-main-actions';
test('resolve tray icon path handler forwards runtime dependencies', () => {
@@ -47,7 +48,6 @@ test('build tray template handler wires actions and init guards', () => {
handlers.openFirstRunSetup();
handlers.openWindowsMpvLauncherSetup();
handlers.openYomitanSettings();
handlers.openRuntimeOptions();
handlers.openConfigSettings();
handlers.openJellyfinSetup();
handlers.toggleJellyfinDiscovery();
@@ -68,7 +68,6 @@ test('build tray template handler wires actions and init guards', () => {
openFirstRunSetupWindow: () => calls.push('setup'),
showWindowsMpvLauncherSetup: () => true,
openYomitanSettings: () => calls.push('yomitan'),
openRuntimeOptionsPalette: () => calls.push('runtime-options'),
openConfigSettingsWindow: () => calls.push('configuration'),
openJellyfinSetupWindow: () => calls.push('jellyfin'),
isJellyfinConfigured: () => true,
@@ -91,7 +90,6 @@ test('build tray template handler wires actions and init guards', () => {
'setup',
'setup',
'yomitan',
'runtime-options',
'configuration',
'jellyfin',
'jellyfin-discovery',
@@ -100,3 +98,34 @@ test('build tray template handler wires actions and init guards', () => {
'quit',
]);
});
test('texthooker tray visibility follows websocket server enabled state', () => {
assert.equal(
shouldShowTexthookerTrayEntry({
websocket: { enabled: false },
annotationWebsocket: { enabled: false },
}),
false,
);
assert.equal(
shouldShowTexthookerTrayEntry({
websocket: { enabled: true },
annotationWebsocket: { enabled: false },
}),
true,
);
assert.equal(
shouldShowTexthookerTrayEntry({
websocket: { enabled: 'auto' },
annotationWebsocket: { enabled: false },
}),
true,
);
assert.equal(
shouldShowTexthookerTrayEntry({
websocket: { enabled: false },
annotationWebsocket: { enabled: true },
}),
true,
);
});