mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 18:16:15 +08:00
@@ -27,7 +27,9 @@ export function registerAffineLayoutCommands({
|
||||
binding: '$mod+/',
|
||||
},
|
||||
run() {
|
||||
track.$.navigationPanel.$.toggle();
|
||||
track.$.navigationPanel.$.toggle({
|
||||
type: appSidebarService.sidebar.open$.value ? 'collapse' : 'expand',
|
||||
});
|
||||
appSidebarService.sidebar.toggleSidebar();
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { IconButton } from '@affine/component';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import { SidebarIcon } from '@blocksuite/icons/rc';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { useCallback, useRef } from 'react';
|
||||
@@ -27,6 +28,9 @@ export const SidebarSwitch = ({
|
||||
}, [appSidebarService, open, preventHovering]);
|
||||
|
||||
const handleClickSwitch = useCallback(() => {
|
||||
track.$.navigationPanel.$.toggle({
|
||||
type: open ? 'collapse' : 'expand',
|
||||
});
|
||||
if (timeoutRef.current) {
|
||||
clearTimeout(timeoutRef.current);
|
||||
}
|
||||
|
||||
@@ -386,6 +386,7 @@ export type EventArgs = {
|
||||
action: TabActionType;
|
||||
};
|
||||
toggleFavorite: OrganizeItemArgs & { on: boolean };
|
||||
toggle: { type: 'collapse' | 'expand' };
|
||||
createDoc: { mode?: 'edgeless' | 'page' };
|
||||
switchPageMode: { mode: 'edgeless' | 'page' };
|
||||
createShareLink: { mode: 'edgeless' | 'page' };
|
||||
|
||||
Reference in New Issue
Block a user