Skip to content

The open alternative to Salesforce, designed for AI.

fix(front): pin record table columns with logical insets so they work in RTL (#28379)

almoghazaz-cella068131351d8
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 3a5494da95f..8b68345536e 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
@@ -98,14 +98,14 @@ const StyledTable = styled.div<{
div.header-cell.${RECORD_TABLE_COLUMN_DRAG_AND_DROP_WIDTH_CLASS_NAME} {
background-color: ${themeCssVariables.background.primary};
- left: 0px;
+ inset-inline-start: 0px;
position: sticky;
z-index: ${TABLE_Z_INDEX.headerColumns.headerColumnsSticky};
}
div.header-cell.${RECORD_TABLE_COLUMN_CHECKBOX_WIDTH_CLASS_NAME} {
background-color: ${themeCssVariables.background.primary};
- left: var(${RECORD_TABLE_DRAG_DROP_WIDTH_CSS_VAR});
+ inset-inline-start: var(${RECORD_TABLE_DRAG_DROP_WIDTH_CSS_VAR});
position: sticky;
top: 0;
z-index: ${TABLE_Z_INDEX.headerColumns.headerColumnsSticky};
@@ -113,35 +113,35 @@ const StyledTable = styled.div<{
div.header-cell.${getRecordTableColumnFieldWidthClassName(0)} {
background-color: ${themeCssVariables.background.primary};
- left: var(${RECORD_TABLE_FIRST_COLUMN_LEFT_CSS_VAR});
+ inset-inline-start: var(${RECORD_TABLE_FIRST_COLUMN_LEFT_CSS_VAR});
position: sticky;
- right: 0;
+ inset-inline-end: 0;
z-index: ${TABLE_Z_INDEX.headerColumns.headerColumnsSticky};
${HorizontalScrollBoxShadowCSS}
}
div.table-cell.${RECORD_TABLE_COLUMN_DRAG_AND_DROP_WIDTH_CLASS_NAME} {
- left: 0px;
+ inset-inline-start: 0px;
position: sticky;
z-index: ${TABLE_Z_INDEX.cell.sticky};
}
div.table-cell.${RECORD_TABLE_COLUMN_CHECKBOX_WIDTH_CLASS_NAME} {
- left: var(${RECORD_TABLE_DRAG_DROP_WIDTH_CSS_VAR});
+ inset-inline-start: var(${RECORD_TABLE_DRAG_DROP_WIDTH_CSS_VAR});
position: sticky;
z-index: ${TABLE_Z_INDEX.cell.sticky};
}
div.table-cell-0-0 {
- left: var(${RECORD_TABLE_FIRST_COLUMN_LEFT_CSS_VAR});
+ inset-inline-start: var(${RECORD_TABLE_FIRST_COLUMN_LEFT_CSS_VAR});
position: sticky;
${HorizontalScrollBoxShadowCSS}
}
div.table-cell.${getRecordTableColumnFieldWidthClassName(0)} {
- left: var(${RECORD_TABLE_FIRST_COLUMN_LEFT_CSS_VAR});
+ inset-inline-start: var(${RECORD_TABLE_FIRST_COLUMN_LEFT_CSS_VAR});
position: sticky;
z-index: ${TABLE_Z_INDEX.cell.sticky};
@@ -199,13 +199,13 @@ const StyledTable = styled.div<{
overflow-clip-margin: 4px;
}
- // Pins the content at the table's left edge so the name holds still and truncates from the right.
+ // Pins the content at the table's start edge so the name holds still and truncates at its end.
// Must stay zero-width, or sticky's containing-block constraint drags it along with the cell.
div.table-cell.${getRecordTableColumnFieldWidthClassName(0)}
> .${RECORD_TABLE_CELL_CONTENT_CLASS_NAME},
div.table-cell-0-0
> .${RECORD_TABLE_CELL_CONTENT_CLASS_NAME} {
- left: calc(
+ inset-inline-start: calc(
var(${RECORD_TABLE_DRAG_DROP_WIDTH_CSS_VAR}) +
var(${RECORD_TABLE_CHECKBOX_WIDTH_CSS_VAR})
);
@@ -222,7 +222,7 @@ const StyledTable = styled.div<{
> .${RECORD_TABLE_CELL_CONTENT_CLASS_NAME}
> .${RECORD_TABLE_CELL_DISPLAY_CLASS_NAME} {
height: 100%;
- left: 0;
+ inset-inline-start: 0;
position: absolute;
top: 0;
width: calc(
@@ -237,7 +237,7 @@ const StyledTable = styled.div<{
.${RECORD_TABLE_CELL_CONTENT_CLASS_NAME},
div.footer-cell.${getRecordTableColumnFieldWidthClassName(0)}
.${RECORD_TABLE_CELL_CONTENT_CLASS_NAME} {
- left: calc(
+ inset-inline-start: calc(
var(${RECORD_TABLE_DRAG_DROP_WIDTH_CSS_VAR}) +
var(${RECORD_TABLE_CHECKBOX_WIDTH_CSS_VAR})
);
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableDragAndDropPlaceholderCell.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableDragAndDropPlaceholderCell.tsx
index e48d797dccd..e82e2892bc8 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableDragAndDropPlaceholderCell.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableDragAndDropPlaceholderCell.tsx
@@ -8,7 +8,7 @@ const StyledPlaceholderDragAndDropCell = styled.div`
background-color: ${themeCssVariables.background.primary};
border-bottom: 1px solid ${themeCssVariables.background.primary};
height: ${RECORD_TABLE_ROW_HEIGHT}px;
- left: 0;
+ inset-inline-start: 0;
overflow: hidden;
position: sticky;
`;
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableAggregateFooter.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableAggregateFooter.tsx
index 60dd6935612..0117d0b8861 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableAggregateFooter.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableAggregateFooter.tsx
@@ -16,7 +16,7 @@ import { useIsMobile } from 'twenty-ui/utilities';
const StyledPlaceholderDragAndDropFooterCell = styled.div`
background-color: ${themeCssVariables.background.primary};
bottom: 0;
- left: 0px;
+ inset-inline-start: 0px;
position: sticky;
width: calc(
var(${RECORD_TABLE_DRAG_DROP_WIDTH_CSS_VAR}) +
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableAggregateFooterCell.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableAggregateFooterCell.tsx
index 32a67a3c8d0..a68a513dac1 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableAggregateFooterCell.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableAggregateFooterCell.tsx
@@ -37,7 +37,7 @@ const StyledColumnFooterCell = styled.div<{
cursor: ${({ isReadOnly }) => (isReadOnly ? 'default' : 'pointer')};
height: ${RECORD_TABLE_ROW_HEIGHT}px;
- left: ${({ isFirstCell }) =>
+ inset-inline-start: ${({ isFirstCell }) =>
isFirstCell ? `var(${RECORD_TABLE_FIRST_COLUMN_LEFT_CSS_VAR})` : 'auto'};
@media (hover: hover) {
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableActionRow.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableActionRow.tsx
index 26ecf02f64e..e424489098f 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableActionRow.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableActionRow.tsx
@@ -56,8 +56,8 @@ const StyledIconContainer = styled.div`
color: ${themeCssVariables.font.color.secondary};
display: flex;
height: ${RECORD_TABLE_ROW_HEIGHT}px;
+ inset-inline-start: ${RECORD_TABLE_COLUMN_DRAG_AND_DROP_WIDTH}px;
justify-content: center;
- left: ${RECORD_TABLE_COLUMN_DRAG_AND_DROP_WIDTH}px;
position: sticky;
width: ${RECORD_TABLE_COLUMN_CHECKBOX_WIDTH}px;
@@ -70,9 +70,9 @@ const StyledActionTextContainer = styled.div<{ width: number }>`
display: flex;
height: ${RECORD_TABLE_ROW_HEIGHT}px;
+ inset-inline-start: ${`${RECORD_TABLE_COLUMN_DRAG_AND_DROP_WIDTH + RECORD_TABLE_COLUMN_CHECKBOX_WIDTH}px`};
justify-content: start;
- left: ${`${RECORD_TABLE_COLUMN_DRAG_AND_DROP_WIDTH + RECORD_TABLE_COLUMN_CHECKBOX_WIDTH}px`};
position: sticky;
width: ${({ width }) => width}px;
`;
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableRowDragOverlayContent.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableRowDragOverlayContent.tsx
index a006d9898f9..26ee14802e4 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableRowDragOverlayContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-row/components/RecordTableRowDragOverlayContent.tsx
@@ -45,19 +45,19 @@ const StyledRowDragOverlayCSSBridge = styled.div`
position: relative;
div.table-cell.${RECORD_TABLE_COLUMN_DRAG_AND_DROP_WIDTH_CLASS_NAME} {
- left: 0px;
+ inset-inline-start: 0px;
position: sticky;
z-index: ${TABLE_Z_INDEX.cell.sticky};
}
div.table-cell.${RECORD_TABLE_COLUMN_CHECKBOX_WIDTH_CLASS_NAME} {
- left: var(${RECORD_TABLE_DRAG_DROP_WIDTH_CSS_VAR});
+ inset-inline-start: var(${RECORD_TABLE_DRAG_DROP_WIDTH_CSS_VAR});
position: sticky;
z-index: ${TABLE_Z_INDEX.cell.sticky};
}
div.table-cell-0-0 {
- left: calc(
+ inset-inline-start: calc(
var(${RECORD_TABLE_DRAG_DROP_WIDTH_CSS_VAR}) +
var(${RECORD_TABLE_CHECKBOX_WIDTH_CSS_VAR})
);
@@ -67,7 +67,7 @@ const StyledRowDragOverlayCSSBridge = styled.div`
}
div.table-cell.${getRecordTableColumnFieldWidthClassName(0)} {
- left: calc(
+ inset-inline-start: calc(
var(${RECORD_TABLE_DRAG_DROP_WIDTH_CSS_VAR}) +
var(${RECORD_TABLE_CHECKBOX_WIDTH_CSS_VAR})
);
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSection.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSection.tsx
index 75564c90fc7..84414ff8823 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSection.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-section/components/RecordTableRecordGroupSection.tsx
@@ -52,7 +52,7 @@ const StyledRecordGroupHeaderContainer = styled.div<{ width: number }>`
flex-direction: row;
gap: ${themeCssVariables.spacing[1]};
height: ${RECORD_TABLE_ROW_HEIGHT}px;
- left: ${RECORD_TABLE_COLUMN_DRAG_AND_DROP_WIDTH}px;
+ inset-inline-start: ${RECORD_TABLE_COLUMN_DRAG_AND_DROP_WIDTH}px;
min-width: ${({ width }) => width + RECORD_TABLE_COLUMN_CHECKBOX_WIDTH}px;
position: sticky;
@@ -82,7 +82,7 @@ const StyledRecordTableDragAndDropPlaceholderCell = styled.div`
border-bottom: 1px solid ${themeCssVariables.background.primary};
height: ${RECORD_TABLE_ROW_HEIGHT}px;
- left: 0;
+ inset-inline-start: 0;
min-width: ${RECORD_TABLE_COLUMN_DRAG_AND_DROP_WIDTH}px;