diff --git a/packages/twenty-front/src/modules/page-layout/components/utils/getPageLayoutVerticalListViewerVariant.ts b/packages/twenty-front/src/modules/page-layout/components/utils/getPageLayoutVerticalListViewerVariant.ts
new file mode 100644
index 0000000000..8b06737691
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/components/utils/getPageLayoutVerticalListViewerVariant.ts
@@ -0,0 +1,19 @@
+import { type PageLayoutVerticalListViewerVariant } from '@/page-layout/types/PageLayoutVerticalListViewerVariant';
+
+type GetPageLayoutVerticalListViewerVariantParams = {
+ isInPinnedTab: boolean;
+ isMobile: boolean;
+ isInRightDrawer: boolean;
+};
+
+export const getPageLayoutVerticalListViewerVariant = ({
+ isInPinnedTab,
+ isMobile,
+ isInRightDrawer,
+}: GetPageLayoutVerticalListViewerVariantParams): PageLayoutVerticalListViewerVariant => {
+ if (isInPinnedTab || isMobile || isInRightDrawer) {
+ return 'side-column';
+ }
+
+ return 'default';
+};
diff --git a/packages/twenty-front/src/modules/page-layout/hooks/useTemporaryFieldsConfiguration.ts b/packages/twenty-front/src/modules/page-layout/hooks/useTemporaryFieldsConfiguration.ts
index 01a3a488c1..3dd9f2b870 100644
--- a/packages/twenty-front/src/modules/page-layout/hooks/useTemporaryFieldsConfiguration.ts
+++ b/packages/twenty-front/src/modules/page-layout/hooks/useTemporaryFieldsConfiguration.ts
@@ -38,7 +38,7 @@ export const useTemporaryFieldsConfiguration = (
let otherPosition = 0;
fieldsToDisplay.forEach((field) => {
- if (field.type === FieldMetadataType.LINKS) {
+ if (field.isCustom === true) {
otherFields.push({
fieldMetadataId: field.id,
position: otherPosition++,
diff --git a/packages/twenty-front/src/modules/page-layout/types/PageLayoutVerticalListViewerVariant.ts b/packages/twenty-front/src/modules/page-layout/types/PageLayoutVerticalListViewerVariant.ts
new file mode 100644
index 0000000000..7f8081a8dc
--- /dev/null
+++ b/packages/twenty-front/src/modules/page-layout/types/PageLayoutVerticalListViewerVariant.ts
@@ -0,0 +1 @@
+export type PageLayoutVerticalListViewerVariant = 'default' | 'side-column';
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/components/DashboardWidgetPlaceholder.tsx b/packages/twenty-front/src/modules/page-layout/widgets/components/DashboardWidgetPlaceholder.tsx
index a0c9c8c217..d7f49c461b 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/components/DashboardWidgetPlaceholder.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/components/DashboardWidgetPlaceholder.tsx
@@ -53,6 +53,7 @@ export const DashboardWidgetPlaceholder = () => {
className="widget"
>
{
const isRichTextWidget = widget.type === WidgetType.STANDALONE_RICH_TEXT;
const hideRichTextHeader = isRichTextWidget && !isPageLayoutInEditMode;
- const showHeader = layoutMode !== 'canvas' && !hideRichTextHeader;
+ const showHeader =
+ layoutMode !== 'canvas' &&
+ !hideRichTextHeader &&
+ // TODO: use a more generic approach after record page layout v1 release
+ widget.type !== WidgetType.FIELDS;
const handleClick = () => {
handleEditWidget({
@@ -140,6 +144,7 @@ export const WidgetRenderer = ({ widget }: WidgetRendererProps) => {
{showHeader && (
theme.border.radius.sm};
+ display: flex;
+ flex-direction: column;
+ gap: ${({ theme }) => theme.spacing(2)};
+ padding-top: ${({ theme }) => theme.spacing(3)};
+ padding-bottom: ${({ theme }) => theme.spacing(3)};
+`;
+
type FieldsWidgetProps = {
widget: PageLayoutWidget;
};
@@ -117,7 +126,7 @@ export const FieldsWidget = ({ widget }: FieldsWidgetProps) => {
key={section.id}
title={section.title}
>
-
+
{isPrefetchLoading ? (
) : (
@@ -182,7 +191,7 @@ export const FieldsWidget = ({ widget }: FieldsWidgetProps) => {
)}
>
)}
-
+
))}
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidgetSectionContainer.tsx b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidgetSectionContainer.tsx
index eed1cf46a8..902329210c 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidgetSectionContainer.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsWidgetSectionContainer.tsx
@@ -4,24 +4,12 @@ import { useState } from 'react';
import { IconChevronDown } from 'twenty-ui/display';
import { AnimatedExpandableContainer, Section } from 'twenty-ui/layout';
-const StyledFieldsWidgetSectionContainer = styled(Section)`
- padding-top: ${({ theme }) => theme.spacing(3)};
- padding-bottom: 0;
- width: auto;
-
- &:not(:first-of-type) {
- padding-top: 0;
- }
-`;
-
const StyledHeader = styled.header`
align-items: center;
cursor: pointer;
display: flex;
height: 24px;
justify-content: space-between;
- padding-left: ${({ theme }) => theme.spacing(3)};
- padding-right: ${({ theme }) => theme.spacing(2)};
`;
const StyledTitleLabel = styled.div`
@@ -53,7 +41,7 @@ export const FieldsWidgetSectionContainer = ({
setIsExpanded((previousIsExpanded) => !previousIsExpanded);
return (
-
+
+
);
};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCard.tsx b/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCard.tsx
index 9fa919fa61..6ddf53aba2 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCard.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCard.tsx
@@ -80,7 +80,9 @@ const StyledWidgetCard = styled.div<{
if (variant === 'side-column' && !isEditable) {
return css`
- padding: ${theme.spacing(2)};
+ gap: ${theme.spacing(2)};
+ padding: ${theme.spacing(3)};
+
${isLastWidget !== true &&
css`
border-bottom: 1px solid ${theme.border.color.light};
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeader.tsx b/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeader.tsx
index aaf72f8820..19f8059ab7 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeader.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/widget-card/components/WidgetCardHeader.tsx
@@ -2,18 +2,20 @@ import { WidgetActionRenderer } from '@/page-layout/widgets/components/WidgetAct
import { widgetCardHoveredComponentFamilyState } from '@/page-layout/widgets/states/widgetCardHoveredComponentFamilyState';
import { type WidgetAction } from '@/page-layout/widgets/types/WidgetAction';
import { useRecoilComponentFamilyValue } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentFamilyValue';
-import { useTheme } from '@emotion/react';
+import { css, useTheme } from '@emotion/react';
import styled from '@emotion/styled';
import { t } from '@lingui/core/macro';
import { type ReactNode } from 'react';
import { IconTrash, OverflowingTextWithTooltip } from 'twenty-ui/display';
import { IconButton } from 'twenty-ui/input';
+import { type WidgetCardVariant } from '@/page-layout/widgets/types/WidgetCardVariant';
import { WidgetGrip } from '@/page-layout/widgets/widget-card/components/WidgetGrip';
import { AnimatePresence, motion } from 'framer-motion';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
export type WidgetCardHeaderProps = {
+ variant: WidgetCardVariant;
widgetId: string;
isInEditMode: boolean;
isEmpty?: boolean;
@@ -32,14 +34,24 @@ const StyledWidgetCardHeader = styled.div`
flex-shrink: 0;
`;
-const StyledTitleContainer = styled.div`
+const StyledTitleContainer = styled.div<{ variant: WidgetCardVariant }>`
color: ${({ theme }) => theme.font.color.primary};
flex: 1;
font-size: ${({ theme }) => theme.font.size.md};
- padding-inline: ${({ theme }) => theme.spacing(1)};
font-weight: ${({ theme }) => theme.font.weight.medium};
user-select: none;
overflow: hidden;
+
+ ${({ theme, variant }) => {
+ switch (variant) {
+ case 'side-column':
+ return undefined;
+ default:
+ return css`
+ padding-inline: ${theme.spacing(1)};
+ `;
+ }
+ }}
`;
const StyledRightContainer = styled.div`
@@ -62,6 +74,7 @@ const StyledIconButtonContainer = styled(motion.div)`
export const WidgetCardHeader = ({
widgetId,
+ variant,
isEmpty = false,
isInEditMode = false,
isResizing = false,
@@ -88,7 +101,7 @@ export const WidgetCardHeader = ({
/>
)}
-
+
diff --git a/packages/twenty-front/src/modules/ui/layout/contexts/LayoutRenderingContext.tsx b/packages/twenty-front/src/modules/ui/layout/contexts/LayoutRenderingContext.tsx
index 28bd4965a1..fd9d159dd5 100644
--- a/packages/twenty-front/src/modules/ui/layout/contexts/LayoutRenderingContext.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/contexts/LayoutRenderingContext.tsx
@@ -11,6 +11,9 @@ export type LayoutRenderingContextType = {
layoutType: PageLayoutType;
isInRightDrawer: boolean;
+
+ /** TODO: Remove once the traditional record show page is removed. */
+ isLegacyRecordShowPage?: boolean;
};
export const [LayoutRenderingProvider, useLayoutRenderingContext] =