mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 06:18:45 +08:00
fix(electron): set client border style to false by default on windows (#3960)
Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { isDesktop } from '@affine/env/constant';
|
||||
import { atom, useAtom } from 'jotai';
|
||||
import { atomWithStorage } from 'jotai/utils';
|
||||
|
||||
@@ -50,7 +49,7 @@ export const fontStyleOptions = [
|
||||
}[];
|
||||
|
||||
const appSettingBaseAtom = atomWithStorage<AppSetting>('affine-settings', {
|
||||
clientBorder: isDesktop,
|
||||
clientBorder: globalThis.platform !== 'win32',
|
||||
fullWidthLayout: false,
|
||||
windowFrameStyle: 'frameless',
|
||||
fontStyle: 'Sans',
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ export const DeleteLeaveWorkspace = ({
|
||||
onClick={() => {
|
||||
setShowDelete(true);
|
||||
}}
|
||||
testId="delete-workspace-button"
|
||||
data-testid="delete-workspace-button"
|
||||
>
|
||||
<ArrowRightSmallIcon />
|
||||
</SettingRow>
|
||||
|
||||
@@ -81,6 +81,7 @@ export const AppearanceSettings = () => {
|
||||
const t = useAFFiNEI18N();
|
||||
|
||||
const [appSettings, setAppSettings] = useAppSetting();
|
||||
|
||||
const changeSwitch = useCallback(
|
||||
(key: keyof AppSetting, checked: boolean) => {
|
||||
setAppSettings({ [key]: checked });
|
||||
@@ -131,6 +132,7 @@ export const AppearanceSettings = () => {
|
||||
desc={t[
|
||||
'com.affine.settings.appearance.border-style-description'
|
||||
]()}
|
||||
data-testid="client-border-style-trigger"
|
||||
>
|
||||
<Switch
|
||||
checked={appSettings.clientBorder}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { platform } from 'node:os';
|
||||
|
||||
import { clickSideBarSettingButton } from '@affine-test/kit/utils/sidebar';
|
||||
import { expect } from '@playwright/test';
|
||||
|
||||
import { test } from './fixture';
|
||||
@@ -80,6 +81,19 @@ if (platform() === 'darwin') {
|
||||
});
|
||||
}
|
||||
|
||||
test('clientBorder value should disable by default on window', async ({
|
||||
page,
|
||||
}) => {
|
||||
await clickSideBarSettingButton(page);
|
||||
await page.waitForTimeout(1000);
|
||||
const settingItem = page.locator(
|
||||
'[data-testid="client-border-style-trigger"]'
|
||||
);
|
||||
expect(await settingItem.locator('input').inputValue()).toEqual(
|
||||
process.platform === 'win32' ? 'off' : 'on'
|
||||
);
|
||||
});
|
||||
|
||||
test('app theme', async ({ page, electronApp }) => {
|
||||
const root = page.locator('html');
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user