fix(core): correct workspace selector position in sidebar fallback (#12945)
- prevent drag-handle being clipped in header <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Style** * Reduced horizontal padding and header height in the app sidebar fallback view for a more compact layout. * Updated header padding in the workbench view and introduced conditional left padding based on sidebar switch visibility. * **Refactor** * Simplified and centralized the logic for displaying the sidebar switch, improving code clarity and maintainability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { style } from '@vanilla-extract/css';
|
import { style } from '@vanilla-extract/css';
|
||||||
|
|
||||||
export const fallback = style({
|
export const fallback = style({
|
||||||
padding: '4px 16px',
|
padding: '4px 8px',
|
||||||
height: '100%',
|
height: '100%',
|
||||||
overflow: 'clip',
|
overflow: 'clip',
|
||||||
});
|
});
|
||||||
@@ -13,7 +13,7 @@ export const fallbackHeader = style({
|
|||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
gap: '8px',
|
gap: '8px',
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
height: '52px',
|
height: '42px',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const spacer = style({
|
export const spacer = style({
|
||||||
|
|||||||
@@ -19,13 +19,18 @@ export const header = style({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
flexShrink: 0,
|
flexShrink: 0,
|
||||||
background: cssVar('backgroundPrimaryColor'),
|
background: cssVar('backgroundPrimaryColor'),
|
||||||
padding: '0 16px 0px 8px',
|
padding: '0 16px',
|
||||||
contain: 'strict',
|
contain: 'strict',
|
||||||
'@media': {
|
'@media': {
|
||||||
print: {
|
print: {
|
||||||
display: 'none',
|
display: 'none',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
selectors: {
|
||||||
|
'&[data-show-switch=true]': {
|
||||||
|
paddingLeft: 8,
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const viewBodyContainer = style({
|
export const viewBodyContainer = style({
|
||||||
|
|||||||
@@ -52,10 +52,15 @@ export const RouteContainer = () => {
|
|||||||
workbench.toggleSidebar();
|
workbench.toggleSidebar();
|
||||||
}, [workbench]);
|
}, [workbench]);
|
||||||
|
|
||||||
|
const showSwitch = !BUILD_CONFIG.isElectron && viewPosition.isFirst;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.root}>
|
<div className={styles.root}>
|
||||||
<div className={styles.header}>
|
<div
|
||||||
{!BUILD_CONFIG.isElectron && viewPosition.isFirst && (
|
className={styles.header}
|
||||||
|
data-show-switch={showSwitch && !leftSidebarOpen}
|
||||||
|
>
|
||||||
|
{showSwitch && (
|
||||||
<SidebarSwitch
|
<SidebarSwitch
|
||||||
show={!leftSidebarOpen}
|
show={!leftSidebarOpen}
|
||||||
className={styles.leftSidebarButton}
|
className={styles.leftSidebarButton}
|
||||||
|
|||||||
Reference in New Issue
Block a user