fix(titlebar): reserve Windows window controls for logo

This commit is contained in:
brother7 committed 2026-09-02 10:50:15 +08:00
1 parent d83757a115
commit e800d42595
5 files changed
+98 -6

No files matched your search

+3 -2
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');