mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
refactor(core): workbench (#7355)
Merge the right sidebar logic into the workbench. this can simplify our logic. Previously we had 3 modules * workbench * right-sidebar (Control sidebar open&close) * multi-tab-sidebar (Control tabs) Now everything is managed in Workbench. # Behavioral changes The sidebar button is always visible and can be opened at any time. If there is no content to display, will be `No Selection`  Elements in the sidebar can now be defined as`unmountOnInactive=false`. Inactive sidebars are marked with `display: none` but not unmount, so the `ChatPanel` can always remain in the DOM and user input will be retained even if the sidebar is closed.
This commit is contained in:
@@ -39,6 +39,7 @@ export interface ResizePanelProps
|
||||
resizeHandleVerticalPadding?: number;
|
||||
enableAnimation?: boolean;
|
||||
width: number;
|
||||
unmountOnExit?: boolean;
|
||||
onOpen: (open: boolean) => void;
|
||||
onResizing: (resizing: boolean) => void;
|
||||
onWidthChange: (width: number) => void;
|
||||
@@ -149,6 +150,7 @@ export const ResizePanel = forwardRef<HTMLDivElement, ResizePanelProps>(
|
||||
floating,
|
||||
enableAnimation: _enableAnimation = true,
|
||||
open,
|
||||
unmountOnExit,
|
||||
onOpen,
|
||||
onResizing,
|
||||
onWidthChange,
|
||||
@@ -182,7 +184,7 @@ export const ResizePanel = forwardRef<HTMLDivElement, ResizePanelProps>(
|
||||
data-handle-position={resizeHandlePos}
|
||||
data-enable-animation={enableAnimation && !resizing}
|
||||
>
|
||||
{status !== 'exited' && children}
|
||||
{!(status === 'exited' && unmountOnExit !== false) && children}
|
||||
<ResizeHandle
|
||||
resizeHandlePos={resizeHandlePos}
|
||||
resizeHandleOffset={resizeHandleOffset}
|
||||
|
||||
Reference in New Issue
Block a user