Skip to content

The open alternative to Salesforce, designed for AI.

Float the mobile bottom bar again and reserve its footprint in page content (#24267)

Félix Malfaitfe633ba0a8bd
diff --git a/packages/twenty-front/src/modules/navigation/components/MobileNavigationBar.tsx b/packages/twenty-front/src/modules/navigation/components/MobileNavigationBar.tsx
index 4891eb6cd0b..182342c8932 100644
--- a/packages/twenty-front/src/modules/navigation/components/MobileNavigationBar.tsx
+++ b/packages/twenty-front/src/modules/navigation/components/MobileNavigationBar.tsx
@@ -8,15 +8,27 @@ import { styled } from '@linaria/react';
import { NavigationBar } from 'twenty-ui/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
-const StyledBarContainer = styled.div`
+// The bar floats over the page, so the container has to let taps through to
+// whatever is scrolling underneath it. flex-start rather than left so the bar
+// follows the writing direction in RTL locales.
+const StyledFloatingContainer = styled.div`
+ bottom: 0;
display: flex;
- flex-shrink: 0;
+ justify-content: flex-start;
+ left: 0;
padding: ${themeCssVariables.spacing[3]};
padding-bottom: calc(
${themeCssVariables.spacing[3]} + env(safe-area-inset-bottom, 0px)
);
+ pointer-events: none;
+ position: absolute;
+ right: 0;
z-index: ${RootStackingContextZIndices.MobileNavigationBar};
+ > * {
+ pointer-events: auto;
+ }
+
@media print {
display: none;
}
@@ -34,13 +46,13 @@ export const MobileNavigationBar = () => {
return (
<>
<MobileNavigationBarScrollEffect />
- <StyledBarContainer>
+ <StyledFloatingContainer>
<NavigationBar
activeItemName={activeItemName}
isHidden={isHidden}
items={items}
/>
- </StyledBarContainer>
+ </StyledFloatingContainer>
</>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/components/RecordTableStyleWrapper.tsx b/packages/twenty-front/src/modules/object-record/record-table/components/RecordTableStyleWrapper.tsx
index 77e36433401..a7807796980 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/components/RecordTableStyleWrapper.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/components/RecordTableStyleWrapper.tsx
@@ -15,7 +15,7 @@ import { TABLE_Z_INDEX } from '@/object-record/record-table/constants/TableZInde
import { getRecordTableColumnFieldWidthClassName } from '@/object-record/record-table/utils/getRecordTableColumnFieldWidthClassName';
import { getRecordTableColumnFieldWidthCSSVariableName } from '@/object-record/record-table/utils/getRecordTableColumnFieldWidthCSSVariableName';
import { styled } from '@linaria/react';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
+import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme-constants';
export { HorizontalScrollBoxShadowCSS, VerticalScrollBoxShadowCSS };
@@ -77,6 +77,12 @@ const StyledTable = styled.div<{
width: 100%;
+ // The mobile navigation bar floats over the page, so the table reserves its
+ // footprint to keep its last row reachable, grouped or not.
+ @media (max-width: ${MOBILE_VIEWPORT}px) {
+ padding-bottom: ${themeCssVariables.spacing[20]};
+ }
+
div.header-cell {
z-index: ${TABLE_Z_INDEX.headerColumns.headerColumnsNormal};
}
diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabsRenderer.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabsRenderer.tsx
index 44f1efd8afc..08df17dad3b 100644
--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabsRenderer.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabsRenderer.tsx
@@ -18,6 +18,7 @@ import { ScrollWrapper } from '@/ui/utilities/scroll/components/ScrollWrapper';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { styled } from '@linaria/react';
import { isDefined } from 'twenty-shared/utils';
+import { MOBILE_VIEWPORT, themeCssVariables } from 'twenty-ui/theme-constants';
const StyledContainer = styled.div<{ hasPinnedTab: boolean }>`
display: grid;
@@ -53,6 +54,15 @@ const StyledScrollWrapperContainer = styled.div`
flex: 1;
min-height: 0;
+ // The mobile navigation bar floats over the page, so the content reserves its
+ // footprint to stay readable once scrolled to the end.
+ @media (max-width: ${MOBILE_VIEWPORT}px) {
+ .page-layout-scroll-wrapper {
+ box-sizing: border-box;
+ padding-bottom: ${themeCssVariables.spacing[20]};
+ }
+ }
+
@media print {
min-height: auto;