mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-06 11:59:51 +08:00
fix: some style updates (#2348)
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
import { BrowserWarning } from '@affine/component/affine-banner';
|
import { BrowserWarning } from '@affine/component/affine-banner';
|
||||||
import { appSidebarOpenAtom } from '@affine/component/app-sidebar';
|
import {
|
||||||
|
appSidebarFloatingAtom,
|
||||||
|
appSidebarOpenAtom,
|
||||||
|
} from '@affine/component/app-sidebar';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { WorkspaceFlavour } from '@affine/workspace/type';
|
import { WorkspaceFlavour } from '@affine/workspace/type';
|
||||||
import { CloseIcon, MinusIcon, RoundedRectangleIcon } from '@blocksuite/icons';
|
import { CloseIcon, MinusIcon, RoundedRectangleIcon } from '@blocksuite/icons';
|
||||||
@@ -164,6 +167,8 @@ export const Header = forwardRef<
|
|||||||
const open = useAtomValue(appSidebarOpenAtom);
|
const open = useAtomValue(appSidebarOpenAtom);
|
||||||
const t = useAFFiNEI18N();
|
const t = useAFFiNEI18N();
|
||||||
|
|
||||||
|
const appSidebarFloating = useAtomValue(appSidebarFloatingAtom);
|
||||||
|
|
||||||
const mode = useCurrentMode();
|
const mode = useCurrentMode();
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -171,6 +176,7 @@ export const Header = forwardRef<
|
|||||||
ref={ref}
|
ref={ref}
|
||||||
data-has-warning={showWarning}
|
data-has-warning={showWarning}
|
||||||
data-open={open}
|
data-open={open}
|
||||||
|
data-sidebar-floating={appSidebarFloating}
|
||||||
{...props}
|
{...props}
|
||||||
>
|
>
|
||||||
{showGuideDownloadClientTip ? (
|
{showGuideDownloadClientTip ? (
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import type { ComplexStyleRule } from '@vanilla-extract/css';
|
||||||
import { style } from '@vanilla-extract/css';
|
import { style } from '@vanilla-extract/css';
|
||||||
|
|
||||||
export const headerContainer = style({
|
export const headerContainer = style({
|
||||||
@@ -6,15 +7,16 @@ export const headerContainer = style({
|
|||||||
position: 'sticky',
|
position: 'sticky',
|
||||||
top: 0,
|
top: 0,
|
||||||
background: 'var(--affine-background-primary-color)',
|
background: 'var(--affine-background-primary-color)',
|
||||||
// @ts-ignore
|
|
||||||
WebkitAppRegion: 'drag',
|
|
||||||
zIndex: 'var(--affine-z-index-popover)',
|
zIndex: 'var(--affine-z-index-popover)',
|
||||||
selectors: {
|
selectors: {
|
||||||
'&[data-has-warning="true"]': {
|
'&[data-has-warning="true"]': {
|
||||||
height: '96px',
|
height: '96px',
|
||||||
},
|
},
|
||||||
|
'&[data-sidebar-floating="false"]': {
|
||||||
|
WebkitAppRegion: 'drag',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
} as ComplexStyleRule);
|
||||||
|
|
||||||
export const header = style({
|
export const header = style({
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
@@ -59,13 +61,12 @@ export const title = style({
|
|||||||
'(max-width: 768px)': {
|
'(max-width: 768px)': {
|
||||||
selectors: {
|
selectors: {
|
||||||
'&[data-open="true"]': {
|
'&[data-open="true"]': {
|
||||||
// @ts-ignore
|
|
||||||
WebkitAppRegion: 'no-drag',
|
WebkitAppRegion: 'no-drag',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
} as ComplexStyleRule);
|
||||||
|
|
||||||
export const titleWrapper = style({
|
export const titleWrapper = style({
|
||||||
height: '100%',
|
height: '100%',
|
||||||
@@ -187,7 +188,6 @@ export const windowAppControlsWrapper = style({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const windowAppControl = style({
|
export const windowAppControl = style({
|
||||||
// @ts-ignore
|
|
||||||
WebkitAppRegion: 'no-drag',
|
WebkitAppRegion: 'no-drag',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
display: 'inline-flex',
|
display: 'inline-flex',
|
||||||
@@ -204,4 +204,4 @@ export const windowAppControl = style({
|
|||||||
background: 'var(--affine-background-tertiary-color)',
|
background: 'var(--affine-background-tertiary-color)',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
} as ComplexStyleRule);
|
||||||
|
|||||||
@@ -20,13 +20,12 @@ import {
|
|||||||
ShareIcon,
|
ShareIcon,
|
||||||
} from '@blocksuite/icons';
|
} from '@blocksuite/icons';
|
||||||
import type { Page } from '@blocksuite/store';
|
import type { Page } from '@blocksuite/store';
|
||||||
import { useAtomValue } from 'jotai';
|
import { useAtom, useAtomValue } from 'jotai';
|
||||||
import type { ReactElement } from 'react';
|
import type { ReactElement } from 'react';
|
||||||
import type React from 'react';
|
import type React from 'react';
|
||||||
import { useCallback, useEffect } from 'react';
|
import { useCallback, useEffect } from 'react';
|
||||||
|
|
||||||
import type { AllWorkspace } from '../../shared';
|
import type { AllWorkspace } from '../../shared';
|
||||||
import ChangeLog from '../pure/workspace-slider-bar/changeLog';
|
|
||||||
import FavoriteList from '../pure/workspace-slider-bar/favorite/favorite-list';
|
import FavoriteList from '../pure/workspace-slider-bar/favorite/favorite-list';
|
||||||
import { WorkspaceSelector } from '../pure/workspace-slider-bar/WorkspaceSelector';
|
import { WorkspaceSelector } from '../pure/workspace-slider-bar/WorkspaceSelector';
|
||||||
|
|
||||||
@@ -97,13 +96,24 @@ export const RootAppSidebar = ({
|
|||||||
}
|
}
|
||||||
}, [onClickNewPage]);
|
}, [onClickNewPage]);
|
||||||
|
|
||||||
const sidebarOpen = useAtomValue(appSidebarOpenAtom);
|
const [sidebarOpen, setSidebarOpen] = useAtom(appSidebarOpenAtom);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (environment.isDesktop && typeof sidebarOpen === 'boolean') {
|
if (environment.isDesktop && typeof sidebarOpen === 'boolean') {
|
||||||
window.apis?.ui.handleSidebarVisibilityChange(sidebarOpen);
|
window.apis?.ui.handleSidebarVisibilityChange(sidebarOpen);
|
||||||
}
|
}
|
||||||
}, [sidebarOpen]);
|
}, [sidebarOpen]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const keydown = (e: KeyboardEvent) => {
|
||||||
|
if ((e.key === '/' && e.metaKey) || (e.key === '/' && e.ctrlKey)) {
|
||||||
|
setSidebarOpen(!sidebarOpen);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
document.addEventListener('keydown', keydown, { capture: true });
|
||||||
|
return () =>
|
||||||
|
document.removeEventListener('keydown', keydown, { capture: true });
|
||||||
|
}, [sidebarOpen, setSidebarOpen]);
|
||||||
|
|
||||||
const clientUpdateAvailable = useAtomValue(updateAvailableAtom);
|
const clientUpdateAvailable = useAtomValue(updateAvailableAtom);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -114,7 +124,6 @@ export const RootAppSidebar = ({
|
|||||||
currentWorkspace={currentWorkspace}
|
currentWorkspace={currentWorkspace}
|
||||||
onClick={onOpenWorkspaceListModal}
|
onClick={onOpenWorkspaceListModal}
|
||||||
/>
|
/>
|
||||||
<ChangeLog />
|
|
||||||
<QuickSearchInput
|
<QuickSearchInput
|
||||||
data-testid="slider-bar-quick-search-button"
|
data-testid="slider-bar-quick-search-button"
|
||||||
onClick={onOpenQuickSearchModal}
|
onClick={onOpenQuickSearchModal}
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
import {
|
import { appSidebarResizingAtom } from '@affine/component/app-sidebar';
|
||||||
appSidebarOpenAtom,
|
|
||||||
appSidebarResizingAtom,
|
|
||||||
} from '@affine/component/app-sidebar';
|
|
||||||
import {
|
import {
|
||||||
AppContainer,
|
AppContainer,
|
||||||
MainContainer,
|
MainContainer,
|
||||||
@@ -340,7 +337,6 @@ export const WorkspaceLayoutInner: FC<PropsWithChildren> = ({ children }) => {
|
|||||||
}, [setOpenQuickSearchModalAtom]);
|
}, [setOpenQuickSearchModalAtom]);
|
||||||
|
|
||||||
const resizing = useAtomValue(appSidebarResizingAtom);
|
const resizing = useAtomValue(appSidebarResizingAtom);
|
||||||
const sidebarOpen = useAtomValue(appSidebarOpenAtom);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -364,7 +360,7 @@ export const WorkspaceLayoutInner: FC<PropsWithChildren> = ({ children }) => {
|
|||||||
currentPath={router.asPath.split('?')[0]}
|
currentPath={router.asPath.split('?')[0]}
|
||||||
paths={isPublicWorkspace ? publicPathGenerator : pathGenerator}
|
paths={isPublicWorkspace ? publicPathGenerator : pathGenerator}
|
||||||
/>
|
/>
|
||||||
<MainContainer sidebarOpen={sidebarOpen}>
|
<MainContainer>
|
||||||
{children}
|
{children}
|
||||||
<ToolContainer>
|
<ToolContainer>
|
||||||
{/* fixme(himself65): remove this */}
|
{/* fixme(himself65): remove this */}
|
||||||
|
|||||||
@@ -13,19 +13,17 @@ export const navWrapperStyle = style({
|
|||||||
width: navWidthVar,
|
width: navWidthVar,
|
||||||
minWidth: navWidthVar,
|
minWidth: navWidthVar,
|
||||||
height: '100%',
|
height: '100%',
|
||||||
backgroundColor: 'var(--affine-background-secondary-color)',
|
zIndex: 2,
|
||||||
|
backgroundColor: 'transparent',
|
||||||
'@media': {
|
'@media': {
|
||||||
[`(max-width: ${floatingMaxWidth}px)`]: {
|
[`(max-width: ${floatingMaxWidth}px)`]: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
width: `calc(${navWidthVar})`,
|
width: `calc(${navWidthVar})`,
|
||||||
zIndex: 2,
|
backgroundColor: 'var(--affine-background-primary-color)',
|
||||||
selectors: {
|
selectors: {
|
||||||
'&[data-open="false"]': {
|
'&[data-open="false"]': {
|
||||||
marginLeft: `calc((10vw + ${navWidthVar}) * -1)`,
|
marginLeft: `calc((10vw + ${navWidthVar}) * -1)`,
|
||||||
},
|
},
|
||||||
'&[data-is-macos-electron="true"]': {
|
|
||||||
backgroundColor: 'var(--affine-background-primary-color)',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -33,9 +31,6 @@ export const navWrapperStyle = style({
|
|||||||
'&[data-open="false"]': {
|
'&[data-open="false"]': {
|
||||||
marginLeft: `calc(${navWidthVar} * -1)`,
|
marginLeft: `calc(${navWidthVar} * -1)`,
|
||||||
},
|
},
|
||||||
'&[data-is-macos-electron="true"]': {
|
|
||||||
backgroundColor: 'transparent',
|
|
||||||
},
|
|
||||||
'&[data-enable-animation="true"]': {
|
'&[data-enable-animation="true"]': {
|
||||||
transition: 'margin-left .3s, width .3s',
|
transition: 'margin-left .3s, width .3s',
|
||||||
},
|
},
|
||||||
@@ -60,18 +55,9 @@ export const navHeaderStyle = style({
|
|||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
gap: '32px',
|
gap: '32px',
|
||||||
'@media': {
|
WebkitAppRegion: 'drag',
|
||||||
[`(max-width: ${floatingMaxWidth}px)`]: {
|
|
||||||
selectors: {
|
|
||||||
'&[data-open="true"]': {
|
|
||||||
WebkitAppRegion: 'no-drag',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
} as ComplexStyleRule,
|
|
||||||
},
|
|
||||||
selectors: {
|
selectors: {
|
||||||
'&[data-is-macos-electron="true"]': {
|
'&[data-is-macos-electron="true"]': {
|
||||||
WebkitAppRegion: 'drag',
|
|
||||||
justifyContent: 'flex-end',
|
justifyContent: 'flex-end',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ export const appSidebarOpenAtom = atomWithStorage(
|
|||||||
APP_SIDEBAR_OPEN,
|
APP_SIDEBAR_OPEN,
|
||||||
undefined as boolean | undefined
|
undefined as boolean | undefined
|
||||||
);
|
);
|
||||||
|
export const appSidebarFloatingAtom = atom(false);
|
||||||
|
|
||||||
export const appSidebarResizingAtom = atom(false);
|
export const appSidebarResizingAtom = atom(false);
|
||||||
export const appSidebarWidthAtom = atomWithStorage(
|
export const appSidebarWidthAtom = atomWithStorage(
|
||||||
'app-sidebar-width',
|
'app-sidebar-width',
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
} from './index.css';
|
} from './index.css';
|
||||||
import {
|
import {
|
||||||
APP_SIDEBAR_OPEN,
|
APP_SIDEBAR_OPEN,
|
||||||
|
appSidebarFloatingAtom,
|
||||||
appSidebarOpenAtom,
|
appSidebarOpenAtom,
|
||||||
appSidebarResizingAtom,
|
appSidebarResizingAtom,
|
||||||
appSidebarWidthAtom,
|
appSidebarWidthAtom,
|
||||||
@@ -37,21 +38,36 @@ function useEnableAnimation() {
|
|||||||
export function AppSidebar(props: AppSidebarProps): ReactElement {
|
export function AppSidebar(props: AppSidebarProps): ReactElement {
|
||||||
const [open, setOpen] = useAtom(appSidebarOpenAtom);
|
const [open, setOpen] = useAtom(appSidebarOpenAtom);
|
||||||
const appSidebarWidth = useAtomValue(appSidebarWidthAtom);
|
const appSidebarWidth = useAtomValue(appSidebarWidthAtom);
|
||||||
|
const [appSidebarFloating, setAppSidebarFloating] = useAtom(
|
||||||
|
appSidebarFloatingAtom
|
||||||
|
);
|
||||||
const initialRender = open === undefined;
|
const initialRender = open === undefined;
|
||||||
|
|
||||||
const isResizing = useAtomValue(appSidebarResizingAtom);
|
const isResizing = useAtomValue(appSidebarResizingAtom);
|
||||||
const navRef = useRef<HTMLDivElement>(null);
|
const navRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (open === undefined && localStorage.getItem(APP_SIDEBAR_OPEN) === null) {
|
function onResize() {
|
||||||
// give the initial value,
|
|
||||||
// so that the sidebar can be closed on mobile by default
|
|
||||||
const { matches } = window.matchMedia(
|
const { matches } = window.matchMedia(
|
||||||
`(min-width: ${floatingMaxWidth}px)`
|
`(max-width: ${floatingMaxWidth}px)`
|
||||||
);
|
);
|
||||||
setOpen(matches);
|
if (
|
||||||
|
open === undefined &&
|
||||||
|
localStorage.getItem(APP_SIDEBAR_OPEN) === null
|
||||||
|
) {
|
||||||
|
// give the initial value,
|
||||||
|
// so that the sidebar can be closed on mobile by default
|
||||||
|
setOpen(!matches);
|
||||||
|
}
|
||||||
|
setAppSidebarFloating(matches && !!open);
|
||||||
}
|
}
|
||||||
}, [open, setOpen]);
|
|
||||||
|
onResize();
|
||||||
|
window.addEventListener('resize', onResize);
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener('resize', onResize);
|
||||||
|
};
|
||||||
|
}, [open, setAppSidebarFloating, setOpen]);
|
||||||
|
|
||||||
// disable animation to avoid UI flash
|
// disable animation to avoid UI flash
|
||||||
const enableAnimation = useEnableAnimation();
|
const enableAnimation = useEnableAnimation();
|
||||||
@@ -85,6 +101,7 @@ export function AppSidebar(props: AppSidebarProps): ReactElement {
|
|||||||
<div
|
<div
|
||||||
data-testid="app-sidebar-float-mask"
|
data-testid="app-sidebar-float-mask"
|
||||||
data-open={open}
|
data-open={open}
|
||||||
|
data-is-floating={appSidebarFloating}
|
||||||
className={sidebarFloatMaskStyle}
|
className={sidebarFloatMaskStyle}
|
||||||
onClick={() => setOpen(false)}
|
onClick={() => setOpen(false)}
|
||||||
/>
|
/>
|
||||||
@@ -99,4 +116,9 @@ export { AppSidebarFallback } from './fallback';
|
|||||||
export * from './menu-item';
|
export * from './menu-item';
|
||||||
export * from './quick-search-input';
|
export * from './quick-search-input';
|
||||||
export * from './sidebar-containers';
|
export * from './sidebar-containers';
|
||||||
export { appSidebarOpenAtom, appSidebarResizingAtom, updateAvailableAtom };
|
export {
|
||||||
|
appSidebarFloatingAtom,
|
||||||
|
appSidebarOpenAtom,
|
||||||
|
appSidebarResizingAtom,
|
||||||
|
updateAvailableAtom,
|
||||||
|
};
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ export const root = style({
|
|||||||
background: 'var(--affine-hover-color)',
|
background: 'var(--affine-hover-color)',
|
||||||
},
|
},
|
||||||
'&[data-active="true"]': {
|
'&[data-active="true"]': {
|
||||||
color: 'var(--affine-primary-color)',
|
|
||||||
background: 'var(--affine-hover-color)',
|
background: 'var(--affine-hover-color)',
|
||||||
},
|
},
|
||||||
'&[data-disabled="true"]': {
|
'&[data-disabled="true"]': {
|
||||||
|
|||||||
@@ -3,10 +3,9 @@ import { style } from '@vanilla-extract/css';
|
|||||||
export const resizerContainer = style({
|
export const resizerContainer = style({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
right: 0,
|
right: 0,
|
||||||
top: 0,
|
top: '16px',
|
||||||
bottom: 0,
|
bottom: '16px',
|
||||||
width: '10px',
|
width: '16px',
|
||||||
height: '100%',
|
|
||||||
zIndex: 'calc(var(--affine-z-index-modal) + 1)',
|
zIndex: 'calc(var(--affine-z-index-modal) + 1)',
|
||||||
transform: 'translateX(50%)',
|
transform: 'translateX(50%)',
|
||||||
backgroundColor: 'transparent',
|
backgroundColor: 'transparent',
|
||||||
@@ -24,6 +23,7 @@ export const resizerContainer = style({
|
|||||||
opacity: 1,
|
opacity: 1,
|
||||||
},
|
},
|
||||||
'&[data-resizing="true"]': {
|
'&[data-resizing="true"]': {
|
||||||
|
opacity: 1,
|
||||||
transition: 'width .3s, min-width .3s, max-width .3s',
|
transition: 'width .3s, min-width .3s, max-width .3s',
|
||||||
},
|
},
|
||||||
'&[data-open="false"]': {
|
'&[data-open="false"]': {
|
||||||
@@ -38,10 +38,8 @@ export const resizerContainer = style({
|
|||||||
export const resizerInner = style({
|
export const resizerInner = style({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
width: '2px',
|
width: '4px',
|
||||||
left: '3px',
|
left: '6px',
|
||||||
backgroundColor: 'var(--affine-border-color)',
|
borderRadius: '4px',
|
||||||
selectors: {
|
backgroundColor: 'var(--affine-primary-color)',
|
||||||
[`${resizerContainer}:hover &`]: {},
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export const baseContainer = style({
|
|||||||
padding: '12px 16px',
|
padding: '12px 16px',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexFlow: 'column nowrap',
|
flexFlow: 'column nowrap',
|
||||||
rowGap: '8px',
|
rowGap: '4px',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const scrollableContainerRoot = style({
|
export const scrollableContainerRoot = style({
|
||||||
|
|||||||
@@ -90,5 +90,5 @@ export const InternalLottie: FC<CustomLottieProps> = ({
|
|||||||
}
|
}
|
||||||
}, [isStopped, speed]);
|
}, [isStopped, speed]);
|
||||||
|
|
||||||
return <div ref={element} style={{ width, height }}></div>;
|
return <div ref={element} style={{ width, height, lineHeight: 1 }}></div>;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export const appStyle = style({
|
|||||||
'&[data-is-resizing="true"]': {
|
'&[data-is-resizing="true"]': {
|
||||||
cursor: 'col-resize',
|
cursor: 'col-resize',
|
||||||
},
|
},
|
||||||
'&[data-noise-background="true"]:before': {
|
'&:before': {
|
||||||
content: '""',
|
content: '""',
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
inset: 0,
|
inset: 0,
|
||||||
@@ -59,9 +59,6 @@ export const mainContainerStyle = style({
|
|||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
boxShadow: 'var(--affine-shadow-1)',
|
boxShadow: 'var(--affine-shadow-1)',
|
||||||
},
|
},
|
||||||
'&[data-is-desktop="true"][data-is-sidebar-open="true"]': {
|
|
||||||
marginLeft: '2px',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -72,7 +69,7 @@ export const toolStyle = style({
|
|||||||
zIndex: 'var(--affine-z-index-popover)',
|
zIndex: 'var(--affine-z-index-popover)',
|
||||||
'@media': {
|
'@media': {
|
||||||
[breakpoints.down('md', true)]: {
|
[breakpoints.down('md', true)]: {
|
||||||
right: 'calc((100vw - 640px) * 3 / 19 + 5px)',
|
right: 'calc((100vw - 640px) * 3 / 19 + 14px)',
|
||||||
},
|
},
|
||||||
[breakpoints.down('sm', true)]: {
|
[breakpoints.down('sm', true)]: {
|
||||||
right: '5px',
|
right: '5px',
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ export const AppContainer = (props: WorkspaceRootProps): ReactElement => {
|
|||||||
|
|
||||||
export type MainContainerProps = PropsWithChildren<{
|
export type MainContainerProps = PropsWithChildren<{
|
||||||
className?: string;
|
className?: string;
|
||||||
sidebarOpen?: boolean;
|
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
export const MainContainer = (props: MainContainerProps): ReactElement => {
|
export const MainContainer = (props: MainContainerProps): ReactElement => {
|
||||||
@@ -31,7 +30,6 @@ export const MainContainer = (props: MainContainerProps): ReactElement => {
|
|||||||
<div
|
<div
|
||||||
className={clsx(mainContainerStyle, 'main-container', props.className)}
|
className={clsx(mainContainerStyle, 'main-container', props.className)}
|
||||||
data-is-desktop={environment.isDesktop}
|
data-is-desktop={environment.isDesktop}
|
||||||
data-is-sidebar-open={props.sidebarOpen}
|
|
||||||
>
|
>
|
||||||
{props.children}
|
{props.children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -26,33 +26,6 @@ test('Open last workspace when back to affine', async ({ page }) => {
|
|||||||
expect(currentWorkspaceName).toEqual('New Workspace 2');
|
expect(currentWorkspaceName).toEqual('New Workspace 2');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Open affine in first time after updated', async ({ page }) => {
|
|
||||||
await openHomePage(page);
|
|
||||||
const changeLogItem = page.locator('[data-testid=change-log]');
|
|
||||||
await expect(changeLogItem).toBeVisible();
|
|
||||||
const closeButton = page.locator('[data-testid=change-log-close-button]');
|
|
||||||
await closeButton.click();
|
|
||||||
await expect(changeLogItem).not.toBeVisible();
|
|
||||||
await page.goto('http://localhost:8080');
|
|
||||||
const currentChangeLogItem = page.locator('[data-testid=change-log]');
|
|
||||||
await expect(currentChangeLogItem).not.toBeVisible();
|
|
||||||
});
|
|
||||||
test('Click right-bottom corner change log icon', async ({ page }) => {
|
|
||||||
await openHomePage(page);
|
|
||||||
await waitMarkdownImported(page);
|
|
||||||
await page.locator('[data-testid=help-island]').click();
|
|
||||||
const editorRightBottomChangeLog = page.locator(
|
|
||||||
'[data-testid=right-bottom-change-log-icon]'
|
|
||||||
);
|
|
||||||
await page.waitForTimeout(50);
|
|
||||||
expect(await editorRightBottomChangeLog.isVisible()).toEqual(true);
|
|
||||||
await page.getByTestId('all-pages').click();
|
|
||||||
const normalRightBottomChangeLog = page.locator(
|
|
||||||
'[data-testid=right-bottom-change-log-icon]'
|
|
||||||
);
|
|
||||||
expect(await normalRightBottomChangeLog.isVisible()).toEqual(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('Download client tip', async ({ page }) => {
|
test('Download client tip', async ({ page }) => {
|
||||||
await openHomePage(page);
|
await openHomePage(page);
|
||||||
const downloadClientTipItem = page.locator(
|
const downloadClientTipItem = page.locator(
|
||||||
|
|||||||
Reference in New Issue
Block a user