Skip to content

The open alternative to Salesforce, designed for AI.

fix(twenty-front): new layout fast-follows — command menu, field options & logs (#21429)

Félix Malfait9d7f0c405f6b
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx
index 057ad72441b..338174abe2c 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectFormOptionRow.tsx
@@ -74,7 +74,7 @@ type SettingsDataModelFieldSelectFormOptionRowProps = {
const StyledRow = styled.div`
align-items: center;
display: flex;
- height: ${themeCssVariables.spacing[6]};
+ min-height: ${themeCssVariables.spacing[6]};
padding: ${themeCssVariables.spacing['1.5']} 0;
`;
diff --git a/packages/twenty-front/src/modules/settings/event-logs/components/SettingsLogs.tsx b/packages/twenty-front/src/modules/settings/event-logs/components/SettingsLogs.tsx
index 9c51b874329..2d7ee5f8c24 100644
--- a/packages/twenty-front/src/modules/settings/event-logs/components/SettingsLogs.tsx
+++ b/packages/twenty-front/src/modules/settings/event-logs/components/SettingsLogs.tsx
@@ -162,7 +162,7 @@ export const SettingsLogs = () => {
};
const renderUpgradeCard = () => (
- <Card rounded>
+ <Card rounded backgroundColor={themeCssVariables.background.secondary}>
<SettingsOptionCardContentButton
Icon={IconLock}
title={t`Upgrade to access audit logs`}
@@ -230,7 +230,11 @@ export const SettingsLogs = () => {
return (
<StyledRoot>
- <Card rounded fullWidth>
+ <Card
+ rounded
+ fullWidth
+ backgroundColor={themeCssVariables.background.secondary}
+ >
<StyledCardContent>
<StyledSelectorRow>
<StyledSelectorGrow>
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 482a6540cae..7e19e628c18 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelList.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelList.tsx
@@ -29,7 +29,7 @@ const StyledInnerList = styled.div`
padding-left: ${themeCssVariables.spacing[2]};
padding-right: ${themeCssVariables.spacing[2]};
padding-top: ${themeCssVariables.spacing[2]};
- width: calc(100% - ${themeCssVariables.spacing[4]});
+ width: 100%;
@media (min-width: ${MOBILE_VIEWPORT}px) {
max-height: calc(
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBar.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBar.tsx
index 06392f70fae..55580d2c7af 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBar.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelTopBar.tsx
@@ -28,6 +28,12 @@ import {
themeCssVariables,
} from 'twenty-ui-deprecated/theme-constants';
+const COMMAND_MENU_SIDE_PANEL_PAGES = [
+ SidePanelPages.CommandMenuDisplay,
+ SidePanelPages.CommandMenuEdit,
+ SidePanelPages.SearchRecords,
+];
+
const StyledInputContainer = styled.div<{ isMobile: boolean }>`
align-items: center;
background-color: ${themeCssVariables.background.secondary};
@@ -127,10 +133,20 @@ export const SidePanelTopBar = () => {
});
};
- const canGoBack = sidePanelNavigationStack.length > 1;
+ const currentPage = sidePanelNavigationStack.at(-1)?.page;
+ const previousPage = sidePanelNavigationStack.at(-2)?.page;
+
+ // A command-menu page is the root of a fresh command-menu session, so it only
+ // offers a back chevron when it was opened from another command-menu page.
+ // Every other side-panel page keeps standard "go back when there is history".
+ const canGoBack =
+ currentPage !== undefined &&
+ COMMAND_MENU_SIDE_PANEL_PAGES.includes(currentPage)
+ ? previousPage !== undefined &&
+ COMMAND_MENU_SIDE_PANEL_PAGES.includes(previousPage)
+ : sidePanelNavigationStack.length > 1;
- const shouldShowCloseButton =
- !isMobile && sidePanelNavigationStack.length === 1;
+ const shouldShowCloseButton = !isMobile && !canGoBack;
const shouldShowBackButton = canGoBack;
@@ -166,15 +182,10 @@ export const SidePanelTopBar = () => {
</motion.div>
)}
</AnimatePresence>
- {lastChip &&
- sidePanelPage !== SidePanelPages.CommandMenuDisplay &&
- sidePanelPage !== SidePanelPages.CommandMenuEdit &&
- sidePanelPage !== SidePanelPages.SearchRecords && (
- <SidePanelPageInfo pageChip={lastChip} />
- )}
- {(sidePanelPage === SidePanelPages.CommandMenuDisplay ||
- sidePanelPage === SidePanelPages.CommandMenuEdit ||
- sidePanelPage === SidePanelPages.SearchRecords) && (
+ {lastChip && !COMMAND_MENU_SIDE_PANEL_PAGES.includes(sidePanelPage) && (
+ <SidePanelPageInfo pageChip={lastChip} />
+ )}
+ {COMMAND_MENU_SIDE_PANEL_PAGES.includes(sidePanelPage) && (
<>
<StyledInput
data-testid={SIDE_PANEL_FOCUS_ID}