feat: custom title bar that is more compact

This commit is contained in:
2026-02-17 10:52:25 +01:00
parent 03cf6ae9e7
commit 7b5829e965
14 changed files with 756 additions and 113 deletions

View File

@@ -1339,6 +1339,39 @@ describe('IPC Handlers', () => {
expect(result).toBe('/Users/test/bds/project-1');
});
});
describe('app:triggerMenuAction', () => {
it('should forward custom titlebar action to renderer menu channel', async () => {
const send = vi.fn();
const event = { sender: { send } };
await invokeHandlerWithEvent(event, 'app:triggerMenuAction', 'newPost');
expect(send).toHaveBeenCalledWith('menu:newPost');
});
it('should execute default edit actions on webContents sender', async () => {
const undo = vi.fn();
const send = vi.fn();
const event = { sender: { undo, send } };
await invokeHandlerWithEvent(event, 'app:triggerMenuAction', 'undo');
expect(undo).toHaveBeenCalled();
expect(send).not.toHaveBeenCalled();
});
it('should execute toggleDevTools on sender when action is toggleDevTools', async () => {
const toggleDevTools = vi.fn();
const send = vi.fn();
const event = { sender: { toggleDevTools, send } };
await invokeHandlerWithEvent(event, 'app:triggerMenuAction', 'toggleDevTools');
expect(toggleDevTools).toHaveBeenCalled();
expect(send).not.toHaveBeenCalled();
});
});
});
// ============ Error Handling ============