Skip to content

The open alternative to Salesforce, designed for AI.

Put the navbar tabs and the show page header on one 40px grid (#25236)

Félix Malfait7cf0c9ad186c
diff --git a/packages/twenty-front/src/modules/navigation/components/MainNavigationDrawerModeSwitcher.tsx b/packages/twenty-front/src/modules/navigation/components/MainNavigationDrawerModeSwitcher.tsx
index 54ce845d52e..5d04efefbf0 100644
--- a/packages/twenty-front/src/modules/navigation/components/MainNavigationDrawerModeSwitcher.tsx
+++ b/packages/twenty-front/src/modules/navigation/components/MainNavigationDrawerModeSwitcher.tsx
@@ -21,10 +21,16 @@ import {
import { WorkspaceActivationStatus } from 'twenty-shared/workspace';
import { PermissionFlagType } from '~/generated-metadata/graphql';
+// Sized off the page card header row beside it, so the rules read as one line
+// across both columns.
const StyledSwitcher = styled.div`
align-items: center;
+ border-bottom: 1px solid ${themeCssVariables.border.color.light};
+ border-top: 1px solid ${themeCssVariables.border.color.light};
+ box-sizing: border-box;
display: flex;
gap: ${themeCssVariables.spacing['0.5']};
+ height: ${themeCssVariables.spacing[10]};
`;
const StyledMode = styled.button<{ isActive: boolean }>`
diff --git a/packages/twenty-front/src/modules/page-layout/constants/PageLayoutRecordIdentifierBarHeight.ts b/packages/twenty-front/src/modules/page-layout/constants/PageLayoutRecordIdentifierBarHeight.ts
index 46d09f6f238..1f9eaac54f4 100644
--- a/packages/twenty-front/src/modules/page-layout/constants/PageLayoutRecordIdentifierBarHeight.ts
+++ b/packages/twenty-front/src/modules/page-layout/constants/PageLayoutRecordIdentifierBarHeight.ts
@@ -1 +1 @@
-export const PAGE_LAYOUT_RECORD_IDENTIFIER_BAR_HEIGHT = 48;
+export const PAGE_LAYOUT_RECORD_IDENTIFIER_BAR_HEIGHT = 40;
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelList.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelList.tsx
index 3f416bbe2a5..44b9d9bbd92 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelList.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelList.tsx
@@ -1,6 +1,7 @@
import { SidePanelDefaultSelectionEffect } from '@/side-panel/components/SidePanelDefaultSelectionEffect';
import { SIDE_PANEL_SELECTABLE_LIST_ID } from '@/side-panel/constants/SidePanelSelectableListId';
import { SIDE_PANEL_TOP_BAR_HEIGHT } from '@/side-panel/constants/SidePanelTopBarHeight';
+import { SIDE_PANEL_TOP_BAR_HEIGHT_MOBILE } from '@/side-panel/constants/SidePanelTopBarHeightMobile';
import { SIDE_PANEL_LIST_PADDING } from '@/side-panel/constants/SidePanelListPadding';
import { SIDE_PANEL_FOCUS_ID } from '@/side-panel/constants/SidePanelFocusId';
import { hasUserSelectedSidePanelListItemState } from '@/side-panel/states/hasUserSelectedSidePanelListItemState';
@@ -21,7 +22,7 @@ export type SidePanelListProps = {
const StyledInnerList = styled.div`
max-height: calc(
- calc(100dvh / var(--t-zoom, 1)) - ${SIDE_PANEL_TOP_BAR_HEIGHT}px -
+ calc(100dvh / var(--t-zoom, 1)) - ${SIDE_PANEL_TOP_BAR_HEIGHT_MOBILE}px -
${SIDE_PANEL_LIST_PADDING * 2}px
);
padding-left: ${themeCssVariables.spacing[2]};
diff --git a/packages/twenty-front/src/modules/side-panel/constants/SidePanelTopBarHeight.ts b/packages/twenty-front/src/modules/side-panel/constants/SidePanelTopBarHeight.ts
index b07ac85c0b1..574749a328d 100644
--- a/packages/twenty-front/src/modules/side-panel/constants/SidePanelTopBarHeight.ts
+++ b/packages/twenty-front/src/modules/side-panel/constants/SidePanelTopBarHeight.ts
@@ -1 +1 @@
-export const SIDE_PANEL_TOP_BAR_HEIGHT = 48;
+export const SIDE_PANEL_TOP_BAR_HEIGHT = 40;
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawer.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawer.tsx
index c1a6269c85a..7df09c4db37 100644
--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawer.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/NavigationDrawer.tsx
@@ -50,26 +50,39 @@ const StyledAnimatedContainer = styled.div<{
}
`;
+// The header takes a tighter gap than the sections below it so that the mode
+// switcher row starts where the page card header ends in the next column.
const StyledContainer = styled.div<{
isExpanded?: boolean;
}>`
box-sizing: border-box;
display: flex;
flex-direction: column;
- gap: ${themeCssVariables.spacing[3]};
+ gap: ${themeCssVariables.spacing[1]};
height: 100%;
- padding: ${themeCssVariables.spacing[2]} 0 ${themeCssVariables.spacing[4]}
+ padding: ${themeCssVariables.spacing[1]} 0 ${themeCssVariables.spacing[4]}
${themeCssVariables.spacing[2]};
width: ${({ isExpanded }) =>
isExpanded ? `var(${NAVIGATION_DRAWER_WIDTH_VAR})` : '100%'};
@media (max-width: ${MOBILE_VIEWPORT}px) {
- gap: ${themeCssVariables.spacing[4]};
width: 100%;
padding-left: ${themeCssVariables.spacing[2]};
padding-right: ${themeCssVariables.spacing[2]};
}
`;
+const StyledContent = styled.div`
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ gap: ${themeCssVariables.spacing[3]};
+ min-height: 0;
+
+ @media (max-width: ${MOBILE_VIEWPORT}px) {
+ gap: ${themeCssVariables.spacing[4]};
+ }
+`;
+
export const NavigationDrawer = ({
children,
className,
@@ -122,7 +135,7 @@ export const NavigationDrawer = ({
<NavigationDrawerHeader
showCollapseButton={isMobile || !isSettingsDrawer}
/>
- {children}
+ <StyledContent>{children}</StyledContent>
</StyledContainer>
{isNavigationDrawerExpanded && !isMobile && !isSettingsDrawer && (