fix(titlebar): reserve Windows window controls for logo

This commit is contained in:
2026-09-02 10:42:16 +08:00
parent d83757a115
commit e800d42595
5 changed files with 98 additions and 6 deletions

View File

@@ -188,14 +188,15 @@ describe('TitleBar platform behavior', () => {
expect(onSidebarPeekChange).toHaveBeenNthCalledWith(2, false, 'titlebar');
});
it('renders custom controls on Windows', async () => {
it('renders custom controls and reserves their space on Windows', async () => {
window.electron.platform = 'win32';
render(<TitleBar />);
render(<TitleBar integrated />);
expect(screen.getByTitle('Minimize')).toBeInTheDocument();
expect(screen.getByTitle('Maximize')).toBeInTheDocument();
expect(screen.getByTitle('Close')).toBeInTheDocument();
expect(screen.getByTestId('titlebar-logo')).toHaveStyle({ right: '148px' });
await waitFor(() => {
expect(invokeIpcMock).toHaveBeenCalledWith('window:isMaximized');