Skip to content

The open alternative to Salesforce, designed for AI.

Migrate dropdown menu rows to ListItem (#26297)

Raphaël Bosi539f1703f215
diff --git a/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx b/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx
index bf33f8255a6..af6cd8e00d2 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx
+++ b/packages/twenty-front-component-renderer/src/__stories__/TwentyUiGallery.stories.tsx
@@ -1,5 +1,5 @@
import { settingsRowTest } from '@/__stories__/twenty-ui-gallery/utils/settingsRowTest';
-import { listItemTest } from '@/__stories__/twenty-ui-gallery/utils/listItemTest';
+import { createListItemSandboxFailureTest } from '@/__stories__/twenty-ui-gallery/utils/createListItemSandboxFailureTest';
import { pickerListItemsTest } from '@/__stories__/twenty-ui-gallery/utils/pickerListItemsTest';
import { iconButtonElevatedTest } from '@/__stories__/twenty-ui-gallery/utils/iconButtonElevatedTest';
import { buttonControlsTest } from '@/__stories__/twenty-ui-gallery/utils/buttonControlsTest';
@@ -227,12 +227,12 @@ export const DisplayHelpersPreact: Story = createGalleryStory({
export const ListItemReact: Story = createGalleryStory({
frontComponentBundleName: 'twenty-ui-list-item',
runtime: 'react',
- play: listItemTest,
+ play: createListItemSandboxFailureTest('react'),
});
export const ListItemPreact: Story = createGalleryStory({
frontComponentBundleName: 'twenty-ui-list-item',
runtime: 'preact',
- play: listItemTest,
+ play: createListItemSandboxFailureTest('preact'),
});
export const PickerListItemsReact: Story = createGalleryStory({
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/constants/SANDBOX_ERROR_PATTERNS.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/constants/SANDBOX_ERROR_PATTERNS.ts
index 5be4295ebfd..1acf690dd07 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/constants/SANDBOX_ERROR_PATTERNS.ts
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/constants/SANDBOX_ERROR_PATTERNS.ts
@@ -11,6 +11,11 @@ export const SANDBOX_ERROR_PATTERNS = {
"Uncaught TypeError: Cannot read properties of undefined (reading 'pointerType')",
ELEMENT_MATCHES: /^(?:Uncaught TypeError: )?\w+\.matches is not a function$/,
ELEMENT_CLOSEST: /^(?:Uncaught TypeError: )?\w+\.closest is not a function$/,
+ ELEMENT_CONTAINS:
+ /^(?:Uncaught TypeError: )?\w+\.contains is not a function$/,
+ HOST_EVENT_LISTENER: 'Uncaught TypeError: listener is not a function',
+ ELEMENT_REF_FOCUS:
+ /^(?:Uncaught TypeError: )?\w+\.current\?\.focus is not a function$/,
POINTER_EVENT_CONSTRUCTOR:
/^Uncaught TypeError: .+\.PointerEvent is not a constructor$/,
};
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/createListItemSandboxFailureTest.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/createListItemSandboxFailureTest.ts
new file mode 100644
index 00000000000..9675ae5fe40
--- /dev/null
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/createListItemSandboxFailureTest.ts
@@ -0,0 +1,47 @@
+import { expect, userEvent, waitFor, within } from 'storybook/test';
+
+import { expectFrontComponentMounted } from '@/__stories__/shared/test-utils/matchers/expectFrontComponentMounted';
+import { SANDBOX_ERROR_PATTERNS } from '@/__stories__/twenty-ui-gallery/constants/SANDBOX_ERROR_PATTERNS';
+import { type TwentyUiGalleryPlayFunction } from '@/__stories__/twenty-ui-gallery/types/TwentyUiGalleryPlayFunction';
+import { expectSandboxErrors } from '@/__stories__/twenty-ui-gallery/utils/expectSandboxErrors';
+import { withKnownListItemHostErrors } from '@/__stories__/twenty-ui-gallery/utils/withKnownListItemHostErrors';
+
+export const createListItemSandboxFailureTest =
+ (runtime: 'react' | 'preact'): TwentyUiGalleryPlayFunction =>
+ async ({ canvasElement }) =>
+ withKnownListItemHostErrors(async () => {
+ const user = userEvent.setup();
+ const canvas = within(canvasElement);
+ await expectFrontComponentMounted(canvas);
+
+ const digest = canvas.getByText('Weekly digest');
+
+ await user.click(digest);
+ await waitFor(() =>
+ expect(canvas.getByRole('status')).toHaveTextContent('Digest: enabled'),
+ );
+ await user.click(digest);
+ await waitFor(() =>
+ expect(canvas.getByRole('status')).toHaveTextContent(
+ 'Digest: disabled',
+ ),
+ );
+ await user.click(canvas.getByText('Disabled preference'));
+ expect(canvas.getByRole('status')).toHaveTextContent('Digest: disabled');
+ const hiddenFields = canvas.getByRole('button', {
+ name: 'Hidden fields',
+ });
+ await user.click(hiddenFields);
+ await waitFor(() =>
+ expect(canvas.getByText('Fields: open')).toBeVisible(),
+ );
+ await expectSandboxErrors({
+ requiredErrors: [
+ runtime === 'react'
+ ? SANDBOX_ERROR_PATTERNS.COMPOSED_PATH
+ : SANDBOX_ERROR_PATTERNS.ELEMENT_CONTAINS,
+ ],
+ allowedAdditionalErrors:
+ runtime === 'preact' ? [SANDBOX_ERROR_PATTERNS.COMPOSED_PATH] : [],
+ });
+ });
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/listItemTest.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/listItemTest.ts
deleted file mode 100644
index b1672553314..00000000000
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/listItemTest.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import { expect, userEvent, waitFor, within } from 'storybook/test';
-
-import { errorHandler } from '@/__stories__/shared/test-utils/createFrontComponentStoryMeta';
-import { expectFrontComponentMounted } from '@/__stories__/shared/test-utils/matchers/expectFrontComponentMounted';
-import { type TwentyUiGalleryPlayFunction } from '@/__stories__/twenty-ui-gallery/types/TwentyUiGalleryPlayFunction';
-
-export const listItemTest: TwentyUiGalleryPlayFunction = async ({
- canvasElement,
-}) => {
- const canvas = within(canvasElement);
- await expectFrontComponentMounted(canvas);
-
- const digest = canvas.getByText('Weekly digest');
-
- await userEvent.click(digest);
- await waitFor(() =>
- expect(canvas.getByRole('status')).toHaveTextContent('Digest: enabled'),
- );
- await userEvent.click(digest);
- await waitFor(() =>
- expect(canvas.getByRole('status')).toHaveTextContent('Digest: disabled'),
- );
- await userEvent.click(canvas.getByText('Disabled preference'));
- expect(canvas.getByRole('status')).toHaveTextContent('Digest: disabled');
- const hiddenFields = canvas.getByRole('button', { name: 'Hidden fields' });
- await userEvent.click(hiddenFields);
- await waitFor(() => expect(canvas.getByText('Fields: open')).toBeVisible());
- expect(errorHandler).not.toHaveBeenCalled();
-};
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/settingsRowTest.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/settingsRowTest.ts
index 3b69e3942a1..d7212d17db8 100644
--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/settingsRowTest.ts
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/settingsRowTest.ts
@@ -26,5 +26,6 @@ export const settingsRowTest: TwentyUiGalleryPlayFunction = async ({
await expectSandboxErrors({
requiredErrors: [SANDBOX_ERROR_PATTERNS.NATIVE_EVENT_DEFAULT_PREVENTED],
+ allowedAdditionalErrors: [SANDBOX_ERROR_PATTERNS.ELEMENT_REF_FOCUS],
});
};
diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/withKnownListItemHostErrors.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/withKnownListItemHostErrors.ts
new file mode 100644
index 00000000000..b3e88511b67
--- /dev/null
+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/withKnownListItemHostErrors.ts
@@ -0,0 +1,33 @@
+import { expect } from 'storybook/test';
+
+import { SANDBOX_ERROR_PATTERNS } from '@/__stories__/twenty-ui-gallery/constants/SANDBOX_ERROR_PATTERNS';
+
+export const withKnownListItemHostErrors = async (
+ runTest: () => Promise<void>,
+) => {
+ const hostErrors: ErrorEvent[] = [];
+ const captureHostError = (event: ErrorEvent) => {
+ hostErrors.push(event);
+
+ if (event.message === SANDBOX_ERROR_PATTERNS.HOST_EVENT_LISTENER) {
+ event.preventDefault();
+ }
+ };
+
+ window.addEventListener('error', captureHostError);
+
+ try {
+ await runTest();
+ } finally {
+ window.removeEventListener('error', captureHostError);
+
+ for (const hostError of hostErrors) {
+ expect(hostError.message).toBe(
+ SANDBOX_ERROR_PATTERNS.HOST_EVENT_LISTENER,
+ );
+ expect(hostError.error).toMatchObject({
+ stack: expect.stringContaining('eventListenerCallbackWrapper'),
+ });
+ }
+ }
+};
diff --git a/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientChipMenuContent.tsx b/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientChipMenuContent.tsx
index c39d1b6a089..d726dd86497 100644
--- a/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientChipMenuContent.tsx
+++ b/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientChipMenuContent.tsx
@@ -3,7 +3,7 @@ import { isNonEmptyString } from '@sniptt/guards';
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconCopy, IconPencil, IconTrash, IconUserPlus } from 'twenty-ui/icon';
-import { MenuItem, MenuItemAvatar } from 'twenty-ui/primitives/navigation';
+import { ListItem, MenuItemAvatar } from 'twenty-ui/primitives/navigation';
import { type EmailRecipientResolution } from '@/activities/emails/recipients/hooks/useEmailRecipientsResolution';
import { type EmailRecipient } from '@/activities/emails/recipients/types/EmailRecipient';
@@ -129,29 +129,29 @@ export const EmailRecipientChipMenuContent = ({
contextualText={recipient.address}
/>
) : (
- <MenuItem
- LeftIcon={IconUserPlus}
- text={t`Add as person`}
+ <ListItem
+ startIcon={<IconUserPlus />}
onClick={handleAddAsPerson}
- />
+ >{t`Add as person`}</ListItem>
)}
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
</>
)}
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconCopy}
- text={t`Copy email`}
+ <ListItem
+ startIcon={<IconCopy />}
onClick={handleCopy}
- />
- <MenuItem LeftIcon={IconPencil} text={t`Edit`} onClick={handleEdit} />
- <MenuItem
- accent="danger"
- LeftIcon={IconTrash}
- text={t`Remove`}
+ >{t`Copy email`}</ListItem>
+ <ListItem
+ startIcon={<IconPencil />}
+ onClick={handleEdit}
+ >{t`Edit`}</ListItem>
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={handleRemove}
- />
+ >{t`Remove`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
);
diff --git a/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientSuggestionMenuItem.tsx b/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientSuggestionMenuItem.tsx
index 8e512c98cc7..33634801e5c 100644
--- a/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientSuggestionMenuItem.tsx
+++ b/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientSuggestionMenuItem.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { Avatar } from 'twenty-ui/primitives/data-display';
import { ListItem } from 'twenty-ui/primitives/navigation';
@@ -45,7 +44,7 @@ export const EmailRecipientSuggestionMenuItem = ({
/>
}
>
- <OverflowingTextWithTooltip text={suggestion.label} />
+ {suggestion.label}
</ListItem>
</SelectableListItem>
);
diff --git a/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientSuggestionsDropdownContent.tsx b/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientSuggestionsDropdownContent.tsx
index be9da7c4827..cbae58268e0 100644
--- a/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientSuggestionsDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/activities/emails/recipients/components/EmailRecipientSuggestionsDropdownContent.tsx
@@ -1,5 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useLingui } from '@lingui/react/macro';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { EmailRecipientSuggestionMenuItem } from '@/activities/emails/recipients/components/EmailRecipientSuggestionMenuItem';
import { type EmailRecipientSuggestion } from '@/activities/emails/recipients/types/EmailRecipientSuggestion';
@@ -27,7 +27,7 @@ export const EmailRecipientSuggestionsDropdownContent = ({
<DropdownContent widthInPixels={340}>
<DropdownMenuItemsContainer hasMaxHeight>
{suggestions.length === 0 ? (
- <MenuItem text={t`No results`} />
+ <ListItem disabled>{t`No results`}</ListItem>
) : (
<SelectableList
selectableListInstanceId={selectableListInstanceId}
diff --git a/packages/twenty-front/src/modules/activities/files/components/AttachmentDropdown.tsx b/packages/twenty-front/src/modules/activities/files/components/AttachmentDropdown.tsx
index 72848743ef5..3f135a0860c 100644
--- a/packages/twenty-front/src/modules/activities/files/components/AttachmentDropdown.tsx
+++ b/packages/twenty-front/src/modules/activities/files/components/AttachmentDropdown.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
@@ -11,7 +12,6 @@ import {
IconTrash,
} from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type AttachmentDropdownProps = {
onDownload: () => void;
@@ -60,23 +60,20 @@ export const AttachmentDropdown = ({
<DropdownContent widthInPixels={GenericDropdownContentWidth.Narrow}>
<DropdownMenuItemsContainer>
{hasDownloadPermission && (
- <MenuItem
- text={t`Download`}
- LeftIcon={IconDownload}
+ <ListItem
+ startIcon={<IconDownload />}
onClick={handleDownload}
- />
+ >{t`Download`}</ListItem>
)}
- <MenuItem
- text={t`Rename`}
- LeftIcon={IconPencil}
+ <ListItem
+ startIcon={<IconPencil />}
onClick={handleRename}
- />
- <MenuItem
- text={t`Delete`}
- accent="danger"
- LeftIcon={IconTrash}
+ >{t`Rename`}</ListItem>
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={handleDelete}
- />
+ >{t`Delete`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/AdvancedTextEditorInsertRail.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/AdvancedTextEditorInsertRail.tsx
index aed6e766b3e..87b6ab1e80a 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/components/AdvancedTextEditorInsertRail.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/components/AdvancedTextEditorInsertRail.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { type Editor } from '@tiptap/core';
@@ -17,7 +19,6 @@ import {
} from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { ADVANCED_TEXT_EDITOR_BLOCK_INSERTION_RECIPES } from '@/advanced-text-editor/constants/AdvancedTextEditorBlockInsertionRecipes';
@@ -273,36 +274,39 @@ export const AdvancedTextEditorInsertRail = ({
{openMenu === 'variables' && (
<StyledPopover>
{variables.map(({ label, value }) => (
- <MenuItem
+ <ListItem
key={value}
- text={<StyledVariableLiteral>{value}</StyledVariableLiteral>}
- contextualText={label}
+ description={label}
onClick={() => insertVariable(value)}
- />
+ >
+ <StyledVariableLiteral>{value}</StyledVariableLiteral>
+ </ListItem>
))}
</StyledPopover>
)}
{openMenu === 'text' && (
<StyledPopover>
{textItems.map(({ Icon, label, content }) => (
- <MenuItem
+ <ListItem
key={label}
- LeftIcon={Icon}
- text={label}
+ startIcon={<SelectOptionIcon Icon={Icon} />}
onClick={() => insertAtEnd(content)}
- />
+ >
+ {label}
+ </ListItem>
))}
</StyledPopover>
)}
{openMenu === 'blocks' && (
<StyledPopover>
{blockItems.map(({ Icon, id, label, content }) => (
- <MenuItem
+ <ListItem
key={id}
- LeftIcon={Icon}
- text={label}
+ startIcon={<SelectOptionIcon Icon={Icon} />}
onClick={() => insertAtEnd(content)}
- />
+ >
+ {label}
+ </ListItem>
))}
</StyledPopover>
)}
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/TurnIntoBlockDropdown.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/TurnIntoBlockDropdown.tsx
index e90bfc0a397..06f0df261ca 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/components/TurnIntoBlockDropdown.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/components/TurnIntoBlockDropdown.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useTurnIntoBlockOptions } from '@/advanced-text-editor/hooks/useTurnIntoBlockOptions';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
@@ -8,7 +10,6 @@ import { t } from '@lingui/core/macro';
import { type Editor } from '@tiptap/react';
import { useContext, useId } from 'react';
import { IconPilcrow } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
const StyledMenuItem = styled.button`
@@ -59,17 +60,18 @@ export const TurnIntoBlockDropdown = ({
<DropdownContent>
<DropdownMenuItemsContainer>
{options.map(({ id, title, icon, onClick }) => (
- <MenuItem
+ <ListItem
key={id}
- text={title}
- LeftIcon={icon}
+ startIcon={<SelectOptionIcon Icon={icon} />}
onClick={() => {
onClick();
toggleDropdown({
dropdownComponentInstanceIdFromProps: dropdownId,
});
}}
- />
+ >
+ {title}
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownGroupByMenu.tsx b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownGroupByMenu.tsx
index 69373a92595..e682e0bef14 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownGroupByMenu.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownGroupByMenu.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useLingui } from '@lingui/react/macro';
import { IconChevronLeft } from 'twenty-ui/icon';
import { ListItem } from 'twenty-ui/primitives/navigation';
@@ -56,9 +55,7 @@ export const AiChatThreadFilterDropdownGroupByMenu = ({
selected={agentChatThreadGroupBy === option}
indicator="check"
>
- <OverflowingTextWithTooltip
- text={t(AGENT_CHAT_THREAD_GROUP_BY_LABELS[option])}
- />
+ {t(AGENT_CHAT_THREAD_GROUP_BY_LABELS[option])}
</ListItem>
))}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownLastActivityMenu.tsx b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownLastActivityMenu.tsx
index 9e92e4fc59f..ca86a632664 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownLastActivityMenu.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownLastActivityMenu.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useLingui } from '@lingui/react/macro';
import { IconChevronLeft } from 'twenty-ui/icon';
import { ListItem } from 'twenty-ui/primitives/navigation';
@@ -60,9 +59,7 @@ export const AiChatThreadFilterDropdownLastActivityMenu = ({
selected={agentChatThreadLastActivityFilter === option}
indicator="check"
>
- <OverflowingTextWithTooltip
- text={t(AGENT_CHAT_THREAD_LAST_ACTIVITY_FILTER_LABELS[option])}
- />
+ {t(AGENT_CHAT_THREAD_LAST_ACTIVITY_FILTER_LABELS[option])}
</ListItem>
))}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownRootMenu.tsx b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownRootMenu.tsx
index d8588a04749..f4ccf73b187 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownRootMenu.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownRootMenu.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useLingui } from '@lingui/react/macro';
import {
IconClock,
@@ -22,7 +23,6 @@ import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/Drop
import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator';
import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { useAtomState } from '@/ui/utilities/state/jotai/hooks/useAtomState';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type AiChatThreadFilterDropdownRootMenuProps = {
dropdownId: string;
@@ -64,53 +64,49 @@ export const AiChatThreadFilterDropdownRootMenu = ({
return (
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconStatusChange}
- text={t`Status`}
- contextualText={t(
+ <ListItem
+ startIcon={<IconStatusChange />}
+ description={t(
AGENT_CHAT_THREAD_FILTER_STATUS_LABELS[agentChatThreadFilterStatus],
)}
- contextualTextPosition="right"
- hasSubMenu
+ descriptionPlacement="end"
+ hasSubmenu
onClick={() =>
onSelectPage(AI_CHAT_THREAD_FILTER_DROPDOWN_PAGE.STATUS)
}
- />
- <MenuItem
- LeftIcon={IconLayoutList}
- text={t`Group by`}
- contextualText={t(
+ >{t`Status`}</ListItem>
+ <ListItem
+ startIcon={<IconLayoutList />}
+ description={t(
AGENT_CHAT_THREAD_GROUP_BY_LABELS[agentChatThreadGroupBy],
)}
- contextualTextPosition="right"
- hasSubMenu
+ descriptionPlacement="end"
+ hasSubmenu
onClick={() =>
onSelectPage(AI_CHAT_THREAD_FILTER_DROPDOWN_PAGE.GROUP_BY)
}
- />
- <MenuItem
- LeftIcon={IconClock}
- text={t`Last activity`}
- contextualText={t(
+ >{t`Group by`}</ListItem>
+ <ListItem
+ startIcon={<IconClock />}
+ description={t(
AGENT_CHAT_THREAD_LAST_ACTIVITY_FILTER_LABELS[
agentChatThreadLastActivityFilter
],
)}
- contextualTextPosition="right"
- hasSubMenu
+ descriptionPlacement="end"
+ hasSubmenu
onClick={() =>
onSelectPage(AI_CHAT_THREAD_FILTER_DROPDOWN_PAGE.LAST_ACTIVITY)
}
- />
+ >{t`Last activity`}</ListItem>
{!isAtDefaults && (
<>
<DropdownMenuSeparator />
- <MenuItem
- accent="danger"
- LeftIcon={IconTrash}
- text={t`Clear filters`}
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={handleClearFilters}
- />
+ >{t`Clear filters`}</ListItem>
</>
)}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownStatusMenu.tsx b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownStatusMenu.tsx
index ea965793c3b..f98d0b93506 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownStatusMenu.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatThreadFilterDropdownStatusMenu.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useLingui } from '@lingui/react/macro';
import { IconChevronLeft } from 'twenty-ui/icon';
import { ListItem } from 'twenty-ui/primitives/navigation';
@@ -56,9 +55,7 @@ export const AiChatThreadFilterDropdownStatusMenu = ({
selected={agentChatThreadFilterStatus === option}
indicator="check"
>
- <OverflowingTextWithTooltip
- text={t(AGENT_CHAT_THREAD_FILTER_STATUS_LABELS[option])}
- />
+ {t(AGENT_CHAT_THREAD_FILTER_STATUS_LABELS[option])}
</ListItem>
))}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/ai/components/AiChatThreadItemMenu.tsx b/packages/twenty-front/src/modules/ai/components/AiChatThreadItemMenu.tsx
index 58618bc90d4..24fcba37b27 100644
--- a/packages/twenty-front/src/modules/ai/components/AiChatThreadItemMenu.tsx
+++ b/packages/twenty-front/src/modules/ai/components/AiChatThreadItemMenu.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useLingui } from '@lingui/react/macro';
import { type ReactNode } from 'react';
import {
@@ -8,7 +9,6 @@ import {
IconTrash,
} from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { type AiChatThreadActionsSurface } from '@/ai/types/AiChatThreadActionsSurface';
import { useChatThreadArchiveActions } from '@/ai/hooks/useChatThreadArchiveActions';
@@ -87,22 +87,21 @@ export const AiChatThreadItemMenu = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- text={t`Rename`}
- LeftIcon={IconPencil}
+ <ListItem
+ startIcon={<IconPencil />}
onClick={handleRename}
- />
- <MenuItem
- text={isArchived ? t`Unarchive` : t`Archive`}
- LeftIcon={isArchived ? IconArchiveOff : IconArchive}
+ >{t`Rename`}</ListItem>
+ <ListItem
+ startIcon={isArchived ? <IconArchiveOff /> : <IconArchive />}
onClick={handleArchive}
- />
- <MenuItem
- accent="danger"
- text={t`Delete`}
- LeftIcon={IconTrash}
+ >
+ {isArchived ? t`Unarchive` : t`Archive`}
+ </ListItem>
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={handleDelete}
- />
+ >{t`Delete`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/applications/components/AppMenuItem.tsx b/packages/twenty-front/src/modules/applications/components/AppMenuItem.tsx
index 40b80268b97..1af5e2df468 100644
--- a/packages/twenty-front/src/modules/applications/components/AppMenuItem.tsx
+++ b/packages/twenty-front/src/modules/applications/components/AppMenuItem.tsx
@@ -1,7 +1,16 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { AppChip } from '@/applications/components/AppChip';
import { useApplicationChipData } from '@/applications/hooks/useApplicationChipData';
+import { styled } from '@linaria/react';
import { type ReactNode } from 'react';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
+import { themeCssVariables } from 'twenty-ui/theme-constants';
+
+const StyledAppIconContainer = styled.span`
+ background: ${themeCssVariables.background.transparent.light};
+ border-radius: ${themeCssVariables.border.radius.sm};
+ display: flex;
+ padding: ${themeCssVariables.spacing[1]};
+`;
type AppMenuItemProps = {
applicationId?: string | null;
@@ -25,17 +34,19 @@ export const AppMenuItem = ({
});
return (
- <MenuItem
- withIconContainer={true}
- LeftIcon={() => (
- <AppChip applicationId={applicationId} size={'md'} chipOnly />
- )}
- text={text}
- contextualText={applicationChipData.name}
+ <ListItem
+ startIcon={
+ <StyledAppIconContainer>
+ <AppChip applicationId={applicationId} size="md" chipOnly />
+ </StyledAppIconContainer>
+ }
+ description={applicationChipData.name}
onClick={onClick}
focused={focused}
disabled={disabled}
- RightComponent={RightComponent}
- />
+ endIcon={RightComponent}
+ >
+ {text}
+ </ListItem>
);
};
diff --git a/packages/twenty-front/src/modules/command-menu-item/components/RecordIndexCommandMenuDropdown.tsx b/packages/twenty-front/src/modules/command-menu-item/components/RecordIndexCommandMenuDropdown.tsx
index fbb53dc1067..19db8e31d47 100644
--- a/packages/twenty-front/src/modules/command-menu-item/components/RecordIndexCommandMenuDropdown.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/components/RecordIndexCommandMenuDropdown.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { COMMAND_MENU_DROPDOWN_CLICK_OUTSIDE_ID } from '@/command-menu-item/constants/CommandMenuDropdownClickOutsideId';
import { CommandMenuContext } from '@/command-menu-item/contexts/CommandMenuContext';
import { CommandMenuItemRenderer } from '@/command-menu-item/display/components/CommandMenuItemRenderer';
@@ -19,7 +20,6 @@ import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { useContext } from 'react';
import { IconLayoutSidebarRightExpand } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { CommandMenuItemAvailabilityType } from '~/generated-metadata/graphql';
const StyledDropdownMenuContainer = styled.div`
@@ -100,15 +100,14 @@ export const RecordIndexCommandMenuDropdown = () => {
openSidePanelMenu();
}}
>
- <MenuItem
- LeftIcon={IconLayoutSidebarRightExpand}
+ <ListItem
+ startIcon={<IconLayoutSidebarRightExpand />}
onClick={() => {
closeDropdown(dropdownId);
openSidePanelMenu();
}}
focused={selectedItemId === 'more-actions'}
- text={t`More actions`}
- />
+ >{t`More actions`}</ListItem>
</SelectableListItem>
)}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/command-menu-item/components/RecordPageSidePanelCommandMenuDropdown.tsx b/packages/twenty-front/src/modules/command-menu-item/components/RecordPageSidePanelCommandMenuDropdown.tsx
index 47e7ee94c69..3c4436e8db2 100644
--- a/packages/twenty-front/src/modules/command-menu-item/components/RecordPageSidePanelCommandMenuDropdown.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/components/RecordPageSidePanelCommandMenuDropdown.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { CommandMenuContext } from '@/command-menu-item/contexts/CommandMenuContext';
import { CommandMenuItemRenderer } from '@/command-menu-item/display/components/CommandMenuItemRenderer';
import { usePinnedCommandMenuItemsInlineLayout } from '@/command-menu-item/display/hooks/usePinnedCommandMenuItemsInlineLayout';
@@ -11,7 +13,6 @@ import { useAvailableComponentInstanceIdOrThrow } from '@/ui/utilities/state/com
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useContext, useMemo } from 'react';
import { HorizontalSeparator } from 'twenty-ui/primitives/layout';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { CommandMenuItemAvailabilityType } from '~/generated-metadata/graphql';
export const RecordPageSidePanelCommandMenuDropdown = () => {
@@ -94,15 +95,16 @@ export const RecordPageSidePanelCommandMenuDropdown = () => {
selectableItemIdArray={selectableItemIdArray}
>
{dropdownWidgetCommandMenuItems.map((commandMenuItem) => (
- <MenuItem
+ <ListItem
key={commandMenuItem.id}
- text={commandMenuItem.label}
- LeftIcon={commandMenuItem.Icon}
+ startIcon={<SelectOptionIcon Icon={commandMenuItem.Icon} />}
onClick={() => {
closeDropdown(dropdownId);
commandMenuItem.onClick();
}}
- />
+ >
+ {commandMenuItem.label}
+ </ListItem>
))}
{dropdownWidgetCommandMenuItems.length > 0 &&
listedCommandMenuItems.length > 0 && <HorizontalSeparator noMargin />}
diff --git a/packages/twenty-front/src/modules/command-menu-item/display/components/CommandMenuItemRenderer.tsx b/packages/twenty-front/src/modules/command-menu-item/display/components/CommandMenuItemRenderer.tsx
index 81801852be6..533eeda805c 100644
--- a/packages/twenty-front/src/modules/command-menu-item/display/components/CommandMenuItemRenderer.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/display/components/CommandMenuItemRenderer.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { type CommandMenuItemDefinition } from '@/command-menu-item/types/CommandMenuItemDefinition';
import { AppMenuItem } from '@/applications/components/AppMenuItem';
@@ -19,7 +20,6 @@ import { useContext } from 'react';
import { assertUnreachable, isDefined } from 'twenty-shared/utils';
import { useIcons } from 'twenty-ui/icon';
import { Loader } from 'twenty-ui/primitives/feedback';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { FeatureFlagKey } from '~/generated-metadata/graphql';
const StyledPreviewWrapper = styled.div`
@@ -180,14 +180,15 @@ const CommandMenuItemSelectableRenderer = ({
return (
<SelectableListItem itemId={item.id} onEnter={onItemClick}>
- <MenuItem
+ <ListItem
focused={isSelectedItemId}
- LeftIcon={Icon}
+ startIcon={<Icon />}
onClick={onItemClick}
- text={label}
- RightComponent={loaderComponent}
+ endIcon={loaderComponent}
disabled={disabled}
- />
+ >
+ {label}
+ </ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/command-menu-item/edit/components/CommandMenuItemEditRecordSelectionDropdown.tsx b/packages/twenty-front/src/modules/command-menu-item/edit/components/CommandMenuItemEditRecordSelectionDropdown.tsx
index 66be665c8e4..bf7bbf97428 100644
--- a/packages/twenty-front/src/modules/command-menu-item/edit/components/CommandMenuItemEditRecordSelectionDropdown.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/edit/components/CommandMenuItemEditRecordSelectionDropdown.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { COMMAND_MENU_DROPDOWN_CLICK_OUTSIDE_ID } from '@/command-menu-item/constants/CommandMenuDropdownClickOutsideId';
import { useSelectFirstRecordForEditMode } from '@/command-menu-item/edit/hooks/useSelectFirstRecordForEditMode';
import { MAIN_CONTEXT_STORE_INSTANCE_ID } from '@/context-store/constants/MainContextStoreInstanceId';
@@ -120,9 +119,7 @@ export const CommandMenuItemEditRecordSelectionDropdown = ({
selected={isNoneSelected}
indicator="check"
startIcon={<SelectOptionIcon Icon={IconSquareX} />}
- >
- <OverflowingTextWithTooltip text={t`No record selected`} />
- </ListItem>
+ >{t`No record selected`}</ListItem>
<ListItem
onClick={() => handleSelectMode('selection')}
role="option"
@@ -130,9 +127,7 @@ export const CommandMenuItemEditRecordSelectionDropdown = ({
selected={!isNoneSelected}
indicator="check"
startIcon={<SelectOptionIcon Icon={IconSquareCheck} />}
- >
- <OverflowingTextWithTooltip text={t`Records selected`} />
- </ListItem>
+ >{t`Records selected`}</ListItem>
</DropdownMenuItemsContainer>
</StyledDropdownMenuContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/command-menu-item/edit/components/CommandMenuItemOptionsDropdown.tsx b/packages/twenty-front/src/modules/command-menu-item/edit/components/CommandMenuItemOptionsDropdown.tsx
index 4a257e8e771..6002bf41164 100644
--- a/packages/twenty-front/src/modules/command-menu-item/edit/components/CommandMenuItemOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/command-menu-item/edit/components/CommandMenuItemOptionsDropdown.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useResetCommandMenuItemToDefault } from '@/command-menu-item/edit/hooks/useResetCommandMenuItemToDefault';
import { useUpdateCommandMenuItemInDraft } from '@/command-menu-item/edit/hooks/useUpdateCommandMenuItemInDraft';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
@@ -10,7 +11,6 @@ import { type ReactElement } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { SettingsRow } from 'twenty-ui/components';
import { IconRefresh, IconTag } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { type CommandMenuItemFieldsFragment } from '~/generated-metadata/graphql';
type CommandMenuItemOptionsDropdownProps = Pick<
@@ -69,12 +69,10 @@ export const CommandMenuItemOptionsDropdown = ({
checked={isLabelHidden || hasNoShortLabel}
onCheckedChange={handleHiddenLabelChange}
>{t`Hide label`}</SettingsRow>
- <MenuItem
- LeftIcon={IconRefresh}
+ <ListItem
+ startIcon={<IconRefresh />}
onClick={handleResetToDefault}
- accent="default"
- text={t`Reset to default`}
- />
+ >{t`Reset to default`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBarMenuDropdown.tsx b/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBarMenuDropdown.tsx
index b0b6bfdfbcf..a09f8fbe413 100644
--- a/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBarMenuDropdown.tsx
+++ b/packages/twenty-front/src/modules/layout-customization/components/LayoutCustomizationBarMenuDropdown.tsx
@@ -1,8 +1,8 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { IconDotsVertical, IconReload } from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { GRAY_SCALE_LIGHT } from 'twenty-ui/theme';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -55,11 +55,10 @@ export const LayoutCustomizationBarMenuDropdown = () => {
dropdownComponents={
<DropdownContent widthInPixels={GenericDropdownContentWidth.Large}>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconReload}
- text={t`Reset record page layout`}
+ <ListItem
+ startIcon={<IconReload />}
onClick={handleResetClick}
- />
+ >{t`Reset record page layout`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderNavigationDrawerItemDropdown.tsx b/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderNavigationDrawerItemDropdown.tsx
index bc3974c4351..f1220a621ed 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderNavigationDrawerItemDropdown.tsx
+++ b/packages/twenty-front/src/modules/navigation-menu-item/display/folder/components/NavigationMenuItemFolderNavigationDrawerItemDropdown.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useLingui } from '@lingui/react/macro';
import {
IconDotsVertical,
@@ -6,7 +7,6 @@ import {
IconTrash,
} from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { NavigationMenuItemMenu } from '@/navigation-menu-item/edit/components/NavigationMenuItemMenu';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
@@ -42,30 +42,25 @@ export const NavigationMenuItemFolderNavigationDrawerItemDropdown = ({
renderMenu={({ onClose, onAdd }) => (
<DropdownContent widthInPixels={GenericDropdownContentWidth.Large}>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconEdit}
+ <ListItem
+ startIcon={<IconEdit />}
onClick={() => {
onClose();
onEdit();
}}
- accent="default"
- text={t`Edit`}
- />
- <MenuItem
- LeftIcon={IconPlus}
+ >{t`Edit`}</ListItem>
+ <ListItem
+ startIcon={<IconPlus />}
onClick={() => onAdd({ folderId, position: itemCount })}
- accent="default"
- text={t`Add menu item`}
- />
- <MenuItem
- LeftIcon={IconTrash}
+ >{t`Add menu item`}</ListItem>
+ <ListItem
+ startIcon={<IconTrash />}
onClick={() => {
onClose();
onDelete();
}}
- accent="danger"
- text={t`Remove from sidebar`}
- />
+ color="danger"
+ >{t`Remove from sidebar`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
)}
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/edit/components/NavigationMenuItemAddDropdownContent.tsx b/packages/twenty-front/src/modules/navigation-menu-item/edit/components/NavigationMenuItemAddDropdownContent.tsx
index 61c6acf0a73..a60e17db1f4 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/edit/components/NavigationMenuItemAddDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/navigation-menu-item/edit/components/NavigationMenuItemAddDropdownContent.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { type NavigationMenuItemSection } from '@/navigation-menu-item/common/types/NavigationMenuItemSection';
import { NavigationMenuItemInsertionPreviewEffect } from '@/navigation-menu-item/edit/effect-components/NavigationMenuItemInsertionPreviewEffect';
import {
@@ -18,7 +19,6 @@ import { isNonEmptyString } from '@sniptt/guards';
import { NavigationMenuItemType } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, IconX } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { DropdownMenuHeaderLeftComponent } from '@/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader/DropdownMenuHeader';
@@ -220,9 +220,7 @@ export const NavigationMenuItemAddDropdownContent = ({
))}
</Fragment>
))}
- {items.length === 0 && (
- <MenuItem disabled text={emptyMessage} accent="placeholder" />
- )}
+ {items.length === 0 && <ListItem disabled>{emptyMessage}</ListItem>}
</DropdownMenuItemsContainer>
</SelectableList>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/navigation-menu-item/edit/components/NavigationMenuItemSelectableItem.tsx b/packages/twenty-front/src/modules/navigation-menu-item/edit/components/NavigationMenuItemSelectableItem.tsx
index 3b2aad2972c..06b5793fbda 100644
--- a/packages/twenty-front/src/modules/navigation-menu-item/edit/components/NavigationMenuItemSelectableItem.tsx
+++ b/packages/twenty-front/src/modules/navigation-menu-item/edit/components/NavigationMenuItemSelectableItem.tsx
@@ -1,7 +1,8 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { type ReactNode } from 'react';
import { type IconComponent } from 'twenty-ui/icon';
import { useLingui } from '@lingui/react/macro';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
import { isSelectedItemIdComponentFamilyState } from '@/ui/layout/selectable-list/states/isSelectedItemIdComponentFamilyState';
import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue';
@@ -33,20 +34,24 @@ export const NavigationMenuItemSelectableItem = ({
itemId={item.id}
onEnter={item.isDisabled ? undefined : item.onClick}
>
- <MenuItem
- text={item.label}
- accent={item.accent}
- LeftIcon={item.Icon}
- LeftComponent={item.icon}
+ <ListItem
+ color={item.accent === 'danger' ? 'danger' : 'neutral'}
+ startIcon={
+ <>
+ <SelectOptionIcon Icon={item.Icon} />
+ {item.icon}
+ </>
+ }
onClick={item.onClick}
disabled={item.isDisabled}
- contextualText={
+ description={
item.isAlreadyInSidebar ? t`Already in sidebar` : item.contextualText
}
- contextualTextPosition="left"
- hasSubMenu={item.hasSubMenu}
+ hasSubmenu={item.hasSubMenu}
focused={isSelectedItemId}
- />
+ >
+ {item.label}
+ </ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterAddFilterRuleSelect.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterAddFilterRuleSelect.tsx
index 7705c3b1156..80eec9761e8 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterAddFilterRuleSelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterAddFilterRuleSelect.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { CommandMenuButton } from '@/command-menu/components/CommandMenuButton';
import { useChildRecordFiltersAndRecordFilterGroups } from '@/object-record/advanced-filter/hooks/useChildRecordFiltersAndRecordFilterGroups';
import { useGetDefaultFieldMetadataItemForFilter } from '@/object-record/advanced-filter/hooks/useGetDefaultFieldMetadataItemForFilter';
@@ -20,7 +21,6 @@ import { useContext } from 'react';
import { RecordFilterGroupLogicalOperator } from 'twenty-shared/types';
import { getFilterTypeFromFieldType, isDefined } from 'twenty-shared/utils';
import { IconLibraryPlus, IconPlus } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { v4 } from 'uuid';
type AdvancedFilterAddFilterRuleSelectProps = {
@@ -171,17 +171,15 @@ export const AdvancedFilterAddFilterRuleSelect = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconPlus}
- text={t`Add rule`}
+ <ListItem
+ startIcon={<IconPlus />}
onClick={handleAddFilter}
- />
+ >{t`Add rule`}</ListItem>
{isFilterRuleGroupOptionVisible && (
- <MenuItem
- LeftIcon={IconLibraryPlus}
- text={t`Add rule group`}
+ <ListItem
+ startIcon={<IconLibraryPlus />}
onClick={handleAddFilterGroup}
- />
+ >{t`Add rule group`}</ListItem>
)}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterCompositeSubFieldSelectMenu.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterCompositeSubFieldSelectMenu.tsx
index 807d02ff589..af0e9ca6e6e 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterCompositeSubFieldSelectMenu.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterCompositeSubFieldSelectMenu.tsx
@@ -1,3 +1,6 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { useAdvancedFilterFieldSelectDropdown } from '@/object-record/advanced-filter/hooks/useAdvancedFilterFieldSelectDropdown';
import { useApplyAdvancedFilterCompositeSubField } from '@/object-record/advanced-filter/hooks/useApplyAdvancedFilterCompositeSubField';
@@ -24,7 +27,6 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, useIcons } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type AdvancedFilterCompositeSubFieldSelectMenuProps = {
recordFilterId: string;
@@ -140,18 +142,25 @@ export const AdvancedFilterCompositeSubFieldSelectMenu = ({
});
}}
>
- <MenuItem
+ <ListItem
key={`select-filter-${-1}`}
- testId={`select-filter-${-1}`}
+ data-testid={`select-filter-${-1}`}
focused={selectedItemId === '-1'}
onClick={() => {
handleSelectFilter({
fieldMetadataItem: fieldMetadataItemUsedInDropdown,
});
}}
- LeftIcon={getIcon(fieldMetadataItemUsedInDropdown.icon)}
- text={t`Any ${fieldLabel ?? ''} field`}
- />
+ startIcon={
+ <SelectOptionIcon
+ Icon={getIcon(fieldMetadataItemUsedInDropdown.icon)}
+ />
+ }
+ >
+ <OverflowingTextWithTooltip
+ text={t`Any ${fieldLabel ?? ''} field`}
+ />
+ </ListItem>
</SelectableListItem>
)}
{subFieldsAreFilterable &&
@@ -167,25 +176,30 @@ export const AdvancedFilterCompositeSubFieldSelectMenu = ({
});
}}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === subFieldName}
key={`select-filter-${index}`}
- testId={`select-filter-${index}`}
+ data-testid={`select-filter-${index}`}
onClick={() => {
handleSelectFilter({
fieldMetadataItem: fieldMetadataItemUsedInDropdown,
subFieldName,
});
}}
- text={getCompositeSubFieldLabel(
+ startIcon={
+ <SelectOptionIcon
+ Icon={getIcon(
+ ICON_NAME_BY_SUB_FIELD[subFieldName] ??
+ fieldMetadataItemUsedInDropdown.icon,
+ )}
+ />
+ }
+ >
+ {getCompositeSubFieldLabel(
objectFilterDropdownSubMenuFieldType,
subFieldName,
)}
- LeftIcon={getIcon(
- ICON_NAME_BY_SUB_FIELD[subFieldName] ??
- fieldMetadataItemUsedInDropdown.icon,
- )}
- />
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterGroupOptionsDropdown.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterGroupOptionsDropdown.tsx
index c377c85e6f2..b7c65aa82ab 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterGroupOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterGroupOptionsDropdown.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useChildRecordFiltersAndRecordFilterGroups } from '@/object-record/advanced-filter/hooks/useChildRecordFiltersAndRecordFilterGroups';
import { useRemoveRecordFilterGroup } from '@/object-record/record-filter-group/hooks/useRemoveRecordFilterGroup';
import { useRemoveRootRecordFilterGroupIfEmpty } from '@/object-record/record-filter-group/hooks/useRemoveRootRecordFilterGroupIfEmpty';
@@ -10,7 +11,6 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { IconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type AdvancedFilterRecordFilterGroupOptionsDropdownProps = {
recordFilterGroupId: string;
@@ -55,12 +55,11 @@ export const AdvancedFilterRecordFilterGroupOptionsDropdown = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- text={t`Remove rule group`}
+ <ListItem
onClick={handleRemove}
- LeftIcon={IconTrash}
- accent="danger"
- />
+ startIcon={<IconTrash />}
+ color="danger"
+ >{t`Remove rule group`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOperandSelectContent.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOperandSelectContent.tsx
index 09dae7b6fe4..3fe0bea3a7b 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOperandSelectContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOperandSelectContent.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { DEFAULT_ADVANCED_FILTER_DROPDOWN_OFFSET } from '@/object-record/advanced-filter/constants/DefaultAdvancedFilterDropdownOffset';
import { useSetRecordFilterUsedInAdvancedFilterDropdownRow } from '@/object-record/advanced-filter/hooks/useSetRecordFilterUsedInAdvancedFilterDropdownRow';
import { AdvancedFilterContext } from '@/object-record/advanced-filter/states/context/AdvancedFilterContext';
@@ -21,7 +22,6 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { t } from '@lingui/core/macro';
import { useContext } from 'react';
import { type ViewFilterOperand } from 'twenty-shared/types';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type AdvancedFilterRecordFilterOperandSelectContentProps = {
recordFilterId: string;
@@ -104,13 +104,14 @@ export const AdvancedFilterRecordFilterOperandSelectContent = ({
handleOperandChange(filterOperand);
}}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === filterOperand}
onClick={() => {
handleOperandChange(filterOperand);
}}
- text={getOperandLabel(filterOperand, timeZoneAbbreviation)}
- />
+ >
+ {getOperandLabel(filterOperand, timeZoneAbbreviation)}
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOptionsDropdown.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOptionsDropdown.tsx
index b90240fafb1..54bfccb4997 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRecordFilterOptionsDropdown.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useChildRecordFiltersAndRecordFilterGroups } from '@/object-record/advanced-filter/hooks/useChildRecordFiltersAndRecordFilterGroups';
import { useRemoveRecordFilterGroup } from '@/object-record/record-filter-group/hooks/useRemoveRecordFilterGroup';
import { useRemoveRootRecordFilterGroupIfEmpty } from '@/object-record/record-filter-group/hooks/useRemoveRootRecordFilterGroupIfEmpty';
@@ -15,7 +16,6 @@ import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { IconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type AdvancedFilterRecordFilterOptionsDropdownProps = {
recordFilterId: string;
@@ -75,12 +75,11 @@ export const AdvancedFilterRecordFilterOptionsDropdown = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- text={t`Remove rule`}
+ <ListItem
onClick={handleRemove}
- LeftIcon={IconTrash}
- accent="danger"
- />
+ startIcon={<IconTrash />}
+ color="danger"
+ >{t`Remove rule`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRelationTargetFieldSelectMenu.tsx b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRelationTargetFieldSelectMenu.tsx
index 460b67b6289..dfaf68898bd 100644
--- a/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRelationTargetFieldSelectMenu.tsx
+++ b/packages/twenty-front/src/modules/object-record/advanced-filter/components/AdvancedFilterRelationTargetFieldSelectMenu.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { isManyToOneRelationField } from '@/object-metadata/utils/isManyToOneRelationField';
@@ -23,7 +25,6 @@ import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSe
import { CoreObjectNameSingular } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, IconUserCircle, useIcons } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
const RELATION_RECORD_SELECTABLE_ITEM_ID = 'relation-record-select';
@@ -148,15 +149,16 @@ export const AdvancedFilterRelationTargetFieldSelectMenu = ({
itemId={RELATION_RECORD_SELECTABLE_ITEM_ID}
onEnter={handleSelectRelationRecord}
>
- <MenuItem
+ <ListItem
focused={
selectedItemId === RELATION_RECORD_SELECTABLE_ITEM_ID
}
- testId="select-filter-relation-record"
+ data-testid={'select-filter-relation-record'}
onClick={handleSelectRelationRecord}
- text={workspaceMemberObjectMetadataItem.labelSingular}
- LeftIcon={IconUserCircle}
- />
+ startIcon={<IconUserCircle />}
+ >
+ {workspaceMemberObjectMetadataItem.labelSingular}
+ </ListItem>
</SelectableListItem>
<DropdownMenuSeparator />
</>
@@ -169,16 +171,19 @@ export const AdvancedFilterRelationTargetFieldSelectMenu = ({
handleSelectTargetField(targetField);
}}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === targetField.id}
key={`select-filter-relation-${index}`}
- testId={`select-filter-relation-${index}`}
+ data-testid={`select-filter-relation-${index}`}
onClick={() => {
handleSelectTargetField(targetField);
}}
- text={targetField.label}
- LeftIcon={getIcon(targetField.icon)}
- />
+ startIcon={
+ <SelectOptionIcon Icon={getIcon(targetField.icon)} />
+ }
+ >
+ {targetField.label}
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCountrySelect.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCountrySelect.tsx
index ab132116fd6..90a8e64a21f 100644
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCountrySelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCountrySelect.tsx
@@ -1,4 +1,4 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useApplyObjectFilterDropdownFilterValue } from '@/object-record/object-filter-dropdown/hooks/useApplyObjectFilterDropdownFilterValue';
import { fieldMetadataItemUsedInDropdownComponentSelector } from '@/object-record/object-filter-dropdown/states/fieldMetadataItemUsedInDropdownComponentSelector';
import { objectFilterDropdownCurrentRecordFilterComponentState } from '@/object-record/object-filter-dropdown/states/objectFilterDropdownCurrentRecordFilterComponentState';
@@ -17,7 +17,6 @@ import { useLingui } from '@lingui/react/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { type ChangeEvent, useState } from 'react';
import { isDefined, parseJson } from 'twenty-shared/utils';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { z } from 'zod';
export const EMPTY_FILTER_VALUE = '[]';
@@ -129,7 +128,7 @@ export const ObjectFilterDropdownCountrySelect = () => {
}}
startIcon={getCountryFlagMenuItemAvatar(item.name, countries)}
>
- <OverflowingTextWithTooltip text={item.name} />
+ {item.name}
</ListItem>
);
})}
@@ -147,11 +146,11 @@ export const ObjectFilterDropdownCountrySelect = () => {
}}
startIcon={getCountryFlagMenuItemAvatar(item.name, countries)}
>
- <OverflowingTextWithTooltip text={item.name} />
+ {item.name}
</ListItem>
);
})}
- {showNoResult && <MenuItem text={t`No results`} />}
+ {showNoResult && <ListItem disabled>{t`No results`}</ListItem>}
</DropdownMenuItemsContainer>
</DropdownContent>
);
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCurrencySelect.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCurrencySelect.tsx
index 6e91f8c8f3f..8ba26ab5147 100644
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCurrencySelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownCurrencySelect.tsx
@@ -1,4 +1,4 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useApplyObjectFilterDropdownFilterValue } from '@/object-record/object-filter-dropdown/hooks/useApplyObjectFilterDropdownFilterValue';
import { fieldMetadataItemUsedInDropdownComponentSelector } from '@/object-record/object-filter-dropdown/states/fieldMetadataItemUsedInDropdownComponentSelector';
import { objectFilterDropdownCurrentRecordFilterComponentState } from '@/object-record/object-filter-dropdown/states/objectFilterDropdownCurrentRecordFilterComponentState';
@@ -16,7 +16,6 @@ import { useLingui } from '@lingui/react/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { type ChangeEvent, useState } from 'react';
import { isDefined, parseJson } from 'twenty-shared/utils';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { z } from 'zod';
export const EMPTY_FILTER_VALUE = '[]';
@@ -128,7 +127,7 @@ export const ObjectFilterDropdownCurrencySelect = () => {
}}
startIcon={item.AvatarIcon && <item.AvatarIcon size="16" />}
>
- <OverflowingTextWithTooltip text={item.name} />
+ {item.name}
</ListItem>
);
})}
@@ -146,11 +145,11 @@ export const ObjectFilterDropdownCurrencySelect = () => {
}}
startIcon={item.AvatarIcon && <item.AvatarIcon size="16" />}
>
- <OverflowingTextWithTooltip text={item.name} />
+ {item.name}
</ListItem>
);
})}
- {showNoResult && <MenuItem text={t`No results`} />}
+ {showNoResult && <ListItem disabled>{t`No results`}</ListItem>}
</DropdownMenuItemsContainer>
</DropdownContent>
);
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownFilterSelectMenuItem.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownFilterSelectMenuItem.tsx
index 0d69622993b..b3ff440fe53 100644
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownFilterSelectMenuItem.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownFilterSelectMenuItem.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { isCompositeFieldType } from '@/object-record/object-filter-dropdown/utils/isCompositeFieldType';
import { isManyToOneRelationField } from '@/object-metadata/utils/isManyToOneRelationField';
@@ -5,7 +7,6 @@ import { useSelectableList } from '@/ui/layout/selectable-list/hooks/useSelectab
import { isSelectedItemIdComponentFamilyState } from '@/ui/layout/selectable-list/states/isSelectedItemIdComponentFamilyState';
import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue';
import { useIcons } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
export type ObjectFilterDropdownFilterSelectMenuItemProps = {
fieldMetadataItemToSelect: FieldMetadataItem;
@@ -38,12 +39,13 @@ export const ObjectFilterDropdownFilterSelectMenuItem = ({
};
return (
- <MenuItem
+ <ListItem
focused={isSelectedItemId}
onClick={handleClick}
- LeftIcon={Icon}
- text={fieldMetadataItemToSelect.label}
- hasSubMenu={shouldShowSubMenu}
- />
+ startIcon={<SelectOptionIcon Icon={Icon} />}
+ hasSubmenu={shouldShowSubMenu}
+ >
+ {fieldMetadataItemToSelect.label}
+ </ListItem>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownOptionSelect.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownOptionSelect.tsx
index d7edf977dc7..d59d642d91e 100644
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownOptionSelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownOptionSelect.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { Tag } from 'twenty-ui/primitives/data-display';
import { useEffect, useMemo, useState } from 'react';
@@ -27,7 +28,6 @@ import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { MAX_OPTIONS_TO_DISPLAY } from 'twenty-shared/constants';
import { isDefined, parseJson } from 'twenty-shared/utils';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { z } from 'zod';
export const EMPTY_FILTER_VALUE = '';
@@ -176,7 +176,7 @@ export const ObjectFilterDropdownOptionSelect = ({
>
<DropdownMenuItemsContainer isMultiSelect hasMaxHeight>
{showNoResult ? (
- <MenuItem text={t`No results`} />
+ <ListItem disabled>{t`No results`}</ListItem>
) : (
optionsInDropdown?.map((option) => (
<ListItem
diff --git a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownRecordPinnedItems.tsx b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownRecordPinnedItems.tsx
index 776a64bb211..ed5997b97ba 100644
--- a/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownRecordPinnedItems.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-filter-dropdown/components/ObjectFilterDropdownRecordPinnedItems.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type SelectableItem } from '@/object-record/select/types/SelectableItem';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { Avatar } from 'twenty-ui/primitives/data-display';
@@ -42,7 +41,7 @@ export const ObjectFilterDropdownRecordPinnedItems = (props: {
)
}
>
- <OverflowingTextWithTooltip text={selectableItem.name} />
+ {selectableItem.name}
</ListItem>
);
})}
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarFieldsContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarFieldsContent.tsx
index dd8668146b9..8bac2bea3f2 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarFieldsContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarFieldsContent.tsx
@@ -1,5 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { useObjectOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsDropdown';
import { recordIndexCalendarFieldMetadataIdComponentState } from '@/object-record/record-index/states/recordIndexCalendarFieldMetadataIdComponentState';
@@ -15,7 +15,6 @@ import { useGetAvailableFieldsForCalendar } from '@/views/view-picker/hooks/useG
import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
import { IconChevronLeft, IconSettings, useIcons } from 'twenty-ui/icon';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
export const ObjectOptionsDropdownCalendarFieldsContent = () => {
const { t } = useLingui();
@@ -93,20 +92,19 @@ export const ObjectOptionsDropdownCalendarFieldsContent = () => {
<SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
}
>
- <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ {fieldMetadataItem.label}
</ListItem>
))}
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
<DropdownMenuItemsContainer scrollable={false}>
- <MenuItem
- LeftIcon={IconSettings}
- text={t`Create date field`}
+ <ListItem
+ startIcon={<IconSettings />}
onClick={() => {
navigateToDateFieldSettings();
closeDropdown();
}}
- />
+ >{t`Create date field`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
);
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarViewContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarViewContent.tsx
index af38ea3d811..e3207aa34bd 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarViewContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCalendarViewContent.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useSetAtomComponentState } from '@/ui/utilities/state/jotai/hooks/useSetAtomComponentState';
import { useObjectOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsDropdown';
import { recordIndexCalendarLayoutComponentState } from '@/object-record/record-index/states/recordIndexCalendarLayoutComponentState';
@@ -95,9 +94,7 @@ export const ObjectOptionsDropdownCalendarViewContent = () => {
selected={recordIndexCalendarLayout === ViewCalendarLayout.DAY}
indicator="check"
startIcon={<SelectOptionIcon Icon={IconCalendarEvent} />}
- >
- <OverflowingTextWithTooltip text={t`Day`} />
- </ListItem>
+ >{t`Day`}</ListItem>
</SelectableListItem>
<SelectableListItem
itemId={ViewCalendarLayout.WEEK}
@@ -113,9 +110,7 @@ export const ObjectOptionsDropdownCalendarViewContent = () => {
selected={recordIndexCalendarLayout === ViewCalendarLayout.WEEK}
indicator="check"
startIcon={<SelectOptionIcon Icon={IconCalendarWeek} />}
- >
- <OverflowingTextWithTooltip text={t`Week`} />
- </ListItem>
+ >{t`Week`}</ListItem>
</SelectableListItem>
<SelectableListItem
itemId={ViewCalendarLayout.MONTH}
@@ -131,9 +126,7 @@ export const ObjectOptionsDropdownCalendarViewContent = () => {
selected={recordIndexCalendarLayout === ViewCalendarLayout.MONTH}
indicator="check"
startIcon={<SelectOptionIcon Icon={IconCalendarMonth} />}
- >
- <OverflowingTextWithTooltip text={t`Month`} />
- </ListItem>
+ >{t`Month`}</ListItem>
</SelectableListItem>
<SelectableListItem itemId={RECORD_CALENDAR_TIMELINE_VIEW_ID}>
<ListItem
@@ -146,9 +139,7 @@ export const ObjectOptionsDropdownCalendarViewContent = () => {
description={<Pill label={t`Soon`} />}
descriptionPlacement={'end'}
startIcon={<SelectOptionIcon Icon={IconTimelineEvent} />}
- >
- <OverflowingTextWithTooltip text={t`Timeline`} />
- </ListItem>
+ >{t`Timeline`}</ListItem>
</SelectableListItem>
</SelectableList>
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCustomView.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCustomView.tsx
index 285e153c2e7..4f9ed55b050 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCustomView.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownCustomView.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { ObjectOptionsDropdownMenuViewName } from '@/object-record/object-options-dropdown/components/ObjectOptionsDropdownMenuViewName';
import { useObjectOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsDropdown';
import { useObjectOptionsForBoard } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsForBoard';
@@ -36,7 +38,6 @@ import {
IconTrash,
} from 'twenty-ui/icon';
import { Tooltip } from 'twenty-ui/primitives/surfaces';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { ViewCalendarLayout } from '~/generated-metadata/graphql';
interface ObjectOptionsDropdownCustomViewProps {
@@ -148,35 +149,37 @@ export const ObjectOptionsDropdownCustomView = ({
itemId="Layout"
onEnter={() => onContentChange('layout')}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'Layout'}
onClick={() => onContentChange('layout')}
- LeftIcon={viewTypeIconMapping(
- customViewData?.type ?? ViewType.TABLE,
- )}
- text={t`Layout`}
- contextualText={t(getViewTypeLabel(customViewData.type))}
- contextualTextPosition="right"
- hasSubMenu
- />
+ startIcon={
+ <SelectOptionIcon
+ Icon={viewTypeIconMapping(
+ customViewData?.type ?? ViewType.TABLE,
+ )}
+ />
+ }
+ description={t(getViewTypeLabel(customViewData.type))}
+ descriptionPlacement="end"
+ hasSubmenu
+ >{t`Layout`}</ListItem>
</SelectableListItem>
<SelectableListItem
itemId="Visibility"
onEnter={() => onContentChange('visibility')}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'Visibility'}
onClick={() => onContentChange('visibility')}
- LeftIcon={IconShare}
- text={t`Visibility`}
- contextualText={
+ startIcon={<IconShare />}
+ description={
customViewData?.visibility === 'UNLISTED'
? t`Unlisted`
: t`Workspace`
}
- contextualTextPosition="right"
- hasSubMenu
- />
+ descriptionPlacement="end"
+ hasSubmenu
+ >{t`Visibility`}</ListItem>
</SelectableListItem>
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
@@ -188,40 +191,38 @@ export const ObjectOptionsDropdownCustomView = ({
itemId="CalendarDateField"
onEnter={() => onContentChange('calendarFields')}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'CalendarDateField'}
onClick={() => onContentChange('calendarFields')}
- LeftIcon={IconCalendar}
- text={t`Date field`}
- contextualText={
+ startIcon={<IconCalendar />}
+ description={
isDefaultView
? t`Not available on Default View`
: calendarFieldMetadata?.label
}
- contextualTextPosition="right"
- hasSubMenu
+ descriptionPlacement="end"
+ hasSubmenu
disabled={isDefaultView}
- />
+ >{t`Date field`}</ListItem>
</SelectableListItem>
</div>
<SelectableListItem
itemId="CalendarView"
onEnter={() => onContentChange('calendarView')}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'CalendarView'}
onClick={() => onContentChange('calendarView')}
- LeftIcon={IconCalendarWeek}
- text={t`Calendar view`}
- contextualText={
+ startIcon={<IconCalendarWeek />}
+ description={
recordIndexCalendarLayout === ViewCalendarLayout.MONTH
? t`Month`
: recordIndexCalendarLayout === ViewCalendarLayout.WEEK
? t`Week`
: t`Day`
}
- contextualTextPosition="right"
- />
+ descriptionPlacement="end"
+ >{t`Calendar view`}</ListItem>
</SelectableListItem>
</>
)}
@@ -229,15 +230,14 @@ export const ObjectOptionsDropdownCustomView = ({
itemId="Fields"
onEnter={() => onContentChange('fields')}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'Fields'}
onClick={() => onContentChange('fields')}
- LeftIcon={IconListDetails}
- text={t`Fields`}
- contextualText={t`${visibleFieldsCount} selected`}
- contextualTextPosition="right"
- hasSubMenu
- />
+ startIcon={<IconListDetails />}
+ description={t`${visibleFieldsCount} selected`}
+ descriptionPlacement="end"
+ hasSubmenu
+ >{t`Fields`}</ListItem>
</SelectableListItem>
{customViewData?.type !== ViewType.CALENDAR && (
<Tooltip
@@ -256,24 +256,23 @@ export const ObjectOptionsDropdownCustomView = ({
: onContentChange('recordGroupFields')
}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'Group'}
onClick={() =>
isDefined(recordIndexGroupFieldMetadataItem)
? onContentChange('recordGroups')
: onContentChange('recordGroupFields')
}
- LeftIcon={IconLayoutList}
- text={t`Group`}
- contextualText={
+ startIcon={<IconLayoutList />}
+ description={
isDefaultView
? t`Not available on Default View`
: recordIndexGroupFieldMetadataItem?.label
}
- contextualTextPosition="right"
- hasSubMenu
+ descriptionPlacement="end"
+ hasSubmenu
disabled={isDefaultView}
- />
+ >{t`Group`}</ListItem>
</SelectableListItem>
</div>
</Tooltip>
@@ -297,14 +296,13 @@ export const ObjectOptionsDropdownCustomView = ({
itemId="Delete view"
onEnter={() => handleDelete()}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'Delete view'}
onClick={() => handleDelete()}
- LeftIcon={IconTrash}
- text={t`Delete view`}
+ startIcon={<IconTrash />}
disabled={isDefaultView || isLastView}
- accent="danger"
- />
+ color="danger"
+ >{t`Delete view`}</ListItem>
</SelectableListItem>
</div>
</Tooltip>
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownDefaultView.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownDefaultView.tsx
index 06b0d5107eb..20cd09183fd 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownDefaultView.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownDefaultView.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useObjectOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsDropdown';
import { visibleRecordFieldsComponentSelector } from '@/object-record/record-field/states/visibleRecordFieldsComponentSelector';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
@@ -19,7 +21,6 @@ import {
IconLock,
useIcons,
} from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { useCopyToClipboard } from '~/hooks/useCopyToClipboard';
export const ObjectOptionsDropdownDefaultView = () => {
@@ -64,12 +65,11 @@ export const ObjectOptionsDropdownDefaultView = () => {
return (
<DropdownContent>
<DropdownMenuItemsContainer scrollable={false}>
- <MenuItem
- text={t`Default View`}
- LeftIcon={MainIcon}
- RightIcon={IconLock}
+ <ListItem
+ startIcon={<SelectOptionIcon Icon={MainIcon} />}
+ endIcon={<IconLock />}
disabled={true}
- />
+ >{t`Default View`}</ListItem>
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
<SelectableList
@@ -82,15 +82,14 @@ export const ObjectOptionsDropdownDefaultView = () => {
itemId="Fields"
onEnter={() => onContentChange('fields')}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'Fields'}
onClick={() => onContentChange('fields')}
- LeftIcon={IconListDetails}
- text={t`Fields`}
- contextualText={t`${visibleFieldsCount} selected`}
- contextualTextPosition="right"
- hasSubMenu
- />
+ startIcon={<IconListDetails />}
+ description={t`${visibleFieldsCount} selected`}
+ descriptionPlacement="end"
+ hasSubmenu
+ >{t`Fields`}</ListItem>
</SelectableListItem>
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
@@ -102,27 +101,24 @@ export const ObjectOptionsDropdownDefaultView = () => {
copyToClipboard(currentUrl, t`Link copied to clipboard`);
}}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'Copy link to view'}
onClick={() => {
const currentUrl = window.location.href;
copyToClipboard(currentUrl, t`Link copied to clipboard`);
}}
- LeftIcon={IconCopy}
- text={t`Copy link to view`}
- />
+ startIcon={<IconCopy />}
+ >{t`Copy link to view`}</ListItem>
</SelectableListItem>
<SelectableListItem
itemId="Create custom view"
onEnter={handleCreateCustomView}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'Create custom view'}
onClick={handleCreateCustomView}
- LeftIcon={IconLayout}
- text={t`Create custom view`}
- contextualTextPosition="right"
- />
+ startIcon={<IconLayout />}
+ >{t`Create custom view`}</ListItem>
</SelectableListItem>
</DropdownMenuItemsContainer>
</SelectableList>
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenFieldsContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenFieldsContent.tsx
index 2705c7b9117..574c2e1b87d 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenFieldsContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenFieldsContent.tsx
@@ -15,7 +15,7 @@ import { useLingui } from '@lingui/react/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { IconChevronLeft, IconSettings } from 'twenty-ui/icon';
-import { MenuItem, UndecoratedLink } from 'twenty-ui/primitives/navigation';
+import { ListItem, UndecoratedLink } from 'twenty-ui/primitives/navigation';
export const ObjectOptionsDropdownHiddenFieldsContent = () => {
const { t } = useLingui();
@@ -57,7 +57,7 @@ export const ObjectOptionsDropdownHiddenFieldsContent = () => {
}}
>
<DropdownMenuItemsContainer scrollable={false}>
- <MenuItem LeftIcon={IconSettings} text={t`Edit Fields`} />
+ <ListItem startIcon={<IconSettings />}>{t`Edit Fields`}</ListItem>
</DropdownMenuItemsContainer>
</UndecoratedLink>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenRecordGroupsContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenRecordGroupsContent.tsx
index f2f97c03a24..7b375e6ae76 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenRecordGroupsContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownHiddenRecordGroupsContent.tsx
@@ -24,7 +24,7 @@ import { VIEW_GROUP_VISIBLE_OPTIONS_MAX } from 'twenty-shared/constants';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { IconChevronLeft, IconSettings } from 'twenty-ui/icon';
-import { MenuItem, UndecoratedLink } from 'twenty-ui/primitives/navigation';
+import { ListItem, UndecoratedLink } from 'twenty-ui/primitives/navigation';
export const ObjectOptionsDropdownHiddenRecordGroupsContent = () => {
const { t } = useLingui();
@@ -108,7 +108,9 @@ export const ObjectOptionsDropdownHiddenRecordGroupsContent = () => {
}}
>
<DropdownMenuItemsContainer>
- <MenuItem LeftIcon={IconSettings} text={t`Edit field values`} />
+ <ListItem
+ startIcon={<IconSettings />}
+ >{t`Edit field values`}</ListItem>
</DropdownMenuItemsContainer>
</UndecoratedLink>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownLayoutContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownLayoutContent.tsx
index b24018d7696..67703a8eb9b 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownLayoutContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownLayoutContent.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useObjectOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsDropdown';
import { useSetViewTypeFromLayoutOptionsMenu } from '@/object-record/object-options-dropdown/hooks/useSetViewTypeFromLayoutOptionsMenu';
@@ -36,7 +37,6 @@ import {
IconTable,
} from 'twenty-ui/icon';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { ViewCalendarLayout } from '~/generated-metadata/graphql';
export const ObjectOptionsDropdownLayoutContent = () => {
@@ -168,11 +168,9 @@ export const ObjectOptionsDropdownLayoutContent = () => {
aria-selected={currentView?.type === ViewType.TABLE}
selected={currentView?.type === ViewType.TABLE}
indicator="check"
- startIcon={<SelectOptionIcon Icon={IconTable} />}
+ startIcon={<IconTable />}
>
- <OverflowingTextWithTooltip
- text={t(getViewTypeLabel(ViewType.TABLE))}
- />
+ {t(getViewTypeLabel(ViewType.TABLE))}
</ListItem>
</SelectableListItem>
<SelectableListItem
@@ -196,9 +194,7 @@ export const ObjectOptionsDropdownLayoutContent = () => {
<SelectOptionIcon Icon={viewTypeIconMapping(ViewType.LIST)} />
}
>
- <OverflowingTextWithTooltip
- text={t(getViewTypeLabel(ViewType.LIST))}
- />
+ {t(getViewTypeLabel(ViewType.LIST))}
</ListItem>
</SelectableListItem>
<SelectableListItem
@@ -220,9 +216,7 @@ export const ObjectOptionsDropdownLayoutContent = () => {
/>
}
>
- <OverflowingTextWithTooltip
- text={t(getViewTypeLabel(ViewType.CALENDAR))}
- />
+ {t(getViewTypeLabel(ViewType.CALENDAR))}
</ListItem>
</SelectableListItem>
<SelectableListItem
@@ -258,9 +252,7 @@ export const ObjectOptionsDropdownLayoutContent = () => {
/>
}
>
- <OverflowingTextWithTooltip
- text={t(getViewTypeLabel(ViewType.KANBAN))}
- />
+ {t(getViewTypeLabel(ViewType.KANBAN))}
</ListItem>
</SelectableListItem>
</DropdownMenuItemsContainer>
@@ -272,35 +264,33 @@ export const ObjectOptionsDropdownLayoutContent = () => {
itemId="CalendarDateField"
onEnter={() => onContentChange('calendarFields')}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'CalendarDateField'}
onClick={() => onContentChange('calendarFields')}
- LeftIcon={IconCalendar}
- text={t`Date field`}
- contextualText={calendarFieldMetadata?.label}
- contextualTextPosition="right"
- hasSubMenu
- />
+ startIcon={<IconCalendar />}
+ description={calendarFieldMetadata?.label}
+ descriptionPlacement="end"
+ hasSubmenu
+ >{t`Date field`}</ListItem>
</SelectableListItem>
<SelectableListItem
itemId="CalendarView"
onEnter={() => onContentChange('calendarView')}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'CalendarView'}
onClick={() => onContentChange('calendarView')}
- LeftIcon={IconCalendarWeek}
- text={t`Calendar view`}
- contextualText={
+ startIcon={<IconCalendarWeek />}
+ description={
recordIndexCalendarLayout === ViewCalendarLayout.MONTH
? t`Month`
: recordIndexCalendarLayout === ViewCalendarLayout.WEEK
? t`Week`
: t`Day`
}
- contextualTextPosition="right"
- hasSubMenu
- />
+ descriptionPlacement="end"
+ hasSubmenu
+ >{t`Calendar view`}</ListItem>
</SelectableListItem>
</>
)}
@@ -313,19 +303,18 @@ export const ObjectOptionsDropdownLayoutContent = () => {
: onContentChange('recordGroupFields');
}}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'Group'}
onClick={() =>
isDefined(recordIndexGroupFieldMetadataItem)
? onContentChange('recordGroups')
: onContentChange('recordGroupFields')
}
- LeftIcon={IconLayoutList}
- text={t`Group`}
- contextualText={recordIndexGroupFieldMetadataItem?.label}
- contextualTextPosition="right"
- hasSubMenu
- />
+ startIcon={<IconLayoutList />}
+ description={recordIndexGroupFieldMetadataItem?.label}
+ descriptionPlacement="end"
+ hasSubmenu
+ >{t`Group`}</ListItem>
</SelectableListItem>
)}
{currentView?.type !== ViewType.TABLE &&
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupFieldsContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupFieldsContent.tsx
index ff19e475138..c9db1010f64 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupFieldsContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupFieldsContent.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useEffect } from 'react';
import { useObjectNamePluralFromSingular } from '@/object-metadata/hooks/useObjectNamePluralFromSingular';
@@ -26,11 +25,7 @@ import { useLocation } from 'react-router-dom';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath, isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, IconSettings, useIcons } from 'twenty-ui/icon';
-import {
- MenuItem,
- UndecoratedLink,
- ListItem,
-} from 'twenty-ui/primitives/navigation';
+import { ListItem, UndecoratedLink } from 'twenty-ui/primitives/navigation';
import { FieldMetadataType } from '~/generated-metadata/graphql';
export const ObjectOptionsDropdownRecordGroupFieldsContent = () => {
@@ -136,9 +131,7 @@ export const ObjectOptionsDropdownRecordGroupFieldsContent = () => {
aria-selected={!isDefined(recordIndexGroupFieldMetadataItem)}
selected={!isDefined(recordIndexGroupFieldMetadataItem)}
indicator="check"
- >
- <OverflowingTextWithTooltip text={t`None`} />
- </ListItem>
+ >{t`None`}</ListItem>
)}
{filteredRecordGroupFieldMetadataItems.map((fieldMetadataItem) => (
<ListItem
@@ -156,7 +149,7 @@ export const ObjectOptionsDropdownRecordGroupFieldsContent = () => {
<SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
}
>
- <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ {fieldMetadataItem.label}
</ListItem>
))}
</DropdownMenuItemsContainer>
@@ -169,7 +162,9 @@ export const ObjectOptionsDropdownRecordGroupFieldsContent = () => {
closeDropdown();
}}
>
- <MenuItem LeftIcon={IconSettings} text={t`Create select field`} />
+ <ListItem
+ startIcon={<IconSettings />}
+ >{t`Create select field`}</ListItem>
</UndecoratedLink>
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupSortContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupSortContent.tsx
index e3b38c19b84..7839e0f6b9f 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupSortContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupSortContent.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useEffect } from 'react';
import { isManyToOneRelationField } from '@/object-metadata/utils/isManyToOneRelationField';
@@ -108,7 +107,7 @@ export const ObjectOptionsDropdownRecordGroupSortContent = () => {
indicator="check"
startIcon={<SelectOptionIcon Icon={IconHandMove} />}
>
- <OverflowingTextWithTooltip text={RecordGroupSort.Manual} />
+ {RecordGroupSort.Manual}
</ListItem>
</SelectableListItem>
{!isRelationGroupBy && (
@@ -134,9 +133,7 @@ export const ObjectOptionsDropdownRecordGroupSortContent = () => {
indicator="check"
startIcon={<SelectOptionIcon Icon={IconSortAZ} />}
>
- <OverflowingTextWithTooltip
- text={RecordGroupSort.Alphabetical}
- />
+ {RecordGroupSort.Alphabetical}
</ListItem>
</SelectableListItem>
<SelectableListItem
@@ -168,9 +165,7 @@ export const ObjectOptionsDropdownRecordGroupSortContent = () => {
indicator="check"
startIcon={<SelectOptionIcon Icon={IconSortZA} />}
>
- <OverflowingTextWithTooltip
- text={RecordGroupSort.ReverseAlphabetical}
- />
+ {RecordGroupSort.ReverseAlphabetical}
</ListItem>
</SelectableListItem>
</>
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupsContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupsContent.tsx
index 202ff23ba46..2a702c70ef6 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupsContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownRecordGroupsContent.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useEffect } from 'react';
import { isManyToOneRelationField } from '@/object-metadata/utils/isManyToOneRelationField';
import { useObjectOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsDropdown';
@@ -33,7 +34,6 @@ import {
IconLayoutList,
IconPlus,
} from 'twenty-ui/icon';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
export const ObjectOptionsDropdownRecordGroupsContent = () => {
const { t } = useLingui();
@@ -138,30 +138,28 @@ export const ObjectOptionsDropdownRecordGroupsContent = () => {
onContentChange('recordGroupFields')
}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'GroupBy'}
disabled={isGroupByFieldPickerDisabled}
onClick={() => onContentChange('recordGroupFields')}
- LeftIcon={IconLayoutList}
- text={t`Group by`}
- contextualText={recordIndexGroupFieldMetadataItem?.label}
- contextualTextPosition="right"
- hasSubMenu
- />
+ startIcon={<IconLayoutList />}
+ description={recordIndexGroupFieldMetadataItem?.label}
+ descriptionPlacement="end"
+ hasSubmenu
+ >{t`Group by`}</ListItem>
</SelectableListItem>
<SelectableListItem
itemId="Sort"
onEnter={() => onContentChange('recordGroupSort')}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'Sort'}
onClick={() => onContentChange('recordGroupSort')}
- LeftIcon={IconArrowsSort}
- text={t`Sort`}
- contextualText={recordIndexRecordGroupSort}
- contextualTextPosition="right"
- hasSubMenu
- />
+ startIcon={<IconArrowsSort />}
+ description={recordIndexRecordGroupSort}
+ descriptionPlacement="end"
+ hasSubmenu
+ >{t`Sort`}</ListItem>
</SelectableListItem>
</>
)}
@@ -195,11 +193,10 @@ export const ObjectOptionsDropdownRecordGroupsContent = () => {
<>
<DropdownMenuSeparator />
<DropdownMenuItemsContainer scrollable={false}>
- <MenuItem
+ <ListItem
onClick={() => onContentChange('addRecordGroup')}
- LeftIcon={IconPlus}
- text={t`New group`}
- />
+ startIcon={<IconPlus />}
+ >{t`New group`}</ListItem>
</DropdownMenuItemsContainer>
</>
)}
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownVisibilityContent.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownVisibilityContent.tsx
index aab57ee71c8..2a7a86e28df 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownVisibilityContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/ObjectOptionsDropdownVisibilityContent.tsx
@@ -1,4 +1,4 @@
-import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useObjectOptionsDropdown } from '@/object-record/object-options-dropdown/hooks/useObjectOptionsDropdown';
import { useHasPermissionFlag } from '@/settings/roles/hooks/useHasPermissionFlag';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
@@ -23,11 +23,7 @@ import {
IconCircleDashed,
IconCopy,
} from 'twenty-ui/icon';
-import {
- Tooltip,
- OverflowingTextWithTooltip,
-} from 'twenty-ui/primitives/surfaces';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
+import { Tooltip } from 'twenty-ui/primitives/surfaces';
import {
ViewVisibility,
PermissionFlagType,
@@ -116,10 +112,8 @@ export const ObjectOptionsDropdownVisibilityContent = () => {
selected={currentVisibility === ViewVisibility.WORKSPACE}
indicator="check"
description={t`Everyone`}
- startIcon={<SelectOptionIcon Icon={IconCircle} />}
- >
- <OverflowingTextWithTooltip text={t`Workspace`} />
- </ListItem>
+ startIcon={<IconCircle />}
+ >{t`Workspace`}</ListItem>
</div>
</Tooltip>
</SelectableListItem>
@@ -139,10 +133,8 @@ export const ObjectOptionsDropdownVisibilityContent = () => {
selected={currentVisibility === ViewVisibility.UNLISTED}
indicator="check"
description={t`Visible to you`}
- startIcon={<SelectOptionIcon Icon={IconCircleDashed} />}
- >
- <OverflowingTextWithTooltip text={t`Unlisted`} />
- </ListItem>
+ startIcon={<IconCircleDashed />}
+ >{t`Unlisted`}</ListItem>
</SelectableListItem>
{currentVisibility === ViewVisibility.WORKSPACE && (
<>
@@ -151,12 +143,11 @@ export const ObjectOptionsDropdownVisibilityContent = () => {
itemId="Copy view link"
onEnter={handleCopyLink}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'Copy view link'}
onClick={handleCopyLink}
- LeftIcon={IconCopy}
- text={t`Copy view link`}
- />
+ startIcon={<IconCopy />}
+ >{t`Copy view link`}</ListItem>
</SelectableListItem>
</>
)}
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__stories__/ObjectOptionsDropdownContent.stories.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__stories__/ObjectOptionsDropdownContent.stories.tsx
index 7888679acb4..9c415f4141b 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__stories__/ObjectOptionsDropdownContent.stories.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__stories__/ObjectOptionsDropdownContent.stories.tsx
@@ -1,4 +1,5 @@
import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { expect, userEvent, waitFor, within } from 'storybook/test';
import { RecordComponentInstanceContextsWrapper } from '@/object-record/components/RecordComponentInstanceContextsWrapper';
import { ObjectOptionsDropdownContent } from '@/object-record/object-options-dropdown/components/ObjectOptionsDropdownContent';
@@ -144,3 +145,39 @@ export const RecordGroupFields = createStory('recordGroupFields');
export const RecordGroupSort = createStory('recordGroupSort');
export const HiddenRecordGroups = createStory('hiddenRecordGroups');
+
+export const FieldsSearchVisibilityAction: Story = {
+ ...createStory('fields'),
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+
+ await userEvent.type(
+ await canvas.findByPlaceholderText('Search fields'),
+ 'address',
+ );
+
+ const row = await canvas.findByText('Address');
+ const toggle = await canvas.findByRole('button', {
+ name: /^(Show|Hide) field$/,
+ });
+ const initialLabel = toggle.getAttribute('aria-label');
+
+ await userEvent.click(row);
+
+ expect(
+ canvas.getByRole('button', { name: initialLabel as string }),
+ ).toBeInTheDocument();
+
+ await userEvent.hover(row);
+ await userEvent.click(toggle);
+
+ const toggledLabel =
+ initialLabel === 'Show field' ? 'Hide field' : 'Show field';
+
+ await waitFor(() => {
+ expect(
+ canvas.getByRole('button', { name: toggledLabel }),
+ ).toBeInTheDocument();
+ });
+ },
+};
diff --git a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__tests__/ObjectOptionsDropdownCalendarViewContent.test.tsx b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__tests__/ObjectOptionsDropdownCalendarViewContent.test.tsx
index 8ef758da14a..1ea33995d54 100644
--- a/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__tests__/ObjectOptionsDropdownCalendarViewContent.test.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-options-dropdown/components/__tests__/ObjectOptionsDropdownCalendarViewContent.test.tsx
@@ -93,7 +93,6 @@ jest.mock('twenty-ui/primitives/data-display', () => ({
Pill: ({ label }: { label: string }) => <span>{label}</span>,
}));
jest.mock('twenty-ui/primitives/navigation', () => ({
- MenuItem: ({ text }: { text: string }) => <span>{text}</span>,
ListItem: ({
description,
disabled,
diff --git a/packages/twenty-front/src/modules/object-record/object-sort-dropdown/components/ObjectSortDropdownButton.tsx b/packages/twenty-front/src/modules/object-record/object-sort-dropdown/components/ObjectSortDropdownButton.tsx
index e44a9d80ce6..47669c620bc 100644
--- a/packages/twenty-front/src/modules/object-record/object-sort-dropdown/components/ObjectSortDropdownButton.tsx
+++ b/packages/twenty-front/src/modules/object-record/object-sort-dropdown/components/ObjectSortDropdownButton.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { availableFieldMetadataItemsForSortFamilySelector } from '@/object-metadata/states/availableFieldMetadataItemsForSortFamilySelector';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { getObjectSortDropdownId } from '@/object-record/object-sort-dropdown/utils/getObjectSortDropdownId';
@@ -33,7 +35,6 @@ import { useAtomFamilySelectorValue } from '@/ui/utilities/state/jotai/hooks/use
import { Trans, useLingui } from '@lingui/react/macro';
import { findByProperty } from 'twenty-shared/utils';
import { IconX, useIcons } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { v4 } from 'uuid';
import { ViewSortDirection } from '~/generated-metadata/graphql';
@@ -230,17 +231,22 @@ export const ObjectSortDropdownButton = () => {
itemId={visibleFieldMetadataItem.id}
onEnter={() => handleAddSort(visibleFieldMetadataItem)}
>
- <MenuItem
+ <ListItem
focused={
selectedItemId === visibleFieldMetadataItem.id
}
- testId={`visible-select-sort-${index}`}
+ data-testid={`visible-select-sort-${index}`}
onClick={() =>
handleAddSort(visibleFieldMetadataItem)
}
- LeftIcon={getIcon(visibleFieldMetadataItem.icon)}
- text={visibleFieldMetadataItem.label}
- />
+ startIcon={
+ <SelectOptionIcon
+ Icon={getIcon(visibleFieldMetadataItem.icon)}
+ />
+ }
+ >
+ {visibleFieldMetadataItem.label}
+ </ListItem>
</SelectableListItem>
),
)}
@@ -259,15 +265,20 @@ export const ObjectSortDropdownButton = () => {
itemId={hiddenFieldMetadataItem.id}
onEnter={() => handleAddSort(hiddenFieldMetadataItem)}
>
- <MenuItem
+ <ListItem
focused={
selectedItemId === hiddenFieldMetadataItem.id
}
- testId={`hidden-select-sort-${index}`}
+ data-testid={`hidden-select-sort-${index}`}
onClick={() => handleAddSort(hiddenFieldMetadataItem)}
- LeftIcon={getIcon(hiddenFieldMetadataItem.icon)}
- text={hiddenFieldMetadataItem.label}
- />
+ startIcon={
+ <SelectOptionIcon
+ Icon={getIcon(hiddenFieldMetadataItem.icon)}
+ />
+ }
+ >
+ {hiddenFieldMetadataItem.label}
+ </ListItem>
</SelectableListItem>
),
)}
diff --git a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnDropdownMenu.tsx b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnDropdownMenu.tsx
index cea71865c4b..8af4ca79cbe 100644
--- a/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-board/record-board-column/components/RecordBoardColumnDropdownMenu.tsx
@@ -1,8 +1,9 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useRecordGroupActions } from '@/object-record/record-group/hooks/useRecordGroupActions';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { ViewType } from '@/views/types/ViewType';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
export const RecordBoardColumnDropdownMenu = () => {
const recordGroupActions = useRecordGroupActions({
@@ -13,14 +14,13 @@ export const RecordBoardColumnDropdownMenu = () => {
<DropdownContent selectDisabled>
<DropdownMenuItemsContainer>
{recordGroupActions.map((action) => (
- <MenuItem
+ <ListItem
key={action.id}
- onClick={() => {
- action.callback();
- }}
- LeftIcon={action.icon}
- text={action.label}
- />
+ onClick={action.callback}
+ startIcon={<SelectOptionIcon Icon={action.icon} />}
+ >
+ {action.label}
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationRecordsListItem.tsx b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationRecordsListItem.tsx
index c9bdb0416d0..7090dc77817 100644
--- a/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationRecordsListItem.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field-list/record-detail-section/relation/components/RecordDetailRelationRecordsListItem.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { styled } from '@linaria/react';
import { motion } from 'framer-motion';
import { useCallback, useContext } from 'react';
@@ -43,7 +44,6 @@ import {
type IconComponent,
} from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { AnimatedEaseInOut } from 'twenty-ui/primitives/layout';
import { FieldMetadataType, RelationType } from '~/generated-metadata/graphql';
@@ -246,19 +246,17 @@ export const RecordDetailRelationRecordsListItem = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconUnlink}
- text={t`Detach`}
+ <ListItem
+ startIcon={<IconUnlink />}
onClick={handleDetach}
- />
+ >{t`Detach`}</ListItem>
{!isAccountOwnerRelation &&
relationObjectPermissions.canSoftDeleteObjectRecords && (
- <MenuItem
- LeftIcon={IconTrash}
- text={t`Delete`}
- accent="danger"
+ <ListItem
+ startIcon={<IconTrash />}
+ color="danger"
onClick={handleDelete}
- />
+ >{t`Delete`}</ListItem>
)}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormArrayFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormArrayFieldInput.tsx
index 52c6c8f0045..faf24f60873 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormArrayFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormArrayFieldInput.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { FormFieldInputContainer } from '@/ui/input/components/FormFieldInputContainer';
import { FormFieldInputInnerContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputInnerContainer';
import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputRowContainer';
@@ -29,7 +30,6 @@ import { useContext, useId, useRef, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconPlus } from 'twenty-ui/icon';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { toSpliced } from '~/utils/array/toSpliced';
type FormArrayFieldInputProps = {
@@ -391,11 +391,10 @@ export const FormArrayFieldInput = ({
/>
) : !isLimitReached ? (
<DropdownMenuItemsContainer>
- <MenuItem
+ <ListItem
onClick={handleAddItemButtonClick}
- LeftIcon={IconPlus}
- text={t`Add item`}
- />
+ startIcon={<IconPlus />}
+ >{t`Add item`}</ListItem>
</DropdownMenuItemsContainer>
) : null}
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldInput.tsx
index 8d94fa28901..9db65e2db6b 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldInput.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { t } from '@lingui/core/macro';
import React, { useCallback, useMemo, useRef, useState } from 'react';
import { Key } from 'ts-key-enum';
@@ -25,7 +27,6 @@ import { isNonEmptyString } from '@sniptt/guards';
import { CustomError, isDefined } from 'twenty-shared/utils';
import { IconCheck, IconPlus } from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { FieldMetadataType } from '~/generated-metadata/graphql';
import { moveArrayItem } from '~/utils/array/moveArrayItem';
import { toSpliced } from '~/utils/array/toSpliced';
@@ -379,11 +380,11 @@ export const MultiItemFieldInput = <T,>({
/>
) : !isLimitReached ? (
<DropdownMenuItemsContainer>
- <MenuItem
- onClick={handleAddButtonClick}
- LeftIcon={IconPlus}
- text={newItemLabel || `Add ${placeholder}`}
- />
+ <ListItem onClick={handleAddButtonClick} startIcon={<IconPlus />}>
+ <OverflowingTextWithTooltip
+ text={newItemLabel || `Add ${placeholder}`}
+ />
+ </ListItem>
</DropdownMenuItemsContainer>
) : null}
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldMenuItem.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldMenuItem.tsx
index 9c138e31ea7..9cb4fe914ea 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldMenuItem.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/meta-types/input/components/MultiItemFieldMenuItem.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { t } from '@lingui/core/macro';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
@@ -13,7 +14,6 @@ import {
IconPencil,
IconTrash,
} from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type MultiItemFieldMenuItemProps<T> = {
dropdownId: string;
@@ -88,29 +88,25 @@ export const MultiItemFieldMenuItem = <T,>({
<DropdownContent>
<DropdownMenuItemsContainer>
{showSetAsPrimaryButton && (
- <MenuItem
- LeftIcon={IconBookmarkPlus}
- text={t`Set as Primary`}
+ <ListItem
+ startIcon={<IconBookmarkPlus />}
onClick={handleSetAsPrimaryClick}
- />
+ >{t`Set as Primary`}</ListItem>
)}
- <MenuItem
- LeftIcon={IconPencil}
- text={t`Edit`}
+ <ListItem
+ startIcon={<IconPencil />}
onClick={handleEditClick}
- />
- <MenuItem
- accent="danger"
- LeftIcon={IconTrash}
- text={t`Delete`}
+ >{t`Edit`}</ListItem>
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={handleDeleteClick}
- />
+ >{t`Delete`}</ListItem>
{showCopyButton && (
- <MenuItem
- LeftIcon={IconCopy}
- text={t`Copy`}
+ <ListItem
+ startIcon={<IconCopy />}
onClick={handleCopyClick}
- />
+ >{t`Copy`}</ListItem>
)}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownFieldsContent.tsx b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownFieldsContent.tsx
index c2aa665d841..b2e85bb7586 100644
--- a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownFieldsContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownFieldsContent.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useDropdownContextStateManagement } from '@/dropdown-context-state-management/hooks/useDropdownContextStateManagement';
import { getAggregateOperationLabel } from '@/object-record/record-board/record-board-column/utils/getAggregateOperationLabel';
import { RecordGroupAggregateDropdownContext } from '@/object-record/record-group/states/context/RecordGroupAggregateDropdownContext';
@@ -12,8 +14,7 @@ import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/Drop
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useUpdateViewAggregate } from '@/views/hooks/useUpdateViewAggregate';
import { isDefined } from 'twenty-shared/utils';
-import { Icon123, IconCheck, IconChevronLeft, useIcons } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
+import { Icon123, IconChevronLeft, useIcons } from 'twenty-ui/icon';
export const RecordGroupAggregateDropdownFieldsContent = () => {
const {
@@ -73,8 +74,13 @@ export const RecordGroupAggregateDropdownFieldsContent = () => {
);
if (!fieldMetadata) return null;
+
+ const isSelected =
+ recordIndexGroupAggregateFieldMetadataItem?.id === fieldId &&
+ recordIndexGroupAggregateOperation === aggregateOperation;
+
return (
- <MenuItem
+ <ListItem
key={fieldId}
onClick={() => {
updateViewAggregate({
@@ -84,15 +90,18 @@ export const RecordGroupAggregateDropdownFieldsContent = () => {
});
closeDropdown();
}}
- LeftIcon={getIcon(fieldMetadata.icon) ?? Icon123}
- text={fieldMetadata.label}
- RightIcon={
- recordIndexGroupAggregateFieldMetadataItem?.id === fieldId &&
- recordIndexGroupAggregateOperation === aggregateOperation
- ? IconCheck
- : undefined
+ startIcon={
+ <SelectOptionIcon
+ Icon={getIcon(fieldMetadata.icon) ?? Icon123}
+ />
}
- />
+ role="option"
+ aria-selected={isSelected}
+ indicator="check"
+ selected={isSelected}
+ >
+ {fieldMetadata.label}
+ </ListItem>
);
})}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownMenuContent.tsx b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownMenuContent.tsx
index 47ad7ba1d71..78149dc88eb 100644
--- a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownMenuContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownMenuContent.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useDropdownContextStateManagement } from '@/dropdown-context-state-management/hooks/useDropdownContextStateManagement';
import { RecordGroupAggregateDropdownContext } from '@/object-record/record-group/states/context/RecordGroupAggregateDropdownContext';
import { type RecordGroupAggregateDropdownContextValue } from '@/object-record/record-group/types/RecordGroupAggregateDropdownContextValue';
@@ -5,7 +6,6 @@ import { type RecordGroupAggregateDropdownContextValue } from '@/object-record/r
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { useLingui } from '@lingui/react/macro';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
export const RecordGroupAggregateDropdownMenuContent = () => {
const { t } = useLingui();
@@ -20,34 +20,30 @@ export const RecordGroupAggregateDropdownMenuContent = () => {
return (
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
+ <ListItem
onClick={() => {
onContentChange('countAggregateOperationsOptions');
}}
- text={t`Count`}
- hasSubMenu
- />
- <MenuItem
+ hasSubmenu
+ >{t`Count`}</ListItem>
+ <ListItem
onClick={() => {
onContentChange('percentAggregateOperationsOptions');
}}
- text={t`Percent`}
- hasSubMenu
- />
- <MenuItem
+ hasSubmenu
+ >{t`Percent`}</ListItem>
+ <ListItem
onClick={() => {
onContentChange('datesAggregateOperationOptions');
}}
- text={t`Date`}
- hasSubMenu
- />
- <MenuItem
+ hasSubmenu
+ >{t`Date`}</ListItem>
+ <ListItem
onClick={() => {
onContentChange('moreAggregateOperationOptions');
}}
- text={t`More options`}
- hasSubMenu
- />
+ hasSubmenu
+ >{t`More options`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
);
diff --git a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownMenuItem.tsx b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownMenuItem.tsx
index d99835c741c..0a8795220cd 100644
--- a/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownMenuItem.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-group/components/RecordGroupAggregateDropdownMenuItem.tsx
@@ -1,5 +1,6 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { type IconComponent } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
export const RecordGroupAggregateDropdownMenuItem = ({
onContentChange,
@@ -13,11 +14,12 @@ export const RecordGroupAggregateDropdownMenuItem = ({
RightIcon?: IconComponent | null;
}) => {
return (
- <MenuItem
+ <ListItem
onClick={onContentChange}
- text={text}
- hasSubMenu={hasSubMenu}
- RightIcon={RightIcon}
- />
+ hasSubmenu={hasSubMenu}
+ endIcon={<SelectOptionIcon Icon={RightIcon} />}
+ >
+ {text}
+ </ListItem>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/components/RecordPickerNoRecordFoundMenuItem.tsx b/packages/twenty-front/src/modules/object-record/record-picker/components/RecordPickerNoRecordFoundMenuItem.tsx
index 0bedd0c6e8d..e375329a182 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/components/RecordPickerNoRecordFoundMenuItem.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/components/RecordPickerNoRecordFoundMenuItem.tsx
@@ -1,8 +1,8 @@
-import { MenuItem } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useLingui } from '@lingui/react/macro';
export const RecordPickerNoRecordFoundMenuItem = () => {
const { t } = useLingui();
- return <MenuItem disabled text={t`No records found`} accent="placeholder" />;
+ return <ListItem disabled>{t`No records found`}</ListItem>;
};
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPicker.tsx b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPicker.tsx
index b0a86089be5..172ee892f4b 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPicker.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPicker.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useCallback, useRef, useState } from 'react';
import { useStore } from 'jotai';
@@ -18,7 +19,6 @@ import { getMultipleRecordPickerSelectableListId } from '@/object-record/record-
import { upsertMorphItem } from '@/object-record/record-picker/multiple-record-picker/utils/upsertMorphItem';
import { type RecordPickerLayoutDirection } from '@/object-record/record-picker/types/RecordPickerLayoutDirection';
import { type RecordPickerPickableMorphItem } from '@/object-record/record-picker/types/RecordPickerPickableMorphItem';
-import { CreateNewButton } from '@/ui/input/relation-picker/components/CreateNewButton';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { useSelectableList } from '@/ui/layout/selectable-list/hooks/useSelectableList';
@@ -224,13 +224,12 @@ export const MultipleRecordPicker = ({
const createNewButtonSection =
creatableObjectMetadataItems.length > 0 ? (
<DropdownMenuItemsContainer scrollable={false}>
- <CreateNewButton
+ <ListItem
onClick={handleCreateNewButtonClick}
disabled={isCreatePending}
- LeftIcon={IconPlus}
- text={t`Add New`}
- hasSubMenu={creatableObjectMetadataItems.length > 1}
- />
+ startIcon={<IconPlus />}
+ hasSubmenu={creatableObjectMetadataItems.length > 1}
+ >{t`Add New`}</ListItem>
</DropdownMenuItemsContainer>
) : null;
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerCreateTargetSelect.tsx b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerCreateTargetSelect.tsx
index 91009d83623..2cb7258105a 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerCreateTargetSelect.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerCreateTargetSelect.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { ObjectMetadataIcon } from '@/object-metadata/components/ObjectMetadataIcon';
import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader/DropdownMenuHeader';
@@ -10,7 +11,6 @@ import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { t } from '@lingui/core/macro';
import { IconChevronLeft } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type MultipleRecordPickerCreateTargetSelectProps = {
objectMetadataItems: EnrichedObjectMetadataItem[];
@@ -66,15 +66,16 @@ export const MultipleRecordPickerCreateTargetSelect = ({
itemId={objectMetadataItem.id}
onEnter={() => handleSelect(objectMetadataItem.id)}
>
- <MenuItem
- LeftComponent={
+ <ListItem
+ startIcon={
<ObjectMetadataIcon objectMetadataItem={objectMetadataItem} />
}
- text={objectMetadataItem.labelSingular}
focused={selectedItemId === objectMetadataItem.id}
disabled={disabled}
onClick={() => handleSelect(objectMetadataItem.id)}
- />
+ >
+ {objectMetadataItem.labelSingular}
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItemContent.tsx b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItemContent.tsx
index 1f876107fb8..e44e3ad830c 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItemContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/multiple-record-picker/components/MultipleRecordPickerMenuItemContent.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { t } from '@lingui/core/macro';
import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
@@ -101,7 +100,7 @@ export const MultipleRecordPickerMenuItemContent = ({
/>
}
>
- <OverflowingTextWithTooltip text={displayText} />
+ {displayText}
</ListItem>
</SelectableListItem>
);
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItem.tsx b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItem.tsx
index dade53874d2..ef840cdcaea 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItem.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItem.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useMemo } from 'react';
import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
@@ -105,7 +104,7 @@ export const SingleRecordPickerMenuItem = ({
/>
}
>
- <OverflowingTextWithTooltip text={searchRecordStore.label} />
+ {searchRecordStore.label}
</ListItem>
</SelectableListItem>
);
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItems.tsx b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItems.tsx
index 03a86311687..0f407efca16 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItems.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItems.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { isDefined } from 'twenty-shared/utils';
import { isUndefined } from '@sniptt/guards';
import { Key } from 'ts-key-enum';
@@ -123,7 +122,7 @@ export const SingleRecordPickerMenuItems = ({
indicator="check"
startIcon={<SelectOptionIcon Icon={EmptyIcon} />}
>
- <OverflowingTextWithTooltip text={emptyLabel} />
+ {emptyLabel}
</ListItem>
</SelectableListItem>
)}
diff --git a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItemsWithSearch.tsx b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItemsWithSearch.tsx
index 894468dea33..93a32d9b293 100644
--- a/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItemsWithSearch.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-picker/single-record-picker/components/SingleRecordPickerMenuItemsWithSearch.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { type SingleRecordPickerMenuItemsWithSearchProps } from '@/object-record/record-picker/single-record-picker/types/SingleRecordPickerMenuItemsWithSearchProps';
import { ToastOnQueryErrorEffect } from '@/apollo/components/ToastOnQueryErrorEffect';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
@@ -9,7 +10,6 @@ import { useSingleRecordPickerSearch } from '@/object-record/record-picker/singl
import { SingleRecordPickerComponentInstanceContext } from '@/object-record/record-picker/single-record-picker/states/contexts/SingleRecordPickerComponentInstanceContext';
import { singleRecordPickerSearchFilterComponentState } from '@/object-record/record-picker/single-record-picker/states/singleRecordPickerSearchFilterComponentState';
import { canCreateRecordsForObjectMetadataItem } from '@/object-record/utils/canCreateRecordsForObjectMetadataItem';
-import { CreateNewButton } from '@/ui/input/relation-picker/components/CreateNewButton';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { DropdownMenuSearchInput } from '@/ui/layout/dropdown/components/DropdownMenuSearchInput';
import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator';
@@ -90,11 +90,10 @@ export const SingleRecordPickerMenuItemsWithSearch = ({
{isDefined(onCreate) && canCreateRecords && (
<>
<DropdownMenuItemsContainer scrollable={false}>
- <CreateNewButton
+ <ListItem
onClick={handleCreateNew}
- LeftIcon={IconPlus}
- text={t`Add New`}
- />
+ startIcon={<IconPlus />}
+ >{t`Add New`}</ListItem>
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
</>
@@ -139,11 +138,10 @@ export const SingleRecordPickerMenuItemsWithSearch = ({
<>
<DropdownMenuSeparator />
<DropdownMenuItemsContainer scrollable={false}>
- <CreateNewButton
+ <ListItem
onClick={handleCreateNew}
- LeftIcon={IconPlus}
- text={t`Add New`}
- />
+ startIcon={<IconPlus />}
+ >{t`Add New`}</ListItem>
</DropdownMenuItemsContainer>
</>
)}
diff --git a/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetRelationPickerMenuItem.tsx b/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetRelationPickerMenuItem.tsx
index a7ce113a554..b64d775fa8a 100644
--- a/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetRelationPickerMenuItem.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table-widget/components/RecordTableWidgetRelationPickerMenuItem.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type SelectableItem } from '@/object-record/select/types/SelectableItem';
import { DropdownComponentInstanceContext } from '@/ui/layout/dropdown/contexts/DropdownComponentInstanceContext';
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
@@ -50,7 +49,7 @@ export const RecordTableWidgetRelationPickerMenuItem = ({
/>
}
>
- <OverflowingTextWithTooltip text={relationRecord.name} />
+ {relationRecord.name}
</ListItem>
</SelectableListItem>
);
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterAggregateOperationMenuItems.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterAggregateOperationMenuItems.tsx
index 76f3a3b5577..d909354fc19 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterAggregateOperationMenuItems.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterAggregateOperationMenuItems.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { getAggregateOperationLabel } from '@/object-record/record-board/record-board-column/utils/getAggregateOperationLabel';
import { RecordTableColumnAggregateFooterDropdownContext } from '@/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterDropdownContext';
import { useViewFieldAggregateOperation } from '@/object-record/record-table/record-table-footer/hooks/useViewFieldAggregateOperation';
@@ -6,8 +7,6 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { useLingui } from '@lingui/react/macro';
import { type ReactNode, useContext } from 'react';
import { isDefined } from 'twenty-shared/utils';
-import { IconCheck } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
export const RecordTableColumnAggregateFooterAggregateOperationMenuItems = ({
aggregateOperations,
@@ -31,35 +30,32 @@ export const RecordTableColumnAggregateFooterAggregateOperationMenuItems = ({
return (
<>
{aggregateOperations.map((operation) => (
- <MenuItem
+ <ListItem
key={operation}
onClick={async () => {
await updateViewFieldAggregateOperation(operation);
closeDropdown(dropdownId);
}}
- text={getAggregateOperationLabel(operation)}
- RightIcon={
- currentViewFieldAggregateOperation === operation
- ? IconCheck
- : undefined
- }
+ role="option"
+ indicator="check"
+ selected={currentViewFieldAggregateOperation === operation}
aria-selected={currentViewFieldAggregateOperation === operation}
- />
+ >
+ {getAggregateOperationLabel(operation)}
+ </ListItem>
))}
{children}
- <MenuItem
- key="none"
+ <ListItem
onClick={async () => {
await updateViewFieldAggregateOperation(null);
resetContent();
closeDropdown(dropdownId);
}}
- text={t`None`}
- RightIcon={
- !isDefined(currentViewFieldAggregateOperation) ? IconCheck : undefined
- }
+ role="option"
+ indicator="check"
+ selected={!isDefined(currentViewFieldAggregateOperation)}
aria-selected={!isDefined(currentViewFieldAggregateOperation)}
- />
+ >{t`None`}</ListItem>
</>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterMenuContent.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterMenuContent.tsx
index a83a4f55a96..57af2c5f7fa 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterMenuContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterMenuContent.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { type AggregateOperations } from '@/object-record/record-table/constants/AggregateOperations';
import { useRecordTableContextOrThrow } from '@/object-record/record-table/contexts/RecordTableContext';
import { RecordTableColumnAggregateFooterDropdownContext } from '@/object-record/record-table/record-table-footer/components/RecordTableColumnAggregateFooterDropdownContext';
@@ -10,8 +11,6 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { t } from '@lingui/core/macro';
import { useContext, useMemo } from 'react';
import { isDefined, isFieldMetadataDateKind } from 'twenty-shared/utils';
-import { IconCheck } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { FieldMetadataType } from '~/generated-metadata/graphql';
export const RecordTableColumnAggregateFooterMenuContent = () => {
@@ -56,55 +55,45 @@ export const RecordTableColumnAggregateFooterMenuContent = () => {
return (
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
+ <ListItem
onClick={() => {
onContentChange('countAggregateOperationsOptions');
}}
- text={t`Count`}
- hasSubMenu
- />
+ hasSubmenu
+ >{t`Count`}</ListItem>
{!fieldIsRelation && (
- <MenuItem
+ <ListItem
onClick={() => {
onContentChange('percentAggregateOperationsOptions');
}}
- text={t`Percent`}
- hasSubMenu
- />
+ hasSubmenu
+ >{t`Percent`}</ListItem>
)}
{fieldIsDateKind && (
- <MenuItem
+ <ListItem
onClick={() => {
onContentChange('datesAggregateOperationsOptions');
}}
- text={t`Date`}
- hasSubMenu
- />
+ hasSubmenu
+ >{t`Date`}</ListItem>
)}
{nonStandardAvailableAggregateOperation.length > 0 ? (
- <MenuItem
+ <ListItem
onClick={() => {
onContentChange('moreAggregateOperationOptions');
}}
- text={t`More options`}
- hasSubMenu
- />
+ hasSubmenu
+ >{t`More options`}</ListItem>
) : null}
- <MenuItem
- key="none"
+ <ListItem
onClick={async () => {
await updateViewFieldAggregateOperation(null);
resetContent();
closeDropdown(dropdownId);
}}
- text={t`None`}
- RightIcon={
- !isDefined(currentViewFieldAggregateOperation)
- ? IconCheck
- : undefined
- }
- aria-selected={!isDefined(currentViewFieldAggregateOperation)}
- />
+ indicator="check"
+ selected={!isDefined(currentViewFieldAggregateOperation)}
+ >{t`None`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
);
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableColumnHeadDropdownMenu.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableColumnHeadDropdownMenu.tsx
index 48d4ca53ef0..6fa4acb9cef 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableColumnHeadDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableColumnHeadDropdownMenu.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownMenuSeparator';
@@ -23,7 +24,6 @@ import {
IconEyeOff,
IconFilter,
} from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
export type RecordTableColumnHeadDropdownMenuProps = {
recordField: RecordField;
@@ -135,40 +135,35 @@ export const RecordTableColumnHeadDropdownMenu = ({
<StyledDropdownMenuItemsContainerWrapper>
<DropdownMenuItemsContainer>
{isFilterable && (
- <MenuItem
- LeftIcon={IconFilter}
+ <ListItem
+ startIcon={<IconFilter />}
onClick={handleFilterClick}
- text={t`Filter`}
- />
+ >{t`Filter`}</ListItem>
)}
{isSortable && (
- <MenuItem
- LeftIcon={IconArrowsSort}
+ <ListItem
+ startIcon={<IconArrowsSort />}
onClick={handleSortClick}
- text={t`Sort`}
- />
+ >{t`Sort`}</ListItem>
)}
{showSeparator && <DropdownMenuSeparator />}
{canMoveLeft && (
- <MenuItem
- LeftIcon={IconArrowLeft}
+ <ListItem
+ startIcon={<IconArrowLeft />}
onClick={handleColumnMoveLeft}
- text={t`Move left`}
- />
+ >{t`Move left`}</ListItem>
)}
{canMoveRight && (
- <MenuItem
- LeftIcon={IconArrowRight}
+ <ListItem
+ startIcon={<IconArrowRight />}
onClick={handleColumnMoveRight}
- text={t`Move right`}
- />
+ >{t`Move right`}</ListItem>
)}
{canHide && (
- <MenuItem
- LeftIcon={IconEyeOff}
- onClick={async () => await handleColumnVisibility()}
- text={t`Hide`}
- />
+ <ListItem
+ startIcon={<IconEyeOff />}
+ onClick={handleColumnVisibility}
+ >{t`Hide`}</ListItem>
)}
</DropdownMenuItemsContainer>
</StyledDropdownMenuItemsContainerWrapper>
diff --git a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderPlusButtonContent.tsx b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderPlusButtonContent.tsx
index 88fd42cae34..3efaccb2d31 100644
--- a/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderPlusButtonContent.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-table/record-table-header/components/RecordTableHeaderPlusButtonContent.tsx
@@ -1,3 +1,4 @@
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useCallback, useState } from 'react';
import { useLocation } from 'react-router-dom';
@@ -18,7 +19,7 @@ import { useLingui } from '@lingui/react/macro';
import { SettingsPath } from 'twenty-shared/types';
import { getSettingsPath } from 'twenty-shared/utils';
import { IconSettings, useIcons } from 'twenty-ui/icon';
-import { MenuItem, UndecoratedLink } from 'twenty-ui/primitives/navigation';
+import { ListItem, UndecoratedLink } from 'twenty-ui/primitives/navigation';
export const RecordTableHeaderPlusButtonContent = () => {
const { t } = useLingui();
@@ -94,25 +95,24 @@ export const RecordTableHeaderPlusButtonContent = () => {
<DropdownMenuItemsContainer>
{filteredFieldMetadataItems.length > 0 ? (
filteredFieldMetadataItems.map((fieldMetadataItem) => (
- <MenuItem
+ <ListItem
key={fieldMetadataItem.id}
onClick={() =>
handleFieldMetadataItemMenuItemClick(fieldMetadataItem)
}
- LeftIcon={getIcon(fieldMetadataItem.icon)}
- text={fieldMetadataItem.label}
- />
+ startIcon={
+ <SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
+ }
+ >
+ {fieldMetadataItem.label}
+ </ListItem>
))
) : (
- <MenuItem
- disabled
- accent="placeholder"
- text={
- hasAvailableFields
- ? t`No results`
- : t`All fields are already visible`
- }
- />
+ <ListItem disabled>
+ {hasAvailableFields
+ ? t`No results`
+ : t`All fields are already visible`}
+ </ListItem>
)}
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
@@ -126,7 +126,9 @@ export const RecordTableHeaderPlusButtonContent = () => {
setNavigationMemorizedUrl(location.pathname + location.search);
}}
>
- <MenuItem LeftIcon={IconSettings} text={t`Customize fields`} />
+ <ListItem
+ startIcon={<IconSettings />}
+ >{t`Customize fields`}</ListItem>
</UndecoratedLink>
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/object-record/select/components/MultipleSelectDropdown.tsx b/packages/twenty-front/src/modules/object-record/select/components/MultipleSelectDropdown.tsx
index 588a0fe56a6..fe7118c2e9a 100644
--- a/packages/twenty-front/src/modules/object-record/select/components/MultipleSelectDropdown.tsx
+++ b/packages/twenty-front/src/modules/object-record/select/components/MultipleSelectDropdown.tsx
@@ -1,4 +1,4 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { Key } from 'ts-key-enum';
import { type SelectableItem } from '@/object-record/select/types/SelectableItem';
@@ -14,7 +14,6 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { getAbsoluteImageUrl } from '~/utils/image/getAbsoluteImageUrl';
import { t } from '@lingui/core/macro';
import { Avatar } from 'twenty-ui/primitives/data-display';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
export const MultipleSelectDropdown = ({
selectableListId,
@@ -119,12 +118,12 @@ export const MultipleSelectDropdown = ({
/>
}
>
- <OverflowingTextWithTooltip text={item.name} />
+ {item.name}
</ListItem>
</SelectableListItem>
);
})}
- {showNoResult && <MenuItem text={t`No results`} />}
+ {showNoResult && <ListItem disabled>{t`No results`}</ListItem>}
{loadingItems && <DropdownMenuSkeletonItem />}
</DropdownMenuItemsContainer>
</SelectableList>
diff --git a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabListNewTabDropdownContent.tsx b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabListNewTabDropdownContent.tsx
index effc42c99f1..979f5278d19 100644
--- a/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabListNewTabDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/page-layout/components/PageLayoutTabListNewTabDropdownContent.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useCurrentPageLayoutOrThrow } from '@/page-layout/hooks/useCurrentPageLayoutOrThrow';
import { useUpdatePageLayoutTab } from '@/page-layout/hooks/useUpdatePageLayoutTab';
import { pageLayoutTabSettingsOpenTabIdComponentState } from '@/page-layout/states/pageLayoutTabSettingsOpenTabIdComponentState';
@@ -17,7 +19,6 @@ import { useCallback } from 'react';
import { SidePanelPages } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconPlus, useIcons } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type PageLayoutTabListNewTabDropdownContentProps = {
onCreate: () => void;
@@ -75,11 +76,10 @@ export const PageLayoutTabListNewTabDropdownContent = ({
<DropdownContent>
<DropdownMenuHeader>{t`New tab`}</DropdownMenuHeader>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconPlus}
- text={t`Empty tab`}
+ <ListItem
+ startIcon={<IconPlus />}
onClick={handleCreateEmptyTab}
- />
+ >{t`Empty tab`}</ListItem>
</DropdownMenuItemsContainer>
{inactiveTabs.length > 0 && (
<>
@@ -87,12 +87,17 @@ export const PageLayoutTabListNewTabDropdownContent = ({
<DropdownMenuSectionLabel label={t`Disabled`} />
<DropdownMenuItemsContainer>
{inactiveTabs.map((tab) => (
- <MenuItem
+ <ListItem
key={tab.id}
- LeftIcon={isDefined(tab.icon) ? getIcon(tab.icon) : undefined}
- text={tab.title}
+ startIcon={
+ <SelectOptionIcon
+ Icon={isDefined(tab.icon) ? getIcon(tab.icon) : undefined}
+ />
+ }
onClick={() => handleReactivateTab(tab.id)}
- />
+ >
+ {tab.title}
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</>
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationGroupDropdown.tsx b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationGroupDropdown.tsx
index af20ddc3677..8166f31d2a6 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationGroupDropdown.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/fields/components/FieldsConfigurationGroupDropdown.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useLingui } from '@lingui/react/macro';
import {
IconDotsVertical,
@@ -6,7 +7,6 @@ import {
IconTrash,
} from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { getFieldsConfigurationGroupEditDropdownId } from '@/page-layout/widgets/fields/utils/getFieldsConfigurationGroupEditDropdownId';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
@@ -61,24 +61,19 @@ export const FieldsConfigurationGroupDropdown = ({
dropdownComponents={
<DropdownContent widthInPixels={GenericDropdownContentWidth.Narrow}>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconPencil}
+ <ListItem
+ startIcon={<IconPencil />}
onClick={handleRename}
- accent="default"
- text={t`Rename`}
- />
- <MenuItem
- LeftIcon={IconTrash}
+ >{t`Rename`}</ListItem>
+ <ListItem
+ startIcon={<IconTrash />}
onClick={handleDelete}
- accent="danger"
- text={t`Delete`}
- />
- <MenuItem
- LeftIcon={IconNewSection}
+ color="danger"
+ >{t`Delete`}</ListItem>
+ <ListItem
+ startIcon={<IconNewSection />}
onClick={handleAddGroup}
- accent="default"
- text={t`Add a Group`}
- />
+ >{t`Add a Group`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/page-layout/widgets/timeline/components/WidgetActionTimelineFilter.tsx b/packages/twenty-front/src/modules/page-layout/widgets/timeline/components/WidgetActionTimelineFilter.tsx
index 08fc4208399..db9db67dd51 100644
--- a/packages/twenty-front/src/modules/page-layout/widgets/timeline/components/WidgetActionTimelineFilter.tsx
+++ b/packages/twenty-front/src/modules/page-layout/widgets/timeline/components/WidgetActionTimelineFilter.tsx
@@ -1,5 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useTimelineActivityTypeFilter } from '@/activities/timeline-activities/hooks/useTimelineActivityTypeFilter';
import { timelineActivityTypeUniversalIdentifiersFilterFamilyState } from '@/activities/timeline-activities/states/timelineActivityTypeUniversalIdentifiersFilterFamilyState';
import { WidgetCardHeaderActionButton } from '@/page-layout/widgets/widget-card/components/WidgetCardHeaderActionButton';
@@ -15,7 +15,6 @@ import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
import { IconFilter, IconFilterOff, useIcons } from 'twenty-ui/icon';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { normalizeSearchText } from '~/utils/normalizeSearchText';
export const WidgetActionTimelineFilter = () => {
@@ -117,26 +116,23 @@ export const WidgetActionTimelineFilter = () => {
/>
}
>
- <OverflowingTextWithTooltip
- text={timelineActivityType.label}
- />
+ {timelineActivityType.label}
</ListItem>
))
) : (
- <MenuItem disabled text={t`No results`} accent="placeholder" />
+ <ListItem disabled>{t`No results`}</ListItem>
)}
</DropdownMenuItemsContainer>
{isNonEmptyArray(timelineActivityTypeUniversalIdentifiersFilter) && (
<>
<DropdownMenuSeparator />
<DropdownMenuItemsContainer scrollable={false}>
- <MenuItem
- LeftIcon={IconFilterOff}
- text={t`Clear filter`}
+ <ListItem
+ startIcon={<IconFilterOff />}
onClick={() =>
setTimelineActivityTypeUniversalIdentifiersFilter([])
}
- />
+ >{t`Clear filter`}</ListItem>
</DropdownMenuItemsContainer>
</>
)}
diff --git a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx
index 917f13005d3..ce9135194f0 100644
--- a/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsRowDropdownMenu.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { type ConnectedAccount } from '@/accounts/types/ConnectedAccount';
import { useApolloClient, useMutation } from '@apollo/client/react';
import {
@@ -25,7 +26,6 @@ import {
IconTrash,
} from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
import { DELETE_CONNECTED_ACCOUNT } from '../graphql/mutations/deleteConnectedAccount';
@@ -83,65 +83,59 @@ export const SettingsAccountsRowDropdownMenu = ({
<DropdownContent>
<DropdownMenuItemsContainer>
{hasPendingConfiguration && (
- <MenuItem
- LeftIcon={IconPlayerPlay}
- text={t`Complete setup`}
+ <ListItem
+ startIcon={<IconPlayerPlay />}
onClick={() => {
navigate(SettingsPath.AccountsConfiguration, {
connectedAccountId: account.id,
});
closeDropdown(dropdownId);
}}
- />
+ >{t`Complete setup`}</ListItem>
)}
{account.provider ===
ConnectedAccountProvider.IMAP_SMTP_CALDAV && (
- <MenuItem
- text={t`Connection settings`}
- LeftIcon={IconAt}
+ <ListItem
+ startIcon={<IconAt />}
onClick={() => {
navigate(SettingsPath.EditImapSmtpCaldavConnection, {
connectedAccountId: account.id,
});
closeDropdown(dropdownId);
}}
- />
+ >{t`Connection settings`}</ListItem>
)}
- <MenuItem
- LeftIcon={IconMail}
- text={t`Emails settings`}
+ <ListItem
+ startIcon={<IconMail />}
onClick={() => {
navigate(SettingsPath.AccountsEmails);
closeDropdown(dropdownId);
}}
- />
- <MenuItem
- LeftIcon={IconCalendarEvent}
- text={t`Calendar settings`}
+ >{t`Emails settings`}</ListItem>
+ <ListItem
+ startIcon={<IconCalendarEvent />}
onClick={() => {
navigate(SettingsPath.AccountsCalendars);
closeDropdown(dropdownId);
}}
- />
+ >{t`Calendar settings`}</ListItem>
{account.authFailedAt && (
- <MenuItem
- LeftIcon={IconRefresh}
- text={t`Reconnect`}
+ <ListItem
+ startIcon={<IconRefresh />}
onClick={() => {
triggerProviderReconnect(account.provider, account.id);
closeDropdown(dropdownId);
}}
- />
+ >{t`Reconnect`}</ListItem>
)}
- <MenuItem
- accent="danger"
- LeftIcon={IconTrash}
- text={t`Remove account`}
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={() => {
closeDropdown(dropdownId);
openDialog(deleteAccountModalId);
}}
- />
+ >{t`Remove account`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
index ef48d18a949..6bbc3d63fd9 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminServerAdminAccess.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
import { useApolloAdminClient } from '@/settings/admin-panel/apollo/hooks/useApolloAdminClient';
import { TwoFactorAuthenticationVerificationCodeDash } from '@/settings/two-factor-authentication/components/TwoFactorAuthenticationVerificationCodeDash';
@@ -18,7 +19,6 @@ import { IconDotsVertical } from 'twenty-ui/icon';
import { Status } from 'twenty-ui/primitives/data-display';
import { useToast } from 'twenty-ui/primitives/feedback';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import {
GetServerAdminsDocument,
@@ -173,12 +173,7 @@ export const SettingsAdminServerAdminAccess = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- text={
- canAccessFullAdminPanel
- ? t`Revoke admin panel access`
- : t`Grant admin panel access`
- }
+ <ListItem
disabled={isLastFullAdmin}
onClick={() =>
requestChange({
@@ -189,13 +184,12 @@ export const SettingsAdminServerAdminAccess = ({
},
})
}
- />
- <MenuItem
- text={
- canImpersonate
- ? t`Disable impersonation`
- : t`Enable impersonation`
- }
+ >
+ {canAccessFullAdminPanel
+ ? t`Revoke admin panel access`
+ : t`Grant admin panel access`}
+ </ListItem>
+ <ListItem
onClick={() =>
requestChange({
description: t`impersonation`,
@@ -203,10 +197,13 @@ export const SettingsAdminServerAdminAccess = ({
update: { canImpersonate: !canImpersonate },
})
}
- />
+ >
+ {canImpersonate
+ ? t`Disable impersonation`
+ : t`Enable impersonation`}
+ </ListItem>
{!hasFullAccess && (
- <MenuItem
- text={t`Grant full access`}
+ <ListItem
onClick={() =>
requestChange({
description: t`full server access`,
@@ -217,7 +214,7 @@ export const SettingsAdminServerAdminAccess = ({
},
})
}
- />
+ >{t`Grant full access`}</ListItem>
)}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantRowDropdownMenu.tsx
index f57a7a520d2..bf8dfdfd505 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantRowDropdownMenu.tsx
@@ -1,7 +1,7 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
@@ -33,15 +33,14 @@ export const SettingsAdminWorkspaceCreditGrantRowDropdownMenu = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- accent="danger"
- LeftIcon={IconTrash}
- text={t`Revoke`}
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={() => {
onRevoke();
closeDropdown(dropdownId);
}}
- />
+ >{t`Revoke`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableDatabaseInput.tsx b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableDatabaseInput.tsx
index 810ac89148e..7ef7bdcb20a 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableDatabaseInput.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableDatabaseInput.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { Select } from '@/ui/input/components/Select';
import { SelectControl } from '@/ui/input/components/SelectControl';
import { TextArea } from '@/ui/input/components/TextArea';
@@ -149,7 +148,7 @@ export const ConfigVariableDatabaseInput = ({
indicator="checkbox"
onClick={() => handleMultiSelectChange(option.value)}
>
- <OverflowingTextWithTooltip text={option.label} />
+ {option.label}
</ListItem>
))}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableOptionsDropdownContent.tsx b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableOptionsDropdownContent.tsx
index 3b1b63959d1..27f994aa15f 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableOptionsDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/config-variables/components/ConfigVariableOptionsDropdownContent.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { Tag } from 'twenty-ui/primitives/data-display';
import { isConfigVariablesInDbEnabledState } from '@/client-config/states/isConfigVariablesInDbEnabledState';
import { CONFIG_VARIABLE_SOURCE_OPTIONS } from '@/settings/admin-panel/config-variables/constants/ConfigVariableSourceOptions';
@@ -12,9 +13,6 @@ import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownM
import { t } from '@lingui/core/macro';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { IconChevronLeft, IconEye, IconEyeOff } from 'twenty-ui/icon';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
-import { useContext } from 'react';
-import { ThemeContext } from 'twenty-ui/theme-constants';
type ConfigVariableOptionsDropdownContentProps = {
selectedCategory: ConfigVariableFilterCategory | null;
onSelectCategory: (category: ConfigVariableFilterCategory | null) => void;
@@ -38,7 +36,6 @@ export const ConfigVariableOptionsDropdownContent = ({
onGroupFilterChange,
onShowHiddenChange,
}: ConfigVariableOptionsDropdownContentProps) => {
- const { theme } = useContext(ThemeContext);
const isConfigVariablesInDbEnabled = useAtomStateValue(
isConfigVariablesInDbEnabledState,
);
@@ -80,27 +77,14 @@ export const ConfigVariableOptionsDropdownContent = ({
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
<DropdownMenuItemsContainer scrollable={false}>
- <MenuItem
- text={
- showHiddenGroupVariables
- ? t`Hide hidden groups`
- : t`Show hidden groups`
- }
- LeftIcon={() =>
- showHiddenGroupVariables ? (
- <IconEyeOff
- size={theme.icon.size.md}
- stroke={theme.icon.stroke.sm}
- />
- ) : (
- <IconEye
- size={theme.icon.size.md}
- stroke={theme.icon.stroke.sm}
- />
- )
- }
+ <ListItem
+ startIcon={showHiddenGroupVariables ? <IconEyeOff /> : <IconEye />}
onClick={() => onShowHiddenChange(!showHiddenGroupVariables)}
- />
+ >
+ {showHiddenGroupVariables
+ ? t`Hide hidden groups`
+ : t`Show hidden groups`}
+ </ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
);
diff --git a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx
index ea72a4aab52..20ef3649a56 100644
--- a/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/admin-panel/health-status/components/SettingsAdminQueueJobRowDropdownMenu.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
@@ -5,7 +6,6 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconRefresh, IconTrash } from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { JobState } from '~/generated-admin/graphql';
type SettingsAdminQueueJobRowDropdownMenuProps = {
@@ -47,18 +47,16 @@ export const SettingsAdminQueueJobRowDropdownMenu = ({
<DropdownContent>
<DropdownMenuItemsContainer>
{jobState === JobState.FAILED && onRetry && (
- <MenuItem
- text={t`Retry`}
- LeftIcon={IconRefresh}
+ <ListItem
+ startIcon={<IconRefresh />}
onClick={handleRetry}
- />
+ >{t`Retry`}</ListItem>
)}
- <MenuItem
- accent="danger"
- text={t`Delete`}
- LeftIcon={IconTrash}
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={handleDelete}
- />
+ >{t`Delete`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitSpenderSelect.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitSpenderSelect.tsx
index 0f5d395e689..ffd79d0d89e 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitSpenderSelect.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitSpenderSelect.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -165,7 +164,7 @@ export const SettingsBillingLimitSpenderSelect = ({
/>
}
>
- <OverflowingTextWithTooltip text={option.label} />
+ {option.label}
</ListItem>
);
}
@@ -182,7 +181,7 @@ export const SettingsBillingLimitSpenderSelect = ({
<SelectOptionIcon Icon={USAGE_LIMIT_SPENDER_TYPE_ICONS[kind]} />
}
>
- <OverflowingTextWithTooltip text={option.label} />
+ {option.label}
</ListItem>
);
};
@@ -196,9 +195,7 @@ export const SettingsBillingLimitSpenderSelect = ({
selected={spenderType === kind && spenderId === ''}
indicator="check"
>
- <OverflowingTextWithTooltip
- text={t(USAGE_LIMIT_SPENDER_TYPE_POOL_LABELS[kind])}
- />
+ {t(USAGE_LIMIT_SPENDER_TYPE_POOL_LABELS[kind])}
</ListItem>
{loading ? (
<ListItem
@@ -207,9 +204,7 @@ export const SettingsBillingLimitSpenderSelect = ({
aria-selected={false}
selected={false}
indicator="check"
- >
- <OverflowingTextWithTooltip text={t`Loading…`} />
- </ListItem>
+ >{t`Loading…`}</ListItem>
) : (
listedSpenderOptions.map((option) => renderOption(kind, option))
)}
@@ -263,7 +258,7 @@ export const SettingsBillingLimitSpenderSelect = ({
/>
}
>
- <OverflowingTextWithTooltip text={workspaceName} />
+ {workspaceName}
</ListItem>
</DropdownMenuItemsContainer>
)}
@@ -284,7 +279,7 @@ export const SettingsBillingLimitSpenderSelect = ({
hasSubmenu={true}
startIcon={<SelectOptionIcon Icon={group.Icon} />}
>
- <OverflowingTextWithTooltip text={t(group.label)} />
+ {t(group.label)}
</ListItem>
) : (
<ListItem
@@ -298,7 +293,7 @@ export const SettingsBillingLimitSpenderSelect = ({
descriptionPlacement={'end'}
startIcon={<SelectOptionIcon Icon={group.Icon} />}
>
- <OverflowingTextWithTooltip text={t(group.label)} />
+ {t(group.label)}
</ListItem>
),
)}
diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitUsageSelect.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitUsageSelect.tsx
index 82ad2ceada5..31051aa5a46 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitUsageSelect.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitUsageSelect.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -118,9 +117,7 @@ export const SettingsBillingLimitUsageSelect = ({
/>
}
>
- <OverflowingTextWithTooltip
- text={t(USAGE_OPERATION_TYPE_LABELS[candidate])}
- />
+ {t(USAGE_OPERATION_TYPE_LABELS[candidate])}
</ListItem>
),
)}
@@ -148,11 +145,7 @@ export const SettingsBillingLimitUsageSelect = ({
/>
}
>
- <OverflowingTextWithTooltip
- text={t(
- USAGE_LIMIT_RESOURCE_TYPE_LABELS[definition.resourceType],
- )}
- />
+ {t(USAGE_LIMIT_RESOURCE_TYPE_LABELS[definition.resourceType])}
</ListItem>
))}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitsFilterDropdown.tsx b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitsFilterDropdown.tsx
index 15811e30f2b..ecb92f6e350 100644
--- a/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitsFilterDropdown.tsx
+++ b/packages/twenty-front/src/modules/settings/billing/components/SettingsBillingLimitsFilterDropdown.tsx
@@ -1,5 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useLingui } from '@lingui/react/macro';
import { type ReactNode, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -10,7 +10,6 @@ import {
IconTrash,
IconUsers,
} from 'twenty-ui/icon';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { USAGE_LIMIT_RESOURCE_TYPE_ICONS } from '@/settings/billing/constants/UsageLimitResourceTypeIcons';
import { USAGE_LIMIT_RESOURCE_TYPE_LABELS } from '@/settings/billing/constants/UsageLimitResourceTypeLabels';
@@ -90,10 +89,8 @@ export const SettingsBillingLimitsFilterDropdown = ({
aria-selected={!isDefined(selectedResourceType)}
selected={!isDefined(selectedResourceType)}
indicator="check"
- startIcon={<SelectOptionIcon Icon={IconList} />}
- >
- <OverflowingTextWithTooltip text={t`All`} />
- </ListItem>
+ startIcon={<IconList />}
+ >{t`All`}</ListItem>
{resourceTypes.map((resourceType) => (
<ListItem
key={resourceType}
@@ -108,9 +105,7 @@ export const SettingsBillingLimitsFilterDropdown = ({
/>
}
>
- <OverflowingTextWithTooltip
- text={t(USAGE_LIMIT_RESOURCE_TYPE_LABELS[resourceType])}
- />
+ {t(USAGE_LIMIT_RESOURCE_TYPE_LABELS[resourceType])}
</ListItem>
))}
</DropdownMenuItemsContainer>
@@ -127,10 +122,8 @@ export const SettingsBillingLimitsFilterDropdown = ({
aria-selected={!isDefined(selectedSpenderType)}
selected={!isDefined(selectedSpenderType)}
indicator="check"
- startIcon={<SelectOptionIcon Icon={IconList} />}
- >
- <OverflowingTextWithTooltip text={t`All`} />
- </ListItem>
+ startIcon={<IconList />}
+ >{t`All`}</ListItem>
{spenderTypes.map((spenderType) => (
<ListItem
key={spenderType}
@@ -149,9 +142,7 @@ export const SettingsBillingLimitsFilterDropdown = ({
/>
}
>
- <OverflowingTextWithTooltip
- text={getSpenderTypeLabel(spenderType)}
- />
+ {getSpenderTypeLabel(spenderType)}
</ListItem>
))}
</DropdownMenuItemsContainer>
@@ -161,42 +152,39 @@ export const SettingsBillingLimitsFilterDropdown = ({
const renderMenuContent = () => (
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconCoins}
- text={t`Usage`}
- contextualText={
+ <ListItem
+ startIcon={<IconCoins />}
+ description={
isDefined(selectedResourceType)
? t(USAGE_LIMIT_RESOURCE_TYPE_LABELS[selectedResourceType])
: t`All`
}
- contextualTextPosition="right"
- hasSubMenu
+ descriptionPlacement="end"
+ hasSubmenu
onClick={() => setContentId('usage')}
- />
- <MenuItem
- LeftIcon={IconUsers}
- text={t`Spender`}
- contextualText={
+ >{t`Usage`}</ListItem>
+ <ListItem
+ startIcon={<IconUsers />}
+ description={
isDefined(selectedSpenderType)
? getSpenderTypeLabel(selectedSpenderType)
: t`All`
}
- contextualTextPosition="right"
- hasSubMenu
+ descriptionPlacement="end"
+ hasSubmenu
onClick={() => setContentId('spender')}
- />
+ >{t`Spender`}</ListItem>
{hasActiveFilters && (
<>
<DropdownMenuSeparator />
- <MenuItem
- accent="danger"
- LeftIcon={IconTrash}
- text={t`Clear filters`}
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={() => {
onSelectResourceType(null);
onSelectSpenderType(null);
}}
- />
+ >{t`Clear filters`}</ListItem>
</>
)}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx b/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx
index fe93bde7667..fd7523bd73a 100644
--- a/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx
+++ b/packages/twenty-front/src/modules/settings/components/SettingsMorphRelationMultiSelect.tsx
@@ -1,5 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { styled } from '@linaria/react';
import { plural, t } from '@lingui/core/macro';
import { Fragment, useMemo, useRef, useState, type MouseEvent } from 'react';
@@ -27,7 +27,6 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { IconBox, type IconComponent } from 'twenty-ui/icon';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
export type SelectSizeVariant = 'small' | 'default';
@@ -310,7 +309,7 @@ export const SettingsMorphRelationMultiSelect = ({
/>
}
>
- <OverflowingTextWithTooltip text={option.label} />
+ {option.label}
</ListItem>
</SelectableListItem>
</Fragment>
@@ -323,11 +322,14 @@ export const SettingsMorphRelationMultiSelect = ({
)}
{!!callToActionButton && (
<DropdownMenuItemsContainer hasMaxHeight scrollable={false}>
- <MenuItem
+ <ListItem
onClick={callToActionButton.onClick}
- LeftIcon={callToActionButton.Icon}
- text={callToActionButton.text}
- />
+ startIcon={
+ <SelectOptionIcon Icon={callToActionButton.Icon} />
+ }
+ >
+ {callToActionButton.text}
+ </ListItem>
</DropdownMenuItemsContainer>
)}
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/address/components/MultiSelectAddressFields.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/address/components/MultiSelectAddressFields.tsx
index 8e79053eabc..4274c5139d4 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/address/components/MultiSelectAddressFields.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/address/components/MultiSelectAddressFields.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { Tag } from 'twenty-ui/primitives/data-display';
import { type SelectValue } from '@/ui/input/components/internal/select/types';
import { type SelectSizeVariant } from '@/ui/input/components/Select';
@@ -14,7 +16,6 @@ import { t } from '@lingui/core/macro';
import { type MouseEvent, useMemo, useState } from 'react';
import { type IconComponent } from 'twenty-ui/icon';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
type CallToActionButton = {
text: string;
@@ -123,12 +124,13 @@ export const MultiSelectAddressFields = <Value extends SelectValue>({
</DropdownContent>
<DropdownMenuSeparator />
<DropdownMenuItemsContainer hasMaxHeight scrollable={false}>
- <MenuItem
+ <ListItem
onClick={callToActionButton?.onClick}
- LeftIcon={callToActionButton?.Icon}
- text={callToActionButton?.text}
+ startIcon={<SelectOptionIcon Icon={callToActionButton?.Icon} />}
disabled={values.length === options.length}
- />
+ >
+ {callToActionButton?.text}
+ </ListItem>
</DropdownMenuItemsContainer>
</SelectableList>
}
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/AddSelectOptionMenuItem.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/AddSelectOptionMenuItem.tsx
index d3e4e66e45d..34010d70bec 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/AddSelectOptionMenuItem.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/AddSelectOptionMenuItem.tsx
@@ -1,8 +1,9 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { t } from '@lingui/core/macro';
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { IconPlus } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type AddSelectOptionMenuItemProps = {
name: string;
@@ -28,10 +29,8 @@ export const AddSelectOptionMenuItem = ({
}
return (
- <MenuItem
- onClick={handleClick}
- LeftIcon={IconPlus}
- text={t`Add "${trimmedName}" to options`}
- />
+ <ListItem onClick={handleClick} startIcon={<IconPlus />}>
+ <OverflowingTextWithTooltip text={t`Add "${trimmedName}" to options`} />
+ </ListItem>
);
};
diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx
index c7a0445fb6a..1a03854ebcc 100644
--- a/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/fields/forms/select/components/SettingsDataModelFieldSelectForm.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { styled } from '@linaria/react';
import { type DraggableListDropResult } from '@/ui/layout/draggable-list/types/DraggableListDropResult';
import { Controller, useFormContext } from 'react-hook-form';
@@ -43,7 +44,6 @@ import {
} from 'twenty-ui/icon';
import { CardContent, CardFooter } from 'twenty-ui/primitives/surfaces';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
import { SettingsDataModelFieldSelectFormOptionRow } from './SettingsDataModelFieldSelectFormOptionRow';
@@ -380,11 +380,8 @@ export const SettingsDataModelFieldSelectForm = ({
widthInPixels={GenericDropdownContentWidth.Narrow}
>
<DropdownMenuItemsContainer>
- <MenuItem
- text={
- isBulkInputMode ? t`Single edit` : t`Bulk edit`
- }
- LeftIcon={IconPencil}
+ <ListItem
+ startIcon={<IconPencil />}
onClick={() => {
if (!isBulkInputMode) {
setBulkInputText(
@@ -396,16 +393,17 @@ export const SettingsDataModelFieldSelectForm = ({
);
closeOptionsDropdown(OPTIONS_DROPDOWN_ID);
}}
- />
- <MenuItem
- text={t`Remove all`}
- accent="danger"
- LeftIcon={IconTrash}
+ >
+ {isBulkInputMode ? t`Single edit` : t`Bulk edit`}
+ </ListItem>
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={() => {
onChange([]);
closeOptionsDropdown(OPTIONS_DROPDOWN_ID);
}}
- />
+ >{t`Remove all`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
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 c991e6bc8a7..bf616b79f11 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
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type FieldMetadataItemOption } from '@/object-metadata/types/FieldMetadataItem';
import { AdvancedSettingsWrapper } from '@/settings/components/AdvancedSettingsWrapper';
import { OPTION_VALUE_MAXIMUM_LENGTH } from '@/settings/data-model/constants/OptionValueMaximumLength';
@@ -19,11 +18,7 @@ import {
IconX,
} from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import {
- type ColorLabels,
- MenuItem,
- ListItem,
-} from 'twenty-ui/primitives/navigation';
+import { ListItem, type ColorLabels } from 'twenty-ui/primitives/navigation';
import { computeOptionValueFromLabel } from '~/pages/settings/data-model/utils/computeOptionValueFromLabel';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
import { MAIN_COLOR_NAMES } from 'twenty-ui/theme';
@@ -185,7 +180,7 @@ export const SettingsDataModelFieldSelectFormOptionRow = ({
indicator="check"
startIcon={<ColorSample colorName={colorName} />}
>
- <OverflowingTextWithTooltip text={colorLabels[colorName]} />
+ {colorLabels[colorName]}
</ListItem>
))}
</DropdownMenuItemsContainer>
@@ -234,34 +229,31 @@ export const SettingsDataModelFieldSelectFormOptionRow = ({
<DropdownContent>
<DropdownMenuItemsContainer>
{isDefault ? (
- <MenuItem
- LeftIcon={IconX}
- text={t`Remove as default`}
+ <ListItem
+ startIcon={<IconX />}
onClick={() => {
onRemoveAsDefault?.();
closeActionsDropdown(SELECT_ACTIONS_DROPDOWN_ID);
}}
- />
+ >{t`Remove as default`}</ListItem>
) : (
- <MenuItem
- LeftIcon={IconCheck}
- text={t`Set as default`}
+ <ListItem
+ startIcon={<IconCheck />}
onClick={() => {
onSetAsDefault?.();
closeActionsDropdown(SELECT_ACTIONS_DROPDOWN_ID);
}}
- />
+ >{t`Set as default`}</ListItem>
)}
{!!onRemove && !isDefault && (
- <MenuItem
- accent="danger"
- LeftIcon={IconTrash}
- text={t`Remove option`}
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={() => {
onRemove();
closeActionsDropdown(SELECT_ACTIONS_DROPDOWN_ID);
}}
- />
+ >{t`Remove option`}</ListItem>
)}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx
index 14e052e81ac..d0dd192cbaa 100644
--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/SettingsObjectFieldDisabledActionDropdown.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
@@ -12,7 +13,6 @@ import {
IconTrash,
} from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { type FieldMetadataType } from '~/generated-metadata/graphql';
type SettingsObjectFieldInactiveActionDropdownProps = {
@@ -70,25 +70,24 @@ export const SettingsObjectFieldInactiveActionDropdown = ({
dropdownComponents={
<DropdownContent widthInPixels={GenericDropdownContentWidth.Narrow}>
<DropdownMenuItemsContainer>
- <MenuItem
- text={isCustomField && !readonly ? t`Edit` : t`View`}
- LeftIcon={isCustomField ? IconPencil : IconEye}
+ <ListItem
+ startIcon={isCustomField ? <IconPencil /> : <IconEye />}
onClick={handleEdit}
- />
+ >
+ {isCustomField && !readonly ? t`Edit` : t`View`}
+ </ListItem>
{!readonly && (
- <MenuItem
- text={t`Activate`}
- LeftIcon={IconArchiveOff}
+ <ListItem
+ startIcon={<IconArchiveOff />}
onClick={handleActivate}
- />
+ >{t`Activate`}</ListItem>
)}
{isDeletable && !readonly && (
- <MenuItem
- text={t`Delete`}
- accent="danger"
- LeftIcon={IconTrash}
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={handleDelete}
- />
+ >{t`Delete`}</ListItem>
)}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx
index 0225ad60bee..95765d7a8b6 100644
--- a/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/object-details/components/tabs/SettingsObjectSearchSection.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useUpdateOneFieldMetadataItem } from '@/object-metadata/hooks/useUpdateOneFieldMetadataItem';
import { useUpdateOneObjectMetadataItem } from '@/object-metadata/hooks/useUpdateOneObjectMetadataItem';
import { type EnrichedObjectMetadataItem } from '@/object-metadata/types/EnrichedObjectMetadataItem';
@@ -33,7 +35,6 @@ import {
} from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { Card } from 'twenty-ui/primitives/surfaces';
import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants';
@@ -276,15 +277,16 @@ export const SettingsObjectSearchSection = ({
const FieldIcon = getIcon(field.icon);
return (
- <MenuItem
+ <ListItem
key={field.id}
- LeftIcon={FieldIcon}
- text={field.label}
+ startIcon={<SelectOptionIcon Icon={FieldIcon} />}
onClick={() => {
closeDropdown(ADD_SEARCH_FIELD_DROPDOWN_ID);
handleSetFieldSearchable(field.id, true);
}}
- />
+ >
+ {field.label}
+ </ListItem>
);
})}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx b/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx
index bbd4e7e0c1f..2062012ec30 100644
--- a/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/objects/components/SettingsObjectInactiveMenuDropDown.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
@@ -12,7 +13,6 @@ import {
IconTrash,
} from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type SettingsObjectInactiveMenuDropDownProps = {
isCustomObject: boolean;
@@ -66,25 +66,24 @@ export const SettingsObjectInactiveMenuDropDown = ({
dropdownComponents={
<DropdownContent widthInPixels={GenericDropdownContentWidth.Narrow}>
<DropdownMenuItemsContainer>
- <MenuItem
- text={isEditable ? t`Edit` : t`View`}
- LeftIcon={isEditable ? IconPencil : IconEye}
+ <ListItem
+ startIcon={isEditable ? <IconPencil /> : <IconEye />}
onClick={handleEdit}
- />
+ >
+ {isEditable ? t`Edit` : t`View`}
+ </ListItem>
{!isReadOnly && (
- <MenuItem
- text={t`Activate`}
- LeftIcon={IconArchiveOff}
+ <ListItem
+ startIcon={<IconArchiveOff />}
onClick={handleActivate}
- />
+ >{t`Activate`}</ListItem>
)}
{isCustomObject && !isReadOnly && (
- <MenuItem
- text={t`Delete`}
- LeftIcon={IconTrash}
- accent="danger"
+ <ListItem
+ startIcon={<IconTrash />}
+ color="danger"
onClick={handleDelete}
- />
+ >{t`Delete`}</ListItem>
)}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx b/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx
index a6e3745b487..34dd6f01728 100644
--- a/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx
+++ b/packages/twenty-front/src/modules/settings/developers/components/WebhookEntitySelect.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { useObjectMetadataSelectHelpers } from '@/object-metadata/hooks/useObjectMetadataSelectHelpers';
import { SelectControl } from '@/ui/input/components/SelectControl';
@@ -161,7 +160,7 @@ export const WebhookEntitySelect = ({
/>
}
>
- <OverflowingTextWithTooltip text={option.label} />
+ {option.label}
</ListItem>
</SelectableListItem>
))}
@@ -186,7 +185,7 @@ export const WebhookEntitySelect = ({
indicator="check"
startIcon={<SelectOptionIcon Icon={option.Icon} />}
>
- <OverflowingTextWithTooltip text={option.label} />
+ {option.label}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomainRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomainRowDropdownMenu.tsx
index 44f6d708675..b9900e28584 100644
--- a/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomainRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/domains/components/SettingPublicDomainRowDropdownMenu.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
@@ -8,7 +9,6 @@ import { useLingui } from '@lingui/react/macro';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { useToast } from 'twenty-ui/primitives/feedback';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import {
type PublicDomain,
DeletePublicDomainDocument,
@@ -59,16 +59,15 @@ export const SettingPublicDomainRowDropdownMenu = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- accent="danger"
- LeftIcon={IconTrash}
- text={t`Delete`}
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={async () => {
await handleDeletePublicDomain();
closeDropdown(dropdownId);
await refetchPublicDomains();
}}
- />
+ >{t`Delete`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx
index 7a94927f743..3c763b2848b 100644
--- a/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/profile/devices/components/SettingsDeviceSessionRowDropdownMenu.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useMutation } from '@apollo/client/react';
import { t } from '@lingui/core/macro';
@@ -8,7 +9,6 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { useToast } from 'twenty-ui/primitives/feedback';
import { IconDotsVertical, IconLogout } from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import {
CurrentUserSessionsDocument,
RevokeUserSessionDocument,
@@ -56,12 +56,11 @@ export const SettingsDeviceSessionRowDropdownMenu = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- accent="danger"
- LeftIcon={IconLogout}
- text={t`Log out`}
+ <ListItem
+ color="danger"
+ startIcon={<IconLogout />}
onClick={handleRevokeSession}
- />
+ >{t`Log out`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentWorkspaceMemberPickerDropdownContent.tsx b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentWorkspaceMemberPickerDropdownContent.tsx
index 40fd546b937..550648bfa39 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentWorkspaceMemberPickerDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-assignment/components/SettingsRoleAssignmentWorkspaceMemberPickerDropdownContent.tsx
@@ -1,7 +1,7 @@
import { currentWorkspaceMembersState } from '@/auth/states/currentWorkspaceMembersState';
import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
-import { MenuItem, MenuItemAvatar } from 'twenty-ui/primitives/navigation';
+import { ListItem, MenuItemAvatar } from 'twenty-ui/primitives/navigation';
import { type SearchRecord } from '~/generated/graphql';
import { type PartialWorkspaceMember } from '@/settings/roles/types/RoleWithPartialMembers';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
@@ -28,7 +28,7 @@ export const SettingsRoleAssignmentWorkspaceMemberPickerDropdownContent = ({
}
if (!filteredWorkspaceMembers.length && searchFilter.length > 0) {
- return <MenuItem disabled text={t`No Results`} />;
+ return <ListItem disabled>{t`No Results`}</ListItem>;
}
const enrichedWorkspaceMembers = filteredWorkspaceMembers
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRowOptionsDropdown.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRowOptionsDropdown.tsx
index a22a6b3f784..23b848fdd5e 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRowOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/components/SettingsRolePermissionsObjectLevelTableRowOptionsDropdown.tsx
@@ -6,7 +6,7 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconPencil, IconTrash } from 'twenty-ui/icon';
import { IconButton } from 'twenty-ui/components';
-import { MenuItem, UndecoratedLink } from 'twenty-ui/primitives/navigation';
+import { ListItem, UndecoratedLink } from 'twenty-ui/primitives/navigation';
type SettingsRolePermissionsObjectLevelTableRowOptionsDropdownProps = {
roleId: string;
@@ -53,17 +53,16 @@ export const SettingsRolePermissionsObjectLevelTableRowOptionsDropdown = ({
to={objectPermissionDetailUrl}
onClick={() => closeDropdown(dropdownId)}
>
- <MenuItem text={t`Edit`} LeftIcon={IconPencil} />
+ <ListItem startIcon={<IconPencil />}>{t`Edit`}</ListItem>
</UndecoratedLink>
</DropdownMenuItemsContainer>
)}
<DropdownMenuItemsContainer>
- <MenuItem
- text={t`Remove rule`}
+ <ListItem
onClick={handleRemove}
- LeftIcon={IconTrash}
- accent="danger"
- />
+ startIcon={<IconTrash />}
+ color="danger"
+ >{t`Remove rule`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectSubFieldMenu.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectSubFieldMenu.tsx
index 9157333076a..31cd067bf9a 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectSubFieldMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectSubFieldMenu.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
/* @license Enterprise */
import {
@@ -6,7 +8,6 @@ import {
} from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, useIcons } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { useAdvancedFilterFieldSelectDropdown } from '@/object-record/advanced-filter/hooks/useAdvancedFilterFieldSelectDropdown';
@@ -156,10 +157,10 @@ export const SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectS
);
}}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === subFieldName}
key={`select-filter-${index}`}
- testId={`select-filter-${index}`}
+ data-testid={`select-filter-${index}`}
onClick={() => {
if (isDefined(fieldMetadataItemUsedInDropdown)) {
handleSelectFilter(
@@ -168,15 +169,20 @@ export const SettingsRolePermissionsObjectLevelRecordLevelPermissionFieldSelectS
);
}
}}
- text={getCompositeSubFieldLabel(
+ startIcon={
+ <SelectOptionIcon
+ Icon={getIcon(
+ ICON_NAME_BY_SUB_FIELD[subFieldName] ??
+ fieldMetadataItemUsedInDropdown?.icon,
+ )}
+ />
+ }
+ >
+ {getCompositeSubFieldLabel(
objectFilterDropdownSubMenuFieldType,
subFieldName,
)}
- LeftIcon={getIcon(
- ICON_NAME_BY_SUB_FIELD[subFieldName] ??
- fieldMetadataItemUsedInDropdown?.icon,
- )}
- />
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionMeValueSelect.tsx b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionMeValueSelect.tsx
index e617e8128b8..23621ce9210 100644
--- a/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionMeValueSelect.tsx
+++ b/packages/twenty-front/src/modules/settings/roles/role-permissions/object-level-permissions/record-level-permissions/components/SettingsRolePermissionsObjectLevelRecordLevelPermissionMeValueSelect.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
/* @license Enterprise */
import { styled } from '@linaria/react';
@@ -10,7 +12,6 @@ import {
} from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { IconUserCircle, IconX, useIcons } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { useObjectMetadataItem } from '@/object-metadata/hooks/useObjectMetadataItem';
@@ -303,21 +304,22 @@ export const SettingsRolePermissionsObjectLevelRecordLevelPermissionMeValueSelec
/>
<DropdownMenuItemsContainer>
{filteredMenuItems.map((item) => (
- <MenuItem
+ <ListItem
key={item.id}
- LeftIcon={item.icon ? getIcon(item.icon) : IconUserCircle}
- text={item.label}
+ startIcon={
+ <SelectOptionIcon
+ Icon={item.icon ? getIcon(item.icon) : IconUserCircle}
+ />
+ }
onClick={() =>
handleSelectField(item.fieldMetadataId, item.subFieldName)
}
- />
+ >
+ {item.label}
+ </ListItem>
))}
{filteredMenuItems.length === 0 && (
- <MenuItem
- text={t`No compatible fields`}
- onClick={() => {}}
- disabled
- />
+ <ListItem disabled>{t`No compatible fields`}</ListItem>
)}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityEditableProfileFields.tsx b/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityEditableProfileFields.tsx
index 08c545d347a..94b37b85ffc 100644
--- a/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityEditableProfileFields.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/SettingsSecurityEditableProfileFields.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
import { getToastOptionsFromError } from '@/error-handler/utils/getToastOptionsFromError';
import { EDITABLE_PROFILE_FIELDS_DROPDOWN_ID } from '@/settings/security/constants/EditableProfileFields.constants';
@@ -142,7 +141,7 @@ export const SettingsSecurityEditableProfileFields = () => {
onClick={() => toggleField(option.value)}
startIcon={<SelectOptionIcon Icon={option.Icon} />}
>
- <OverflowingTextWithTooltip text={option.label} />
+ {option.label}
</ListItem>
))}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx
index cf8d3c5e698..72662308fb1 100644
--- a/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/approvedAccessDomains/SettingsSecurityApprovedAccessDomainRowDropdownMenu.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { approvedAccessDomainsState } from '@/settings/security/states/ApprovedAccessDomainsState';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
@@ -10,7 +11,6 @@ import { isDefined } from 'twenty-shared/utils';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { useToast } from 'twenty-ui/primitives/feedback';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import {
type ApprovedAccessDomain,
DeleteApprovedAccessDomainDocument,
@@ -71,15 +71,16 @@ export const SettingsSecurityApprovedAccessDomainRowDropdownMenu = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- accent="danger"
- LeftIcon={IconTrash}
- text="Delete"
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={() => {
handleDeleteApprovedAccessDomain();
closeDropdown(dropdownId);
}}
- />
+ >
+ {'Delete'}
+ </ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSecuritySsoRowDropdownMenu.tsx b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSecuritySsoRowDropdownMenu.tsx
index 8977a0fc0c9..233f2fe9774 100644
--- a/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSecuritySsoRowDropdownMenu.tsx
+++ b/packages/twenty-front/src/modules/settings/security/components/sso/SettingsSecuritySsoRowDropdownMenu.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useDeleteSsoIdentityProvider } from '@/settings/security/hooks/useDeleteSsoIdentityProvider';
import { useUpdateSsoIdentityProvider } from '@/settings/security/hooks/useUpdateSsoIdentityProvider';
import { type SsoIdentityProvider } from '@/settings/security/types/SsoIdentityProvider';
@@ -10,7 +11,6 @@ import { isDefined } from 'twenty-shared/utils';
import { useToast } from 'twenty-ui/primitives/feedback';
import { IconArchive, IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { SsoIdentityProviderStatus } from '~/generated-metadata/graphql';
type SettingsSecuritySsoRowDropdownMenuProps = {
@@ -77,24 +77,23 @@ export const SettingsSecuritySsoRowDropdownMenu = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- accent="default"
- LeftIcon={IconArchive}
- text={ssoIdp.status === 'Active' ? t`Deactivate` : t`Activate`}
+ <ListItem
+ startIcon={<IconArchive />}
onClick={() => {
toggleSsoIdentityProviderStatus(ssoIdp.id);
closeDropdown(dropdownId);
}}
- />
- <MenuItem
- accent="danger"
- LeftIcon={IconTrash}
- text={t`Delete`}
+ >
+ {ssoIdp.status === 'Active' ? t`Deactivate` : t`Activate`}
+ </ListItem>
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={() => {
handleDeleteSsoIdentityProvider(ssoIdp.id);
closeDropdown(dropdownId);
}}
- />
+ >{t`Delete`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/settings/unsubscribers/components/filter-dropdown/SettingsUnsubscribersFilterMenuContent.tsx b/packages/twenty-front/src/modules/settings/unsubscribers/components/filter-dropdown/SettingsUnsubscribersFilterMenuContent.tsx
index d513d21920e..d95de45080e 100644
--- a/packages/twenty-front/src/modules/settings/unsubscribers/components/filter-dropdown/SettingsUnsubscribersFilterMenuContent.tsx
+++ b/packages/twenty-front/src/modules/settings/unsubscribers/components/filter-dropdown/SettingsUnsubscribersFilterMenuContent.tsx
@@ -1,6 +1,6 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useLingui } from '@lingui/react/macro';
import { IconMailCog, IconStatusChange, IconTrash } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { type SettingsUnsubscribersFilterContentId } from '@/settings/unsubscribers/components/filter-dropdown/types/SettingsUnsubscribersFilterContentId';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
@@ -27,31 +27,28 @@ export const SettingsUnsubscribersFilterMenuContent = ({
return (
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconStatusChange}
- text={t`Reason`}
- contextualText={reasonLabel}
- contextualTextPosition="right"
- hasSubMenu
+ <ListItem
+ startIcon={<IconStatusChange />}
+ description={reasonLabel}
+ descriptionPlacement="end"
+ hasSubmenu
onClick={() => onContentChange('reason')}
- />
- <MenuItem
- LeftIcon={IconMailCog}
- text={t`Topic`}
- contextualText={topicLabel}
- contextualTextPosition="right"
- hasSubMenu
+ >{t`Reason`}</ListItem>
+ <ListItem
+ startIcon={<IconMailCog />}
+ description={topicLabel}
+ descriptionPlacement="end"
+ hasSubmenu
onClick={() => onContentChange('topic')}
- />
+ >{t`Topic`}</ListItem>
{hasActiveFilters && (
<>
<DropdownMenuSeparator />
- <MenuItem
- accent="danger"
- LeftIcon={IconTrash}
- text={t`Clear filters`}
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={onClear}
- />
+ >{t`Clear filters`}</ListItem>
</>
)}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/settings/unsubscribers/components/filter-dropdown/SettingsUnsubscribersFilterOptionsContent.tsx b/packages/twenty-front/src/modules/settings/unsubscribers/components/filter-dropdown/SettingsUnsubscribersFilterOptionsContent.tsx
index 08bc26ac72a..4da192aa296 100644
--- a/packages/twenty-front/src/modules/settings/unsubscribers/components/filter-dropdown/SettingsUnsubscribersFilterOptionsContent.tsx
+++ b/packages/twenty-front/src/modules/settings/unsubscribers/components/filter-dropdown/SettingsUnsubscribersFilterOptionsContent.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { IconChevronLeft } from 'twenty-ui/icon';
import { ListItem } from 'twenty-ui/primitives/navigation';
@@ -53,7 +52,7 @@ export const SettingsUnsubscribersFilterOptionsContent = ({
selected={selectedValue === option.value}
indicator="check"
>
- <OverflowingTextWithTooltip text={option.label} />
+ {option.label}
</ListItem>
))}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/side-panel/components/SidePanelObjectFilterDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/components/SidePanelObjectFilterDropdownContent.tsx
index 09a83820ee9..df67b93b527 100644
--- a/packages/twenty-front/src/modules/side-panel/components/SidePanelObjectFilterDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/components/SidePanelObjectFilterDropdownContent.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useLingui } from '@lingui/react/macro';
import { useState } from 'react';
import { OBJECTS_WITH_CHANNEL_VISIBILITY_CONSTRAINTS } from 'twenty-shared/constants';
@@ -101,9 +100,7 @@ export const SidePanelObjectFilterDropdownContent = ({
selected={selectedObjectNameSingular === null}
indicator="check"
startIcon={<TintedIconTile Icon={IconCube} />}
- >
- <OverflowingTextWithTooltip text={t`All objects`} />
- </ListItem>
+ >{t`All objects`}</ListItem>
</SelectableListItem>
{displayedObjects.map((objectMetadataItem) => {
return (
@@ -131,9 +128,7 @@ export const SidePanelObjectFilterDropdownContent = ({
/>
}
>
- <OverflowingTextWithTooltip
- text={objectMetadataItem.labelPlural}
- />
+ {objectMetadataItem.labelPlural}
</ListItem>
</SelectableListItem>
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/WidgetSettingsFooter.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/WidgetSettingsFooter.tsx
index ccfd29c6ae6..e550f7ccd8a 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/WidgetSettingsFooter.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/WidgetSettingsFooter.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useDeletePageLayoutWidget } from '@/page-layout/hooks/useDeletePageLayoutWidget';
import { useDuplicatePageLayoutWidget } from '@/page-layout/hooks/useDuplicatePageLayoutWidget';
import { pageLayoutEditingWidgetIdComponentState } from '@/page-layout/states/pageLayoutEditingWidgetIdComponentState';
@@ -11,7 +12,6 @@ import { useLingui } from '@lingui/react/macro';
import { useId } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconCopyPlus, IconTrash } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
export const WidgetSettingsFooter = ({
pageLayoutId,
@@ -60,25 +60,23 @@ export const WidgetSettingsFooter = ({
itemId="duplicate-widget"
onEnter={handleDuplicateWidget}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'duplicate-widget'}
onClick={handleDuplicateWidget}
- text={t`Duplicate widget`}
- LeftIcon={IconCopyPlus}
- />
+ startIcon={<IconCopyPlus />}
+ >{t`Duplicate widget`}</ListItem>
</SelectableListItem>
<SelectableListItem
itemId="delete-widget"
onEnter={handleDeleteWidget}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'delete-widget'}
onClick={handleDeleteWidget}
- text={t`Delete widget`}
- LeftIcon={IconTrash}
- accent="danger"
- />
+ startIcon={<IconTrash />}
+ color="danger"
+ >{t`Delete widget`}</ListItem>
</SelectableListItem>
</OptionsDropdownMenu>,
]}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAggregateOperationSelectableListItem.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAggregateOperationSelectableListItem.tsx
index 3764c3c1003..fb281091b19 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAggregateOperationSelectableListItem.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAggregateOperationSelectableListItem.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
@@ -90,7 +89,7 @@ export const ChartAggregateOperationSelectableListItem = ({
selected={isSelected}
indicator="check"
>
- <OverflowingTextWithTooltip text={label} />
+ {label}
</ListItem>
</SelectableListItem>
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAxisNameSelectionDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAxisNameSelectionDropdownContent.tsx
index cfd258d8c36..77527695120 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAxisNameSelectionDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartAxisNameSelectionDropdownContent.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
@@ -87,9 +86,7 @@ export const ChartAxisNameSelectionDropdownContent = () => {
selected={currentAxisNameDisplay?.toUpperCase() === option}
indicator="check"
>
- <OverflowingTextWithTooltip
- text={getChartAxisNameDisplayOptions(option)}
- />
+ {getChartAxisNameDisplayOptions(option)}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorGradientOption.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorGradientOption.tsx
index 21757d7d586..998c687963a 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorGradientOption.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorGradientOption.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { CHART_SETTINGS_PALETTE_COLOR_GROUP_COUNT } from '@/side-panel/pages/page-layout/constants/ChartSettingsPaletteColorGroupCount';
import { createGraphColorRegistry } from '@/page-layout/widgets/graph/utils/createGraphColorRegistry';
import { generateGroupColor } from '@/page-layout/widgets/graph/utils/generateGroupColor';
@@ -79,7 +78,7 @@ export const ChartColorGradientOption = ({
description={colorSamples}
descriptionPlacement={'end'}
>
- <OverflowingTextWithTooltip text={colorOption.name} />
+ {colorOption.name}
</ListItem>
</SelectableListItem>
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorPaletteOption.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorPaletteOption.tsx
index d7d8fcab9c4..644e6885e46 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorPaletteOption.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartColorPaletteOption.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { CHART_SETTINGS_PALETTE_COLOR_GROUP_COUNT } from '@/side-panel/pages/page-layout/constants/ChartSettingsPaletteColorGroupCount';
import { createGraphColorRegistry } from '@/page-layout/widgets/graph/utils/createGraphColorRegistry';
import { getColorSchemeByIndex } from '@/page-layout/widgets/graph/utils/getColorSchemeByIndex';
@@ -76,9 +75,7 @@ export const ChartColorPaletteOption = ({
indicator="check"
description={colorSamples}
descriptionPlacement={'end'}
- >
- <OverflowingTextWithTooltip text={t`Default palette`} />
- </ListItem>
+ >{t`Default palette`}</ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDataSourceDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDataSourceDropdownContent.tsx
index cc2e57913d8..5be848943b0 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDataSourceDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDataSourceDropdownContent.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { ObjectMetadataIcon } from '@/object-metadata/components/ObjectMetadataIcon';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { filterReadableActiveObjectMetadataItems } from '@/object-metadata/utils/filterReadableActiveObjectMetadataItems';
@@ -152,9 +151,7 @@ export const ChartDataSourceDropdownContent = () => {
/>
}
>
- <OverflowingTextWithTooltip
- text={objectMetadataItem.labelPlural}
- />
+ {objectMetadataItem.labelPlural}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDateGranularitySelectionDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDateGranularitySelectionDropdownContent.tsx
index 4c244ed7d05..b37b647d698 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDateGranularitySelectionDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartDateGranularitySelectionDropdownContent.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
@@ -171,9 +170,7 @@ export const ChartDateGranularitySelectionDropdownContent = ({
selected={currentDateGranularity === option}
indicator="check"
>
- <OverflowingTextWithTooltip
- text={getDateGranularityLabel(option)}
- />
+ {getDateGranularityLabel(option)}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartFieldSelectionForAggregateOperationDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartFieldSelectionForAggregateOperationDropdownContent.tsx
index defbf6ef3d2..75be4da035b 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartFieldSelectionForAggregateOperationDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartFieldSelectionForAggregateOperationDropdownContent.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { ChartAggregateOperationSelectionDropdownContent } from '@/side-panel/pages/page-layout/components/dropdown-content/ChartAggregateOperationSelectionDropdownContent';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
@@ -127,7 +126,7 @@ export const ChartFieldSelectionForAggregateOperationDropdownContent = () => {
<SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
}
>
- <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ {fieldMetadataItem.label}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionCompositeFieldView.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionCompositeFieldView.tsx
index 92b66e8e614..cbc00dc6974 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionCompositeFieldView.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionCompositeFieldView.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { getCompositeSubFieldLabel } from '@/object-record/object-filter-dropdown/utils/getCompositeSubFieldLabel';
import { ICON_NAME_BY_SUB_FIELD } from '@/object-record/record-filter/constants/IconNameBySubField';
@@ -91,12 +90,7 @@ export const ChartGroupByFieldSelectionCompositeFieldView = ({
/>
}
>
- <OverflowingTextWithTooltip
- text={getCompositeSubFieldLabel(
- compositeFieldType,
- subFieldName,
- )}
- />
+ {getCompositeSubFieldLabel(compositeFieldType, subFieldName)}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionDropdownContentBase.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionDropdownContentBase.tsx
index 563cf6fa48f..1fba3e51fb6 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionDropdownContentBase.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionDropdownContentBase.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { isHiddenSystemField } from '@/object-metadata/utils/isHiddenSystemField';
@@ -350,9 +349,7 @@ export const ChartGroupByFieldSelectionDropdownContentBase = <
aria-selected={!isDefined(currentGroupByFieldMetadataId)}
selected={!isDefined(currentGroupByFieldMetadataId)}
indicator="check"
- >
- <OverflowingTextWithTooltip text={t`None`} />
- </ListItem>
+ >{t`None`}</ListItem>
</SelectableListItem>
)}
@@ -392,7 +389,7 @@ export const ChartGroupByFieldSelectionDropdownContentBase = <
<SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
}
>
- <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ {fieldMetadataItem.label}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionMorphRelationFieldView.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionMorphRelationFieldView.tsx
index dd782fcf89e..1980117792e 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionMorphRelationFieldView.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionMorphRelationFieldView.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { ChartGroupByFieldSelectionTargetObjectFieldsView } from '@/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView';
@@ -15,7 +17,6 @@ import { t } from '@lingui/core/macro';
import { useMemo, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, useIcons } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { RelationType } from '~/generated-metadata/graphql';
type MorphRelationTarget = {
@@ -128,7 +129,7 @@ export const ChartGroupByFieldSelectionMorphRelationFieldView = ({
<DropdownMenuSeparator />
<DropdownMenuItemsContainer>
{availableTargets.length === 0 ? (
- <MenuItem text={t`No targets available`} />
+ <ListItem disabled>{t`No targets available`}</ListItem>
) : (
<SelectableList
selectableListInstanceId={dropdownId}
@@ -145,17 +146,24 @@ export const ChartGroupByFieldSelectionMorphRelationFieldView = ({
setSelectedTarget(target);
}}
>
- <MenuItem
- text={target.label}
+ <ListItem
focused={selectedItemId === target.perTargetFieldId}
- LeftIcon={
- isDefined(target.icon) ? getIcon(target.icon) : undefined
+ startIcon={
+ <SelectOptionIcon
+ Icon={
+ isDefined(target.icon)
+ ? getIcon(target.icon)
+ : undefined
+ }
+ />
}
- hasSubMenu
+ hasSubmenu
onClick={() => {
setSelectedTarget(target);
}}
- />
+ >
+ {target.label}
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView.tsx
index 4539caccbad..3973abc5ec2 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartGroupByFieldSelectionTargetObjectFieldsView.tsx
@@ -1,5 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { isCompositeFieldType } from '@/object-record/object-filter-dropdown/utils/isCompositeFieldType';
@@ -20,7 +20,6 @@ import { t } from '@lingui/core/macro';
import { useMemo, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, useIcons } from 'twenty-ui/icon';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
import { normalizeSearchText } from '~/utils/normalizeSearchText';
@@ -175,12 +174,12 @@ export const ChartGroupByFieldSelectionTargetObjectFieldsView = ({
/>
}
>
- <OverflowingTextWithTooltip text={recordOptionLabel} />
+ {recordOptionLabel}
</ListItem>
</SelectableListItem>
)}
{availableFields.length === 0 && !isRecordOptionVisible ? (
- <MenuItem text={t`No fields available`} />
+ <ListItem disabled>{t`No fields available`}</ListItem>
) : (
availableFields.map((fieldMetadataItem) => (
<SelectableListItem
@@ -210,7 +209,7 @@ export const ChartGroupByFieldSelectionTargetObjectFieldsView = ({
<SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
}
>
- <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ {fieldMetadataItem.label}
</ListItem>
</SelectableListItem>
))
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartNumberFormatSelectionDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartNumberFormatSelectionDropdownContent.tsx
index 1b9e847d648..ea9d2ab74e8 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartNumberFormatSelectionDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartNumberFormatSelectionDropdownContent.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { CHART_NUMBER_FORMAT_DEFAULT } from '@/page-layout/widgets/graph/constants/ChartNumberFormatDefault';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
@@ -93,9 +92,7 @@ export const ChartNumberFormatSelectionDropdownContent = () => {
selected={currentNumberFormat === option}
indicator="check"
>
- <OverflowingTextWithTooltip
- text={getChartNumberFormatLabel(option)}
- />
+ {getChartNumberFormatLabel(option)}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioAggregateOperationSelectableListItem.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioAggregateOperationSelectableListItem.tsx
index d9cb9442916..524d516f385 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioAggregateOperationSelectableListItem.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioAggregateOperationSelectableListItem.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
import { isWidgetConfigurationOfType } from '@/side-panel/pages/page-layout/utils/isWidgetConfigurationOfType';
@@ -52,7 +51,7 @@ export const ChartRatioAggregateOperationSelectableListItem = ({
indicator="check"
hasSubmenu={true}
>
- <OverflowingTextWithTooltip text={label} />
+ {label}
</ListItem>
</SelectableListItem>
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionBooleanSelectableListItem.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionBooleanSelectableListItem.tsx
index d53da49ac3d..aed9cbf26b7 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionBooleanSelectableListItem.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/ChartRatioOptionBooleanSelectableListItem.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { usePageLayoutIdFromContextStore } from '@/side-panel/pages/page-layout/hooks/usePageLayoutIdFromContextStore';
import { useUpdateCurrentWidgetConfig } from '@/side-panel/pages/page-layout/hooks/useUpdateCurrentWidgetConfig';
import { useWidgetInEditMode } from '@/side-panel/pages/page-layout/hooks/useWidgetInEditMode';
@@ -75,7 +74,7 @@ export const ChartRatioOptionBooleanSelectableListItem = ({
<SelectOptionIcon Icon={optionValue === 'true' ? IconCheck : IconX} />
}
>
- <OverflowingTextWithTooltip text={label} />
+ {label}
</ListItem>
</SelectableListItem>
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetFieldDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetFieldDropdownContent.tsx
index abb32c61aea..a7d75172d4a 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetFieldDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetFieldDropdownContent.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useFieldMetadataItemById } from '@/object-metadata/hooks/useFieldMetadataItemById';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
@@ -353,7 +352,7 @@ export const FieldWidgetFieldDropdownContent = () => {
/>
}
>
- <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ {fieldMetadataItem.label}
</ListItem>
</SelectableListItem>
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetLayoutDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetLayoutDropdownContent.tsx
index 47606e65554..72b8cf71b5c 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetLayoutDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetLayoutDropdownContent.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useFieldMetadataItemById } from '@/object-metadata/hooks/useFieldMetadataItemById';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { type FieldConfiguration } from '@/page-layout/types/FieldConfiguration';
@@ -283,9 +282,7 @@ export const FieldWidgetLayoutDropdownContent = () => {
<SelectOptionIcon Icon={DISPLAY_MODE_ICONS[displayMode]} />
}
>
- <OverflowingTextWithTooltip
- text={displayModeLabels[displayMode]}
- />
+ {displayModeLabels[displayMode]}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetNestedFieldDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetNestedFieldDropdownContent.tsx
index 1521037e6f9..ad3684be562 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetNestedFieldDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/FieldWidgetNestedFieldDropdownContent.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import {
StyledPageLayoutDropdownContentContainer,
@@ -66,7 +65,7 @@ export const FieldWidgetNestedFieldDropdownContent = ({
indicator="check"
startIcon={<SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />}
>
- <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ {fieldMetadataItem.label}
</ListItem>
</SelectableListItem>
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/MoveToTabDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/MoveToTabDropdownContent.tsx
index b6222f1fdde..b51c9f44978 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/MoveToTabDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/MoveToTabDropdownContent.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useMoveWidgetToTab } from '@/page-layout/hooks/useMoveWidgetToTab';
import { pageLayoutDraftComponentState } from '@/page-layout/states/pageLayoutDraftComponentState';
import { pageLayoutEditingWidgetIdComponentState } from '@/page-layout/states/pageLayoutEditingWidgetIdComponentState';
@@ -8,7 +9,6 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { PageLayoutTabLayoutMode } from '~/generated-metadata/graphql';
export const MoveToTabDropdownContent = () => {
@@ -56,7 +56,7 @@ export const MoveToTabDropdownContent = () => {
if (eligibleTabs.length === 0) {
return (
<DropdownMenuItemsContainer>
- <MenuItem text={t`No available tabs`} />
+ <ListItem disabled>{t`No available tabs`}</ListItem>
</DropdownMenuItemsContainer>
);
}
@@ -64,14 +64,15 @@ export const MoveToTabDropdownContent = () => {
return (
<DropdownMenuItemsContainer>
{eligibleTabs.map((tab) => (
- <MenuItem
+ <ListItem
key={tab.id}
- text={tab.title ?? ''}
onClick={() => {
moveWidgetToTab(pageLayoutEditingWidgetId, tab.id);
closeDropdown();
}}
- />
+ >
+ {tab.title ?? ''}
+ </ListItem>
))}
</DropdownMenuItemsContainer>
);
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/WidgetVisibilityOptionsList.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/WidgetVisibilityOptionsList.tsx
index 18bd4fb63a5..2a6088d1cc4 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/WidgetVisibilityOptionsList.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/dropdown-content/WidgetVisibilityOptionsList.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { VISIBILITY_OPTIONS } from '@/side-panel/pages/page-layout/constants/VisibilityOptions';
import { useVisibilityLabels } from '@/side-panel/pages/page-layout/hooks/useVisibilityLabels';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
@@ -55,7 +54,7 @@ export const WidgetVisibilityOptionsList = ({
selected={currentOptionId === option.id}
indicator="check"
>
- <OverflowingTextWithTooltip text={visibilityLabels[option.id]} />
+ {visibilityLabels[option.id]}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarFieldDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarFieldDropdownContent.tsx
index 570b33e00e7..d3c7edcc718 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarFieldDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarFieldDropdownContent.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { useRecordTableWidgetLayoutCallbacks } from '@/page-layout/widgets/record-table/hooks/useRecordTableWidgetLayoutCallbacks';
import { isFieldMetadataItemAvailableAsCalendarField } from '@/object-record/record-calendar/utils/isFieldMetadataItemAvailableAsCalendarField';
@@ -89,7 +88,7 @@ export const RecordTableCalendarFieldDropdownContent = ({
<SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
}
>
- <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ {fieldMetadataItem.label}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarLayoutDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarLayoutDropdownContent.tsx
index bf396029771..d09ef5aa87f 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarLayoutDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableCalendarLayoutDropdownContent.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useRecordTableWidgetLayoutCallbacks } from '@/page-layout/widgets/record-table/hooks/useRecordTableWidgetLayoutCallbacks';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { DropdownComponentInstanceContext } from '@/ui/layout/dropdown/contexts/DropdownComponentInstanceContext';
@@ -82,7 +81,7 @@ export const RecordTableCalendarLayoutDropdownContent = ({
indicator="check"
startIcon={<SelectOptionIcon Icon={Icon} />}
>
- <OverflowingTextWithTooltip text={label} />
+ {label}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableDataSourceDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableDataSourceDropdownContent.tsx
index 05f9fe0e644..488fc2a0622 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableDataSourceDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableDataSourceDropdownContent.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { ObjectMetadataIcon } from '@/object-metadata/components/ObjectMetadataIcon';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { filterReadableActiveObjectMetadataItems } from '@/object-metadata/utils/filterReadableActiveObjectMetadataItems';
@@ -161,9 +160,7 @@ export const RecordTableDataSourceDropdownContent = () => {
/>
}
>
- <OverflowingTextWithTooltip
- text={objectMetadataItem.labelPlural}
- />
+ {objectMetadataItem.labelPlural}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownHiddenFieldsContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownHiddenFieldsContent.tsx
index d5598538453..d74838f8d57 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownHiddenFieldsContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableFieldsDropdownHiddenFieldsContent.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { LightIconButton } from 'twenty-ui/components';
import { useActiveFieldMetadataItems } from '@/object-metadata/hooks/useActiveFieldMetadataItems';
import { useObjectMetadataItemById } from '@/object-metadata/hooks/useObjectMetadataItemById';
@@ -13,7 +15,6 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { IconChevronLeft, IconEye, useIcons } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { v4 } from 'uuid';
import { sortByProperty } from '~/utils/array/sortByProperty';
@@ -102,10 +103,12 @@ export const RecordTableFieldsDropdownHiddenFieldsContent = ({
</DropdownMenuHeader>
<DropdownMenuItemsContainer>
{hiddenFieldMetadataItems.map((fieldMetadataItem) => (
- <MenuItem
+ <ListItem
key={fieldMetadataItem.id}
- LeftIcon={getIcon(fieldMetadataItem.icon)}
- iconButtons={
+ startIcon={
+ <SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
+ }
+ actions={
<LightIconButton
aria-label={t`Show field`}
onClick={() => handleShowField(fieldMetadataItem.id)}
@@ -113,8 +116,9 @@ export const RecordTableFieldsDropdownHiddenFieldsContent = ({
<IconEye />
</LightIconButton>
}
- text={fieldMetadataItem.label}
- />
+ >
+ {fieldMetadataItem.label}
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableGroupByDropdownContent.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableGroupByDropdownContent.tsx
index 910227e4fb0..a1ff36cc4bf 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableGroupByDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableGroupByDropdownContent.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useObjectMetadataItems } from '@/object-metadata/hooks/useObjectMetadataItems';
import { useRecordTableWidgetLayoutCallbacks } from '@/page-layout/widgets/record-table/hooks/useRecordTableWidgetLayoutCallbacks';
import { isFieldMetadataItemAvailableAsWidgetGroupByField } from '@/page-layout/widgets/record-table/utils/isFieldMetadataItemAvailableAsWidgetGroupByField';
@@ -109,9 +108,7 @@ export const RecordTableGroupByDropdownContent = ({
aria-selected={!isDefined(currentMainGroupByFieldMetadataId)}
selected={!isDefined(currentMainGroupByFieldMetadataId)}
indicator="check"
- >
- <OverflowingTextWithTooltip text={t`None`} />
- </ListItem>
+ >{t`None`}</ListItem>
</SelectableListItem>
)}
{filteredFields.map((fieldMetadataItem) => (
@@ -141,7 +138,7 @@ export const RecordTableGroupByDropdownContent = ({
<SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
}
>
- <OverflowingTextWithTooltip text={fieldMetadataItem.label} />
+ {fieldMetadataItem.label}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableWidgetLayoutMenuItems.tsx b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableWidgetLayoutMenuItems.tsx
index 363bce1d66d..96ed4988896 100644
--- a/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableWidgetLayoutMenuItems.tsx
+++ b/packages/twenty-front/src/modules/side-panel/pages/page-layout/components/record-table-settings/RecordTableWidgetLayoutMenuItems.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type RecordTableWidgetLayoutViewType } from '@/page-layout/widgets/record-table/types/RecordTableWidgetLayoutViewType';
import { type RecordTableWidgetLayoutPickerOption } from '@/page-layout/widgets/record-table/utils/getRecordTableWidgetLayoutPickerOptions';
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
@@ -47,7 +46,7 @@ export const RecordTableWidgetLayoutMenuItems = ({
descriptionPlacement={'end'}
startIcon={<SelectOptionIcon Icon={Icon} />}
>
- <OverflowingTextWithTooltip text={t(label)} />
+ {t(label)}
</ListItem>
</SelectableListItem>
),
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelectFieldSelectDropdownContent.tsx b/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelectFieldSelectDropdownContent.tsx
index cc03ef1cdda..cbf4c5a2370 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelectFieldSelectDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelectFieldSelectDropdownContent.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useMemo, useState } from 'react';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
@@ -117,9 +116,7 @@ export const MatchColumnSelectFieldSelectDropdownContent = ({
selected={selectedValue?.value === DO_NOT_IMPORT_OPTION_KEY}
indicator="check"
startIcon={<SelectOptionIcon Icon={IconForbid} />}
- >
- <OverflowingTextWithTooltip text={t`Do not import`} />
- </ListItem>
+ >{t`Do not import`}</ListItem>
</DropdownMenuItemsContainer>
{suggestedOptions.length > 0 && (
<>
@@ -137,7 +134,7 @@ export const MatchColumnSelectFieldSelectDropdownContent = ({
description={option.fieldMetadataTypeLabel}
startIcon={<SelectOptionIcon Icon={option.Icon} />}
>
- <OverflowingTextWithTooltip text={option.label} />
+ {option.label}
</ListItem>
))}
</DropdownMenuItemsContainer>
@@ -160,7 +157,7 @@ export const MatchColumnSelectFieldSelectDropdownContent = ({
description={getFieldMetadataTypeLabel(field.type)}
startIcon={<SelectOptionIcon Icon={getIcon(field.icon)} />}
>
- <OverflowingTextWithTooltip text={field.label} />
+ {field.label}
</ListItem>
))}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelectSubFieldSelectDropdownContent.tsx b/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelectSubFieldSelectDropdownContent.tsx
index f8fbc05ad76..e48b3f7e2aa 100644
--- a/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelectSubFieldSelectDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/spreadsheet-import/components/MatchColumnSelectSubFieldSelectDropdownContent.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { type SpreadsheetImportFieldOption } from '@/spreadsheet-import/types/SpreadsheetImportFieldOption';
import { getSubFieldOptions } from '@/spreadsheet-import/utils/spreadsheetImportGetSubFieldOptions';
@@ -12,7 +14,6 @@ import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/Gene
import { useState } from 'react';
import { IconChevronLeft } from 'twenty-ui/icon';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
export const MatchColumnSelectSubFieldSelectDropdownContent = ({
fieldMetadataItem,
@@ -73,13 +74,14 @@ export const MatchColumnSelectSubFieldSelectDropdownContent = ({
<DropdownMenuItemsContainer hasMaxHeight>
{subFieldOptions.map(
({ value, shortLabelForNestedField, Icon, disabled }) => (
- <MenuItem
+ <ListItem
key={value}
onClick={() => handleSubFieldSelect(value)}
- LeftIcon={Icon}
- text={shortLabelForNestedField}
+ startIcon={<SelectOptionIcon Icon={Icon} />}
disabled={disabled}
- />
+ >
+ {shortLabelForNestedField}
+ </ListItem>
),
)}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx b/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx
index bff43b48038..66b09f839bd 100644
--- a/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx
+++ b/packages/twenty-front/src/modules/ui/field/input/components/MultiSelectInput.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { Tag } from 'twenty-ui/primitives/data-display';
import { isNonEmptyString } from '@sniptt/guards';
import { useRef, useState, createElement } from 'react';
@@ -20,7 +21,6 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { normalizeSearchText } from '~/utils/normalizeSearchText';
import { turnIntoEmptyStringIfWhitespacesOnly } from '~/utils/string/turnIntoEmptyStringIfWhitespacesOnly';
@@ -136,7 +136,7 @@ export const MultiSelectInput = ({
<DropdownMenuSeparator />
<DropdownMenuItemsContainer isMultiSelect hasMaxHeight>
{filteredOptionsInDropDown.length === 0 ? (
- <MenuItem text={t`No option found`} />
+ <ListItem disabled>{t`No option found`}</ListItem>
) : (
filteredOptionsInDropDown.map((option) => {
return (
diff --git a/packages/twenty-front/src/modules/ui/input/components/Select.tsx b/packages/twenty-front/src/modules/ui/input/components/Select.tsx
index dd2311e091b..891e046a782 100644
--- a/packages/twenty-front/src/modules/ui/input/components/Select.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/Select.tsx
@@ -1,6 +1,6 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { Tag } from 'twenty-ui/primitives/data-display';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { styled } from '@linaria/react';
import { type MouseEvent, useMemo, useRef, useState } from 'react';
@@ -25,7 +25,6 @@ import { isNonEmptyArray, isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { type IconComponent } from 'twenty-ui/icon';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { normalizeSearchText } from '~/utils/normalizeSearchText';
@@ -277,7 +276,7 @@ export const Select = <Value extends SelectValue>({
</>
}
>
- <OverflowingTextWithTooltip text={pinnedOption.label} />
+ {pinnedOption.label}
</ListItem>
</DropdownMenuItemsContainer>
)}
@@ -349,7 +348,7 @@ export const Select = <Value extends SelectValue>({
</>
}
>
- <OverflowingTextWithTooltip text={option.label} />
+ {option.label}
</ListItem>
)}
</SelectableListItem>
@@ -362,11 +361,14 @@ export const Select = <Value extends SelectValue>({
isNonEmptyArray(filteredOptions) && <DropdownMenuSeparator />}
{isDefined(callToActionButton) && (
<DropdownMenuItemsContainer hasMaxHeight scrollable={false}>
- <MenuItem
+ <ListItem
onClick={callToActionButton.onClick}
- LeftIcon={callToActionButton.Icon}
- text={callToActionButton.text}
- />
+ startIcon={
+ <SelectOptionIcon Icon={callToActionButton.Icon} />
+ }
+ >
+ {callToActionButton.text}
+ </ListItem>
</DropdownMenuItemsContainer>
)}
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/ui/input/components/ThemeColorPickerMenu.tsx b/packages/twenty-front/src/modules/ui/input/components/ThemeColorPickerMenu.tsx
index 5325dff6c09..baf14456aaf 100644
--- a/packages/twenty-front/src/modules/ui/input/components/ThemeColorPickerMenu.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/ThemeColorPickerMenu.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { ColorSample } from 'twenty-ui/primitives/data-display';
import { SelectableList } from '@/ui/layout/selectable-list/components/SelectableList';
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
@@ -76,9 +75,7 @@ export const ThemeColorPickerMenu = ({
indicator="check"
startIcon={<ColorSample colorName={colorName} />}
>
- <OverflowingTextWithTooltip
- text={DEFAULT_COLOR_LABELS[colorName]}
- />
+ {DEFAULT_COLOR_LABELS[colorName]}
</ListItem>
</SelectableListItem>
))}
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownSelect.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownSelect.tsx
index d3eb2e3bd4e..4b81112587a 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownSelect.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/currency/components/CurrencyPickerDropdownSelect.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { t } from '@lingui/core/macro';
import { useMemo, useState } from 'react';
@@ -9,7 +10,6 @@ import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownM
import { CURRENCIES } from '@/settings/data-model/constants/Currencies';
import { type Currency } from '@/ui/input/components/internal/types/Currency';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
export const CurrencyPickerDropdownSelect = ({
selectedCurrency,
@@ -43,7 +43,7 @@ export const CurrencyPickerDropdownSelect = ({
<DropdownMenuSeparator />
<DropdownMenuItemsContainer hasMaxHeight>
{filteredCurrencies.length === 0 ? (
- <MenuItem text={t`No results`} />
+ <ListItem disabled>{t`No results`}</ListItem>
) : (
<>
{selectedCurrency && (
@@ -55,7 +55,7 @@ export const CurrencyPickerDropdownSelect = ({
selected={true}
indicator="check"
>
- <OverflowingTextWithTooltip text={selectedCurrency.label} />
+ {selectedCurrency.label}
</ListItem>
)}
{filteredCurrencies.map((item) =>
diff --git a/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownSelect.tsx b/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownSelect.tsx
index 18f18cfbc7e..1b306a98423 100644
--- a/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownSelect.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/internal/phone/components/PhoneCountryPickerDropdownSelect.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { t } from '@lingui/core/macro';
import { styled } from '@linaria/react';
@@ -10,7 +11,6 @@ import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownM
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import 'react-phone-number-input/style.css';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const StyledIconContainer = styled.div`
@@ -59,7 +59,7 @@ export const PhoneCountryPickerDropdownSelect = ({
<DropdownMenuSeparator />
<DropdownMenuItemsContainer hasMaxHeight>
{filteredCountries?.length === 0 ? (
- <MenuItem text={t`No results`} />
+ <ListItem disabled>{t`No results`}</ListItem>
) : (
<>
{selectedCountry && (
diff --git a/packages/twenty-front/src/modules/ui/input/relation-picker/components/CreateNewButton.tsx b/packages/twenty-front/src/modules/ui/input/relation-picker/components/CreateNewButton.tsx
deleted file mode 100644
index f349cec1e2a..00000000000
--- a/packages/twenty-front/src/modules/ui/input/relation-picker/components/CreateNewButton.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import { css } from '@linaria/core';
-import React from 'react';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
-
-const hoveredStyle = css`
- background: ${themeCssVariables.background.transparent.light};
-`;
-
-type CreateNewButtonProps = React.ComponentProps<typeof MenuItem> & {
- hovered?: boolean;
-};
-
-export const CreateNewButton = ({
- hovered,
- className,
- accent,
- withIconContainer,
- iconButtons,
- isIconDisplayedOnHoverOnly,
- isTooltipOpen,
- LeftIcon,
- LeftComponent,
- RightIcon,
- RightComponent,
- onClick,
- onMouseEnter,
- onMouseLeave,
- testId,
- disabled,
- text,
- contextualTextPosition,
- contextualText,
- hasSubMenu,
- focused,
- hotKeys,
- isSubMenuOpened,
-}: CreateNewButtonProps) => (
- <MenuItem
- accent={accent}
- withIconContainer={withIconContainer}
- iconButtons={iconButtons}
- isIconDisplayedOnHoverOnly={isIconDisplayedOnHoverOnly}
- isTooltipOpen={isTooltipOpen}
- LeftIcon={LeftIcon}
- LeftComponent={LeftComponent}
- RightIcon={RightIcon}
- RightComponent={RightComponent}
- onClick={onClick}
- onMouseEnter={onMouseEnter}
- onMouseLeave={onMouseLeave}
- testId={testId}
- disabled={disabled}
- text={text}
- contextualTextPosition={contextualTextPosition}
- contextualText={contextualText}
- hasSubMenu={hasSubMenu}
- focused={focused}
- hotKeys={hotKeys}
- isSubMenuOpened={isSubMenuOpened}
- className={`${className ?? ''} ${hovered ? hoveredStyle : ''}`}
- />
-);
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuInnerSelect.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuInnerSelect.tsx
index cd69600ff43..d2868c9bec3 100644
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuInnerSelect.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/DropdownMenuInnerSelect.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
@@ -72,7 +71,7 @@ export const DropdownMenuInnerSelect = ({
selected={selectOption.value === selectedOption.value}
indicator="check"
>
- <OverflowingTextWithTooltip text={selectOption.label} />
+ {selectOption.label}
</ListItem>
))}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/__stories__/Dropdown.stories.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/__stories__/Dropdown.stories.tsx
index 541b2a2dccc..98249bdb33a 100644
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/__stories__/Dropdown.stories.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/__stories__/Dropdown.stories.tsx
@@ -22,7 +22,7 @@ import { DropdownMenuSeparator } from '@/ui/layout/dropdown/components/DropdownM
import { StyledDropdownMenuSubheader } from '@/ui/layout/dropdown/components/StyledDropdownMenuSubheader';
import { IconChevronLeft } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { ComponentDecorator } from 'twenty-ui/testing';
const meta: Meta<typeof Dropdown> = {
@@ -290,7 +290,7 @@ export const WithHeaders: Story = {
<DropdownMenuItemsContainer hasMaxHeight>
<>
{optionsMock.slice(0, 3).map((item) => (
- <MenuItem key={item.id} text={item.name} />
+ <ListItem key={item.id}>{item.name}</ListItem>
))}
</>
</DropdownMenuItemsContainer>
@@ -298,7 +298,7 @@ export const WithHeaders: Story = {
<StyledDropdownMenuSubheader>Subheader 2</StyledDropdownMenuSubheader>
<DropdownMenuItemsContainer>
{optionsMock.slice(3).map((item) => (
- <MenuItem key={item.id} text={item.name} />
+ <ListItem key={item.id}>{item.name}</ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
@@ -352,7 +352,7 @@ export const WithInput: Story = {
<DropdownMenuSeparator />
<DropdownMenuItemsContainer hasMaxHeight>
{optionsMock.map(({ name }) => (
- <MenuItem key={name} text={name} />
+ <ListItem key={name}>{name}</ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/__stories__/DropdownMenuHeader.stories.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/__stories__/DropdownMenuHeader.stories.tsx
index fc3284bf1ef..b30d0415721 100644
--- a/packages/twenty-front/src/modules/ui/layout/dropdown/components/__stories__/DropdownMenuHeader.stories.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/__stories__/DropdownMenuHeader.stories.tsx
@@ -7,7 +7,7 @@ import { DropdownMenuHeaderLeftComponent } from '@/ui/layout/dropdown/components
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
import { Avatar } from 'twenty-ui/primitives/data-display';
import { IconChevronLeft, IconChevronRight, IconPlus } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { AVATAR_URL_MOCK, ComponentDecorator } from 'twenty-ui/testing';
const meta: Meta<typeof DropdownMenuHeader> = {
@@ -57,7 +57,7 @@ export const ContextDropdownAndAvatar: Story = {
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem LeftIcon={IconPlus} text="Create Workspace" />
+ <ListItem startIcon={<IconPlus />}>{'Create Workspace'}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/ui/layout/dropdown/components/__stories__/DropdownMenuRows.stories.tsx b/packages/twenty-front/src/modules/ui/layout/dropdown/components/__stories__/DropdownMenuRows.stories.tsx
new file mode 100644
index 00000000000..105867972f3
--- /dev/null
+++ b/packages/twenty-front/src/modules/ui/layout/dropdown/components/__stories__/DropdownMenuRows.stories.tsx
@@ -0,0 +1,187 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { useState } from 'react';
+import { expect, fn, userEvent, waitFor, within } from 'storybook/test';
+import { Button } from 'twenty-ui/primitives/input';
+import { ComponentDecorator } from 'twenty-ui/testing';
+
+import { NavigationMenuItemSelectableItem } from '@/navigation-menu-item/edit/components/NavigationMenuItemSelectableItem';
+import { OptionsDropdownMenu } from '@/ui/layout/dropdown/components/OptionsDropdownMenu';
+import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
+import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
+import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
+import { WorkflowStepOptionsMenuItems } from '@/workflow/workflow-steps/components/WorkflowStepOptionsMenuItems';
+import { WORKFLOW_STEP_OPTIONS_MENU_ITEM_IDS } from '@/workflow/workflow-steps/constants/WorkflowStepOptionsMenuItemIds';
+
+const DROPDOWN_ID = 'dropdown-menu-rows-story';
+
+type DropdownMenuRowsProps = {
+ onAction: (action: string) => void;
+ onParentClick: () => void;
+};
+
+const DropdownMenuRows = ({
+ onAction,
+ onParentClick,
+}: DropdownMenuRowsProps) => {
+ const [isSubmenuOpen, setIsSubmenuOpen] = useState(false);
+ const { closeDropdown } = useCloseDropdown();
+ const selectedItemId = useAtomComponentStateValue(
+ selectedItemIdComponentState,
+ DROPDOWN_ID,
+ );
+
+ const handleDuplicate = () => {
+ onAction('duplicate');
+ closeDropdown(DROPDOWN_ID);
+ };
+
+ return (
+ <>
+ <div onClick={onParentClick}>
+ <OptionsDropdownMenu
+ dropdownId={DROPDOWN_ID}
+ shouldRegisterOptionsHotkey={false}
+ clickableComponent={<Button>Open actions</Button>}
+ onOpen={() => setIsSubmenuOpen(false)}
+ selectableItemIdArray={
+ isSubmenuOpen
+ ? ['disabled', 'destination']
+ : [
+ WORKFLOW_STEP_OPTIONS_MENU_ITEM_IDS.changeNode,
+ WORKFLOW_STEP_OPTIONS_MENU_ITEM_IDS.duplicateNode,
+ ]
+ }
+ >
+ {isSubmenuOpen ? (
+ <>
+ <NavigationMenuItemSelectableItem
+ item={{
+ id: 'disabled',
+ label: 'Unavailable destination',
+ isDisabled: true,
+ onClick: () => onAction('disabled'),
+ }}
+ />
+ <NavigationMenuItemSelectableItem
+ item={{
+ id: 'destination',
+ label: 'Choose destination',
+ onClick: () => {
+ onAction('destination');
+ closeDropdown(DROPDOWN_ID);
+ },
+ }}
+ />
+ </>
+ ) : (
+ <WorkflowStepOptionsMenuItems
+ selectedItemId={selectedItemId}
+ changeNodeText="Change node"
+ onChangeNode={() => setIsSubmenuOpen(true)}
+ onDuplicateNode={handleDuplicate}
+ />
+ )}
+ </OptionsDropdownMenu>
+ </div>
+ <Button>Outside</Button>
+ </>
+ );
+};
+
+const meta: Meta<typeof DropdownMenuRows> = {
+ title: 'UI/Layout/Dropdown/DropdownMenuRows',
+ component: DropdownMenuRows,
+ decorators: [ComponentDecorator],
+ args: {
+ onAction: fn(),
+ onParentClick: fn(),
+ },
+};
+
+export default meta;
+type Story = StoryObj<typeof DropdownMenuRows>;
+
+export const ClickAction: Story = {
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement.ownerDocument.body);
+
+ await userEvent.click(canvas.getByText('Open actions'));
+ await userEvent.click(await canvas.findByText('Duplicate node'));
+
+ expect(args.onAction).toHaveBeenCalledTimes(1);
+ expect(args.onAction).toHaveBeenCalledWith('duplicate');
+ expect(args.onParentClick).not.toHaveBeenCalled();
+ expect(canvas.queryByText('Duplicate node')).not.toBeInTheDocument();
+ },
+};
+
+export const KeyboardNavigationAndReopening: Story = {
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement.ownerDocument.body);
+
+ await userEvent.click(canvas.getByText('Open actions'));
+ await canvas.findByText('Change node');
+ await userEvent.keyboard('{ArrowDown}{Enter}');
+
+ expect(args.onAction).toHaveBeenCalledTimes(1);
+ expect(args.onAction).toHaveBeenCalledWith('duplicate');
+ expect(canvas.queryByText('Duplicate node')).not.toBeInTheDocument();
+
+ await userEvent.click(canvas.getByText('Open actions'));
+ await canvas.findByText('Change node');
+ await userEvent.keyboard('{Enter}');
+
+ expect(await canvas.findByText('Choose destination')).toBeVisible();
+ expect(args.onAction).toHaveBeenCalledTimes(1);
+ },
+};
+
+export const SubmenuAndDisabledActions: Story = {
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement.ownerDocument.body);
+
+ await userEvent.click(canvas.getByText('Open actions'));
+ await userEvent.click(await canvas.findByText('Change node'));
+ await userEvent.click(await canvas.findByText('Unavailable destination'));
+ await userEvent.keyboard('{Enter}');
+
+ expect(args.onAction).not.toHaveBeenCalled();
+ expect(canvas.getByText('Choose destination')).toBeVisible();
+
+ await userEvent.keyboard('{ArrowDown}{Enter}');
+
+ expect(args.onAction).toHaveBeenCalledTimes(1);
+ expect(args.onAction).toHaveBeenCalledWith('destination');
+ expect(canvas.queryByText('Choose destination')).not.toBeInTheDocument();
+ },
+};
+
+export const DismissOnEscape: Story = {
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement.ownerDocument.body);
+
+ await userEvent.click(canvas.getByText('Open actions'));
+ await canvas.findByText('Change node');
+ await userEvent.keyboard('{Escape}');
+
+ await waitFor(() => {
+ expect(canvas.queryByText('Change node')).not.toBeInTheDocument();
+ });
+ expect(args.onAction).not.toHaveBeenCalled();
+ },
+};
+
+export const DismissOnOutsideClick: Story = {
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement.ownerDocument.body);
+
+ await userEvent.click(canvas.getByText('Open actions'));
+ await canvas.findByText('Change node');
+ await userEvent.click(canvas.getByText('Outside'));
+
+ await waitFor(() => {
+ expect(canvas.queryByText('Change node')).not.toBeInTheDocument();
+ });
+ expect(args.onAction).not.toHaveBeenCalled();
+ },
+};
diff --git a/packages/twenty-front/src/modules/ui/layout/selectable-list/components/__stories__/SelectableList.stories.tsx b/packages/twenty-front/src/modules/ui/layout/selectable-list/components/__stories__/SelectableList.stories.tsx
index bbdc35edd13..19fef0ad337 100644
--- a/packages/twenty-front/src/modules/ui/layout/selectable-list/components/__stories__/SelectableList.stories.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/selectable-list/components/__stories__/SelectableList.stories.tsx
@@ -6,7 +6,7 @@ import { isNonEmptyString } from '@sniptt/guards';
import { type Meta, type StoryObj } from '@storybook/react-vite';
import { useEffect, useState } from 'react';
import { expect, fn, userEvent, waitFor, within } from 'storybook/test';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { ComponentDecorator } from 'twenty-ui/testing';
const ITEM_LABELS = [
@@ -63,7 +63,7 @@ const Render = ({ onEnter, shouldPreselectFirstItem }: RenderProps) => {
itemId={itemLabel}
onEnter={() => onEnter(itemLabel)}
>
- <MenuItem text={itemLabel} />
+ <ListItem>{itemLabel}</ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabListDropdown.tsx b/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabListDropdown.tsx
index c560460a686..e4147c860a6 100644
--- a/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabListDropdown.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/tab-list/components/TabListDropdown.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
@@ -65,7 +64,7 @@ export const TabListDropdown = ({
indicator="check"
startIcon={<TabAvatar tab={tab} />}
>
- <OverflowingTextWithTooltip text={tab.title} />
+ {tab.title}
</ListItem>
);
})}
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx
index afa82d76e38..fc72f115eb9 100644
--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownDefaultComponents.tsx
@@ -1,4 +1,4 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { DEFAULT_WORKSPACE_LOGO } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceLogo';
import { useAuth } from '@/auth/hooks/useAuth';
@@ -39,11 +39,7 @@ import {
IconUserPlus,
} from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import {
- MenuItem,
- UndecoratedLink,
- ListItem,
-} from 'twenty-ui/primitives/navigation';
+import { ListItem, UndecoratedLink } from 'twenty-ui/primitives/navigation';
import { useIsMobile } from 'twenty-ui/utilities';
import { type AvailableWorkspace } from '~/generated-metadata/graphql';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
@@ -134,17 +130,15 @@ export const MultiWorkspaceDropdownDefaultComponents = () => {
<DropdownContent>
<DropdownMenuItemsContainer>
{isMultiWorkspaceEnabled && (
- <MenuItem
- LeftIcon={IconPlus}
- text={t`Create Workspace`}
+ <ListItem
+ startIcon={<IconPlus />}
onClick={createWorkspace}
- />
+ >{t`Create Workspace`}</ListItem>
)}
- <MenuItem
- LeftIcon={IconLogout}
- text={t`Log out`}
+ <ListItem
+ startIcon={<IconLogout />}
onClick={signOut}
- />
+ >{t`Log out`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
@@ -187,19 +181,16 @@ export const MultiWorkspaceDropdownDefaultComponents = () => {
/>
}
>
- <OverflowingTextWithTooltip
- text={availableWorkspace.displayName ?? t`(No name)`}
- />
+ {availableWorkspace.displayName ?? t`(No name)`}
</ListItem>
</UndecoratedLink>
))}
{availableWorkspacesCount > 4 && (
- <MenuItem
- LeftIcon={IconSwitchHorizontal}
- text={t`Other workspaces`}
+ <ListItem
+ startIcon={<IconSwitchHorizontal />}
onClick={() => setMultiWorkspaceDropdown('workspaces-list')}
- hasSubMenu={true}
- />
+ hasSubmenu
+ >{t`Other workspaces`}</ListItem>
)}
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
@@ -209,29 +200,34 @@ export const MultiWorkspaceDropdownDefaultComponents = () => {
{/* Desktop reaches settings from the drawer's mode switcher, which
mobile does not render, so the workspace menu is where it lives. */}
{isMobile && (
- <MenuItem
- LeftIcon={IconSettings}
- text={t`Settings`}
+ <ListItem
+ startIcon={<IconSettings />}
onClick={handleSettings}
- />
+ >{t`Settings`}</ListItem>
)}
- <MenuItem
- LeftIcon={colorSchemeList.find(({ id }) => id === colorScheme)?.icon}
- text={t`Theme`}
- contextualText={colorScheme}
- hasSubMenu={true}
+ <ListItem
+ startIcon={
+ <SelectOptionIcon
+ Icon={colorSchemeList.find(({ id }) => id === colorScheme)?.icon}
+ />
+ }
+ description={colorScheme}
+ hasSubmenu
onClick={() => setMultiWorkspaceDropdown('themes')}
- />
+ >{t`Theme`}</ListItem>
{canDisplaySidePanel && (
- <MenuItem
- LeftIcon={OPEN_RECORD_IN_OPTIONS[openRecordInPreference].Icon}
- text={t`Open in`}
- contextualText={t(
+ <ListItem
+ startIcon={
+ <SelectOptionIcon
+ Icon={OPEN_RECORD_IN_OPTIONS[openRecordInPreference].Icon}
+ />
+ }
+ description={t(
OPEN_RECORD_IN_OPTIONS[openRecordInPreference].label,
)}
- hasSubMenu={true}
+ hasSubmenu
onClick={() => setMultiWorkspaceDropdown('open-record-in')}
- />
+ >{t`Open in`}</ListItem>
)}
<UndecoratedLink
to={`${getSettingsPath(SettingsPath.WorkspaceMembersPage)}#invite`}
@@ -239,14 +235,13 @@ export const MultiWorkspaceDropdownDefaultComponents = () => {
closeDropdown(MULTI_WORKSPACE_DROPDOWN_ID);
}}
>
- <MenuItem LeftIcon={IconUserPlus} text={t`Invite user`} />
+ <ListItem startIcon={<IconUserPlus />}>{t`Invite user`}</ListItem>
</UndecoratedLink>
{isSupportChatConfigured && (
- <MenuItem
- LeftIcon={IconMessage}
- text={t`Support`}
+ <ListItem
+ startIcon={<IconMessage />}
onClick={handleSupport}
- />
+ >{t`Support`}</ListItem>
)}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownOpenRecordInComponents.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownOpenRecordInComponents.tsx
index bc1dff5bd04..426b3e70d71 100644
--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownOpenRecordInComponents.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownOpenRecordInComponents.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useOpenRecordInPreference } from '@/settings/experience/hooks/useOpenRecordInPreference';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader/DropdownMenuHeader';
@@ -8,8 +10,7 @@ import { multiWorkspaceDropdownState } from '@/ui/navigation/navigation-drawer/s
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { useLingui } from '@lingui/react/macro';
import { OpenRecordIn } from 'twenty-shared/types';
-import { IconCheck, IconChevronLeft } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
+import { IconChevronLeft } from 'twenty-ui/icon';
export const MultiWorkspaceDropdownOpenRecordInComponents = () => {
const { t } = useLingui();
@@ -35,15 +36,21 @@ export const MultiWorkspaceDropdownOpenRecordInComponents = () => {
</DropdownMenuHeader>
<DropdownMenuItemsContainer>
{Object.values(OpenRecordIn).map((openRecordIn) => (
- <MenuItem
+ <ListItem
key={openRecordIn}
- LeftIcon={OPEN_RECORD_IN_OPTIONS[openRecordIn].Icon}
- text={t(OPEN_RECORD_IN_OPTIONS[openRecordIn].label)}
- onClick={() => setOpenRecordInPreference(openRecordIn)}
- RightIcon={
- openRecordIn === openRecordInPreference ? IconCheck : undefined
+ startIcon={
+ <SelectOptionIcon
+ Icon={OPEN_RECORD_IN_OPTIONS[openRecordIn].Icon}
+ />
}
- />
+ onClick={() => setOpenRecordInPreference(openRecordIn)}
+ role="option"
+ aria-selected={openRecordIn === openRecordInPreference}
+ indicator="check"
+ selected={openRecordIn === openRecordInPreference}
+ >
+ {t(OPEN_RECORD_IN_OPTIONS[openRecordIn].label)}
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownThemesComponents.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownThemesComponents.tsx
index e9f179bc6b2..5a11b117d6f 100644
--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownThemesComponents.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownThemesComponents.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader/DropdownMenuHeader';
import { DropdownMenuHeaderLeftComponent } from '@/ui/layout/dropdown/components/DropdownMenuHeader/internal/DropdownMenuHeaderLeftComponent';
@@ -6,8 +8,7 @@ import { multiWorkspaceDropdownState } from '@/ui/navigation/navigation-drawer/s
import { useColorScheme } from '@/ui/theme/hooks/useColorScheme';
import { useSetAtomState } from '@/ui/utilities/state/jotai/hooks/useSetAtomState';
import { useLingui } from '@lingui/react/macro';
-import { IconCheck, IconChevronLeft } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
+import { IconChevronLeft } from 'twenty-ui/icon';
export const MultiWorkspaceDropdownThemesComponents = () => {
const { t } = useLingui();
@@ -32,19 +33,21 @@ export const MultiWorkspaceDropdownThemesComponents = () => {
</DropdownMenuHeader>
<DropdownMenuItemsContainer>
{colorSchemeList.map((theme) => (
- <MenuItem
+ <ListItem
key={theme.id}
- LeftIcon={theme.icon}
- text={
- theme.id === 'System'
- ? t`System`
- : theme.id === 'Dark'
- ? t`Dark`
- : t`Light`
- }
+ startIcon={<SelectOptionIcon Icon={theme.icon} />}
onClick={() => setColorScheme(theme.id)}
- RightIcon={theme.id === colorScheme ? IconCheck : undefined}
- />
+ role="option"
+ aria-selected={theme.id === colorScheme}
+ indicator="check"
+ selected={theme.id === colorScheme}
+ >
+ {theme.id === 'System'
+ ? t`System`
+ : theme.id === 'Dark'
+ ? t`Dark`
+ : t`Light`}
+ </ListItem>
))}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/__stories__/MultiWorkspaceDropdownThemesComponents.stories.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/__stories__/MultiWorkspaceDropdownThemesComponents.stories.tsx
new file mode 100644
index 00000000000..fdb67f62458
--- /dev/null
+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/__stories__/MultiWorkspaceDropdownThemesComponents.stories.tsx
@@ -0,0 +1,90 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { graphql, HttpResponse } from 'msw';
+import { expect, fn, userEvent, waitFor, within } from 'storybook/test';
+import { Button } from 'twenty-ui/primitives/input';
+import { ComponentDecorator } from 'twenty-ui/testing';
+
+import { currentWorkspaceMemberState } from '@/auth/states/currentWorkspaceMemberState';
+import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
+import { MultiWorkspaceDropdownThemesComponents } from '@/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/MultiWorkspaceDropdownThemesComponents';
+import { persistedColorSchemeState } from '@/ui/theme/states/persistedColorSchemeState';
+import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
+import { ToastDecorator } from '~/testing/decorators/ToastDecorator';
+import { mockedWorkspaceMemberData } from '~/testing/mock-data/users';
+
+const updateWorkspaceMemberSettings = fn();
+
+const ThemeDropdown = ({ onParentClick }: { onParentClick: () => void }) => (
+ <div onClick={onParentClick}>
+ <Dropdown
+ dropdownId="workspace-theme-story"
+ clickableComponent={<Button>Choose theme</Button>}
+ dropdownComponents={<MultiWorkspaceDropdownThemesComponents />}
+ />
+ </div>
+);
+
+const meta: Meta<typeof ThemeDropdown> = {
+ title: 'UI/Navigation/NavigationDrawer/MultiWorkspaceDropdown/Themes',
+ component: ThemeDropdown,
+ decorators: [ComponentDecorator, ToastDecorator],
+ args: {
+ onParentClick: fn(),
+ },
+ beforeEach: () => {
+ updateWorkspaceMemberSettings.mockClear();
+ jotaiStore.set(currentWorkspaceMemberState.atom, {
+ ...mockedWorkspaceMemberData,
+ colorScheme: 'Dark',
+ });
+ jotaiStore.set(persistedColorSchemeState.atom, 'Dark');
+ },
+ parameters: {
+ msw: {
+ handlers: [
+ graphql.mutation('UpdateWorkspaceMemberSettings', ({ variables }) => {
+ updateWorkspaceMemberSettings(variables.input);
+
+ return HttpResponse.json({
+ data: { updateWorkspaceMemberSettings: true },
+ });
+ }),
+ ],
+ },
+ },
+};
+
+export default meta;
+type Story = StoryObj<typeof ThemeDropdown>;
+
+export const SelectThemeWithoutClosing: Story = {
+ play: async ({ canvasElement, args }) => {
+ const canvas = within(canvasElement.ownerDocument.body);
+
+ await userEvent.click(canvas.getByText('Choose theme'));
+
+ expect(
+ await canvas.findByRole('option', { name: 'Dark', selected: true }),
+ ).toBeVisible();
+ expect(
+ canvas.getByRole('option', { name: 'Light', selected: false }),
+ ).toBeVisible();
+
+ await userEvent.click(canvas.getByRole('option', { name: 'Light' }));
+
+ await waitFor(() => {
+ expect(updateWorkspaceMemberSettings).toHaveBeenCalledTimes(1);
+ expect(updateWorkspaceMemberSettings).toHaveBeenCalledWith({
+ workspaceMemberId: mockedWorkspaceMemberData.id,
+ update: { colorScheme: 'Light' },
+ });
+ });
+ expect(args.onParentClick).not.toHaveBeenCalled();
+ expect(
+ canvas.getByRole('option', { name: 'Light', selected: true }),
+ ).toBeVisible();
+ expect(
+ canvas.getByRole('option', { name: 'Dark', selected: false }),
+ ).toBeVisible();
+ },
+};
diff --git a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/components/AvailableWorkspaceItem.tsx b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/components/AvailableWorkspaceItem.tsx
index df87ed55fbb..b13b066cd4b 100644
--- a/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/components/AvailableWorkspaceItem.tsx
+++ b/packages/twenty-front/src/modules/ui/navigation/navigation-drawer/components/MultiWorkspaceDropdown/internal/components/AvailableWorkspaceItem.tsx
@@ -1,4 +1,3 @@
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { Avatar } from 'twenty-ui/primitives/data-display';
import { UndecoratedLink, ListItem } from 'twenty-ui/primitives/navigation';
import { DEFAULT_WORKSPACE_LOGO } from '@/ui/navigation/navigation-drawer/constants/DefaultWorkspaceLogo';
@@ -60,9 +59,7 @@ export const AvailableWorkspaceItem = ({
/>
}
>
- <OverflowingTextWithTooltip
- text={availableWorkspace.displayName ?? t`(No name)`}
- />
+ {availableWorkspace.displayName ?? t`(No name)`}
</ListItem>
</UndecoratedLink>
);
diff --git a/packages/twenty-front/src/modules/views/components/UpdateViewButtonGroup.tsx b/packages/twenty-front/src/modules/views/components/UpdateViewButtonGroup.tsx
index 6757ba0d431..c334cda2517 100644
--- a/packages/twenty-front/src/modules/views/components/UpdateViewButtonGroup.tsx
+++ b/packages/twenty-front/src/modules/views/components/UpdateViewButtonGroup.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { styled } from '@linaria/react';
import { contextStoreCurrentViewIdComponentState } from '@/context-store/states/contextStoreCurrentViewIdComponentState';
@@ -25,7 +26,6 @@ import { t } from '@lingui/core/macro';
import { IconChevronDown, IconPlus } from 'twenty-ui/icon';
import { Button, ButtonGroup } from 'twenty-ui/primitives/input';
import { IconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const StyledContainer = styled.div`
@@ -126,11 +126,10 @@ export const UpdateViewButtonGroup = () => {
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
+ <ListItem
onClick={handleCreateViewClick}
- LeftIcon={IconPlus}
- text={t`Create view`}
- />
+ startIcon={<IconPlus />}
+ >{t`Create view`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownAdvancedFilterButton.tsx b/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownAdvancedFilterButton.tsx
index 6569d0bfafb..9c9b511158e 100644
--- a/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownAdvancedFilterButton.tsx
+++ b/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownAdvancedFilterButton.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useObjectMetadataItemById } from '@/object-metadata/hooks/useObjectMetadataItemById';
import { availableFieldMetadataItemsForFilterFamilySelector } from '@/object-metadata/states/availableFieldMetadataItemsForFilterFamilySelector';
import { useUpsertRecordFilterGroup } from '@/object-record/record-filter-group/hooks/useUpsertRecordFilterGroup';
@@ -26,7 +27,6 @@ import { RecordFilterGroupLogicalOperator } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { Pill } from 'twenty-ui/primitives/data-display';
import { IconFilter } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { v4 } from 'uuid';
@@ -145,19 +145,18 @@ export const ViewBarFilterDropdownAdvancedFilterButton = () => {
itemId={VIEW_BAR_FILTER_BOTTOM_MENU_ITEM_IDS.ADVANCED_FILTER}
onEnter={handleClick}
>
- <MenuItem
- text={t`Advanced filter`}
+ <ListItem
onClick={handleClick}
- LeftIcon={IconFilter}
+ startIcon={<IconFilter />}
focused={isSelectedItemId}
- RightComponent={
+ endIcon={
advancedFilterQuerySubFilterCount > 0 ? (
<StyledPillContainer>
<Pill label={advancedFilterQuerySubFilterCount.toString()} />
</StyledPillContainer>
) : undefined
}
- />
+ >{t`Advanced filter`}</ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownAnyFieldSearchButtonMenuItem.tsx b/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownAnyFieldSearchButtonMenuItem.tsx
index 853e5b8e0e9..8889b20c23c 100644
--- a/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownAnyFieldSearchButtonMenuItem.tsx
+++ b/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownAnyFieldSearchButtonMenuItem.tsx
@@ -1,22 +1,15 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
import { isSelectedItemIdComponentFamilyState } from '@/ui/layout/selectable-list/states/isSelectedItemIdComponentFamilyState';
import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
-import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { IconSearch } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
-import { themeCssVariables } from 'twenty-ui/theme-constants';
import { VIEW_BAR_FILTER_BOTTOM_MENU_ITEM_IDS } from '@/views/constants/ViewBarFilterBottomMenuItemIds';
import { objectFilterDropdownSearchInputComponentState } from '@/object-record/object-filter-dropdown/states/objectFilterDropdownSearchInputComponentState';
-const StyledSearchText = styled.span`
- color: ${themeCssVariables.font.color.light};
- margin-left: ${themeCssVariables.spacing[1]};
-`;
-
type ViewBarFilterDropdownAnyFieldSearchButtonMenuItemProps = {
onClick?: () => void;
};
@@ -40,19 +33,12 @@ export const ViewBarFilterDropdownAnyFieldSearchButtonMenuItem = ({
itemId={VIEW_BAR_FILTER_BOTTOM_MENU_ITEM_IDS.SEARCH}
onEnter={onClick}
>
- <MenuItem
+ <ListItem
focused={isSelectedItemId}
onClick={onClick}
- LeftIcon={IconSearch}
- text={
- <>
- {t`Search any field`}
- {objectFilterDropdownSearchInput && (
- <StyledSearchText>{t`· ${objectFilterDropdownSearchInput}`}</StyledSearchText>
- )}
- </>
- }
- />
+ startIcon={<IconSearch />}
+ description={objectFilterDropdownSearchInput}
+ >{t`Search any field`}</ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownFieldSelectMenuItem.tsx b/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownFieldSelectMenuItem.tsx
index 3704aa4df79..7f55858674c 100644
--- a/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownFieldSelectMenuItem.tsx
+++ b/packages/twenty-front/src/modules/views/components/ViewBarFilterDropdownFieldSelectMenuItem.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
import { useSelectableList } from '@/ui/layout/selectable-list/hooks/useSelectableList';
@@ -5,7 +7,6 @@ import { isSelectedItemIdComponentFamilyState } from '@/ui/layout/selectable-lis
import { useAtomComponentFamilyStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentFamilyStateValue';
import { useInitializeFilterOnFieldMetadataItemFromViewBarFilterDropdown } from '@/views/hooks/useInitializeFilterOnFieldMetadataItemFromViewBarFilterDropdown';
import { useIcons } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
export type ViewBarFilterDropdownFieldSelectMenuItemProps = {
fieldMetadataItemToSelect: FieldMetadataItem;
@@ -41,12 +42,13 @@ export const ViewBarFilterDropdownFieldSelectMenuItem = ({
itemId={fieldMetadataItemToSelect.id}
onEnter={handleClick}
>
- <MenuItem
+ <ListItem
focused={isSelectedItemId}
onClick={handleClick}
- LeftIcon={Icon}
- text={fieldMetadataItemToSelect.label}
- />
+ startIcon={<SelectOptionIcon Icon={Icon} />}
+ >
+ {fieldMetadataItemToSelect.label}
+ </ListItem>
</SelectableListItem>
);
};
diff --git a/packages/twenty-front/src/modules/views/components/ViewFieldsHiddenDropdownSection.tsx b/packages/twenty-front/src/modules/views/components/ViewFieldsHiddenDropdownSection.tsx
index 5b3d6ac615b..943cae27994 100644
--- a/packages/twenty-front/src/modules/views/components/ViewFieldsHiddenDropdownSection.tsx
+++ b/packages/twenty-front/src/modules/views/components/ViewFieldsHiddenDropdownSection.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { t } from '@lingui/core/macro';
import { LightIconButton } from 'twenty-ui/components';
import { useActiveFieldMetadataItems } from '@/object-metadata/hooks/useActiveFieldMetadataItems';
@@ -10,7 +12,6 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/use
import { ViewType } from '@/views/types/ViewType';
import { useContext } from 'react';
import { IconEye, useIcons } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
export const ViewFieldsHiddenDropdownSection = () => {
const { viewType, objectMetadataItem, recordIndexId } = useContext(
@@ -58,10 +59,12 @@ export const ViewFieldsHiddenDropdownSection = () => {
{availableFieldMetadataItemsToShow.length > 0 &&
availableFieldMetadataItemsToShow.map((fieldMetadataItem) => {
return (
- <MenuItem
+ <ListItem
key={fieldMetadataItem.id}
- LeftIcon={getIcon(fieldMetadataItem.icon)}
- iconButtons={
+ startIcon={
+ <SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
+ }
+ actions={
<LightIconButton
aria-label={t`Show field`}
onClick={() =>
@@ -74,8 +77,9 @@ export const ViewFieldsHiddenDropdownSection = () => {
<IconEye />
</LightIconButton>
}
- text={fieldMetadataItem.label}
- />
+ >
+ {fieldMetadataItem.label}
+ </ListItem>
);
})}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/views/components/ViewFieldsSearchDropdownSection.tsx b/packages/twenty-front/src/modules/views/components/ViewFieldsSearchDropdownSection.tsx
index 0e7558900c3..b09d1450c76 100644
--- a/packages/twenty-front/src/modules/views/components/ViewFieldsSearchDropdownSection.tsx
+++ b/packages/twenty-front/src/modules/views/components/ViewFieldsSearchDropdownSection.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { LightIconButton } from 'twenty-ui/components';
import { useActiveFieldMetadataItems } from '@/object-metadata/hooks/useActiveFieldMetadataItems';
import { getLabelIdentifierFieldMetadataItem } from '@/object-metadata/utils/getLabelIdentifierFieldMetadataItem';
@@ -11,7 +13,6 @@ import { ViewType } from '@/views/types/ViewType';
import { useLingui } from '@lingui/react/macro';
import { useContext } from 'react';
import { IconEye, IconEyeOff, useIcons } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type ViewFieldsSearchDropdownSectionProps = {
searchInput: string;
@@ -73,10 +74,12 @@ export const ViewFieldsSearchDropdownSection = ({
fieldMetadataItem.id === fieldMetadataItemLabelIdentifier?.id;
return (
- <MenuItem
+ <ListItem
key={fieldMetadataItem.id}
- LeftIcon={getIcon(fieldMetadataItem.icon)}
- iconButtons={
+ startIcon={
+ <SelectOptionIcon Icon={getIcon(fieldMetadataItem.icon)} />
+ }
+ actions={
isLabelIdentifier ? undefined : (
<LightIconButton
aria-label={isVisible ? t`Hide field` : t`Show field`}
@@ -91,12 +94,13 @@ export const ViewFieldsSearchDropdownSection = ({
</LightIconButton>
)
}
- text={fieldMetadataItem.label}
- />
+ >
+ {fieldMetadataItem.label}
+ </ListItem>
);
})
) : (
- <MenuItem disabled text={t`No results`} accent="placeholder" />
+ <ListItem disabled>{t`No results`}</ListItem>
)}
</DropdownMenuItemsContainer>
);
diff --git a/packages/twenty-front/src/modules/views/editable-chip/components/EditableSortChip.tsx b/packages/twenty-front/src/modules/views/editable-chip/components/EditableSortChip.tsx
index b1e9b289b0d..9d373193211 100644
--- a/packages/twenty-front/src/modules/views/editable-chip/components/EditableSortChip.tsx
+++ b/packages/twenty-front/src/modules/views/editable-chip/components/EditableSortChip.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { useFieldMetadataItemByIdOrThrow } from '@/object-metadata/hooks/useFieldMetadataItemByIdOrThrow';
import { useSortSubFieldChoicesForField } from '@/object-metadata/hooks/useSortSubFieldChoicesForField';
import { useRemoveRecordSort } from '@/object-record/record-sort/hooks/useRemoveRecordSort';
@@ -107,9 +106,7 @@ export const EditableSortChip = ({ recordSort }: EditableSortChipProps) => {
selected={recordSort.direction === ViewSortDirection.ASC}
indicator="check"
startIcon={<SelectOptionIcon Icon={IconArrowUp} />}
- >
- <OverflowingTextWithTooltip text={t`Ascending`} />
- </ListItem>
+ >{t`Ascending`}</ListItem>
<ListItem
onClick={() => handleDirectionSelect(ViewSortDirection.DESC)}
role="option"
@@ -117,9 +114,7 @@ export const EditableSortChip = ({ recordSort }: EditableSortChipProps) => {
selected={recordSort.direction === ViewSortDirection.DESC}
indicator="check"
startIcon={<SelectOptionIcon Icon={IconArrowDown} />}
- >
- <OverflowingTextWithTooltip text={t`Descending`} />
- </ListItem>
+ >{t`Descending`}</ListItem>
</DropdownMenuItemsContainer>
<DropdownMenuSeparator />
<DropdownMenuItemsContainer>
@@ -132,7 +127,7 @@ export const EditableSortChip = ({ recordSort }: EditableSortChipProps) => {
selected={option.value === subFieldChoices.selectedValue}
indicator="check"
>
- <OverflowingTextWithTooltip text={option.label} />
+ {option.label}
</ListItem>
))}
</DropdownMenuItemsContainer>
diff --git a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerListContent.tsx b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerListContent.tsx
index 369296a9b62..88af52779c1 100644
--- a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerListContent.tsx
+++ b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerListContent.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { styled } from '@linaria/react';
import { type DraggableListDropResult } from '@/ui/layout/draggable-list/types/DraggableListDropResult';
import { type MouseEvent, useCallback } from 'react';
@@ -24,7 +25,6 @@ import { computeViewPickerVisibleViews } from '@/views/view-picker/utils/compute
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { useLingui } from '@lingui/react/macro';
import { IconPlus } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { FeatureFlagKey, ViewVisibility } from '~/generated-metadata/graphql';
import { moveArrayItem } from '~/utils/array/moveArrayItem';
@@ -219,11 +219,10 @@ export const ViewPickerListContent = () => {
<DropdownMenuSeparator />
<StyledBoldDropdownMenuItemsContainerWrapper>
<DropdownMenuItemsContainer scrollable={false}>
- <MenuItem
+ <ListItem
onClick={handleAddViewButtonClick}
- LeftIcon={IconPlus}
- text={t`Add view`}
- />
+ startIcon={<IconPlus />}
+ >{t`Add view`}</ListItem>
</DropdownMenuItemsContainer>
</StyledBoldDropdownMenuItemsContainerWrapper>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerOptionDropdown.tsx b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerOptionDropdown.tsx
index ae112a80182..87184a06fb5 100644
--- a/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerOptionDropdown.tsx
+++ b/packages/twenty-front/src/modules/views/view-picker/components/ViewPickerOptionDropdown.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useCreateManyNavigationMenuItems } from '@/navigation-menu-item/common/hooks/useCreateManyNavigationMenuItems';
import { useDeleteManyNavigationMenuItems } from '@/navigation-menu-item/common/hooks/useDeleteManyNavigationMenuItems';
import { useNavigationMenuItemsData } from '@/navigation-menu-item/display/hooks/useNavigationMenuItemsData';
@@ -22,7 +23,6 @@ import {
IconTrash,
useIcons,
} from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import {
PermissionFlagType,
ViewVisibility,
@@ -133,28 +133,27 @@ export const ViewPickerOptionDropdown = ({
dropdownContent={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={isFavorite ? IconHeartOff : IconHeart}
- text={isFavorite ? t`Remove Favorite` : t`Add to Favorite`}
+ <ListItem
+ startIcon={isFavorite ? <IconHeartOff /> : <IconHeart />}
onClick={handleToggleFavorite}
- />
+ >
+ {isFavorite ? t`Remove Favorite` : t`Add to Favorite`}
+ </ListItem>
{!isIndexView && canEditView && (
<>
- <MenuItem
- LeftIcon={IconPencil}
- text={t`Edit`}
+ <ListItem
+ startIcon={<IconPencil />}
onClick={(event) => {
onEdit(event, view.id);
closeDropdown(dropdownId);
}}
- />
+ >{t`Edit`}</ListItem>
{!isLastView && (
- <MenuItem
- LeftIcon={IconTrash}
- text={t`Delete`}
+ <ListItem
+ startIcon={<IconTrash />}
onClick={handleDelete}
- accent="danger"
- />
+ color="danger"
+ >{t`Delete`}</ListItem>
)}
</>
)}
diff --git a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramRightClickCommandMenu.tsx b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramRightClickCommandMenu.tsx
index 48e39eb932f..72642d74a74 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramRightClickCommandMenu.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-diagram/components/WorkflowDiagramRightClickCommandMenu.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useCloseRightClickMenu } from '@/workflow/workflow-diagram/hooks/useCloseRightClickMenu';
import { useStartNodeCreation } from '@/workflow/workflow-diagram/hooks/useStartNodeCreation';
@@ -9,7 +10,6 @@ import { useLingui } from '@lingui/react/macro';
import { useRef } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconPlus, IconReorder } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { WorkflowDiagramRightClickCommandMenuClickOutsideEffect } from './WorkflowDiagramRightClickCommandMenuClickOutsideEffect';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -71,12 +71,14 @@ export const WorkflowDiagramRightClickCommandMenu = () => {
x={workflowDiagramRightClickMenuPosition.x}
y={workflowDiagramRightClickMenuPosition.y}
>
- <MenuItem text={t`Add node`} LeftIcon={IconPlus} onClick={addNode} />
- <MenuItem
- text={t`Tidy up workflow`}
- LeftIcon={IconReorder}
+ <ListItem
+ startIcon={<IconPlus />}
+ onClick={addNode}
+ >{t`Add node`}</ListItem>
+ <ListItem
+ startIcon={<IconReorder />}
onClick={handleReorderWorkflowDiagram}
- />
+ >{t`Tidy up workflow`}</ListItem>
</StyledContainer>
<WorkflowDiagramRightClickCommandMenuClickOutsideEffect
rightClickCommandMenuRef={rightClickCommandMenuRef}
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowDropdownStepOutputItems.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowDropdownStepOutputItems.tsx
index af575537ae7..fa2286495f9 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowDropdownStepOutputItems.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowDropdownStepOutputItems.tsx
@@ -177,9 +177,7 @@ export const WorkflowDropdownStepOutputItems = ({
/>
}
>
- <OverflowingTextWithTooltip
- text={subStepObjectDisplay?.label ?? ''}
- />
+ {subStepObjectDisplay?.label ?? ''}
</ListItem>
)}
{options.length > 0 && shouldDisplaySubStepObject && (
@@ -217,7 +215,7 @@ export const WorkflowDropdownStepOutputItems = ({
/>
}
>
- <OverflowingTextWithTooltip text={subStep.label || key} />
+ {subStep.label || key}
</ListItem>
);
})}
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepFooter.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepFooter.tsx
index 3ee8b0c1124..16ae4a44f1d 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepFooter.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepFooter.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { useSidePanelWorkflowNavigation } from '@/side-panel/pages/workflow/hooks/useSidePanelWorkflowNavigation';
import { useSidePanelWorkflowIdOrThrow } from '@/side-panel/pages/workflow/hooks/useSidePanelWorkflowIdOrThrow';
import { OptionsDropdownMenu } from '@/ui/layout/dropdown/components/OptionsDropdownMenu';
@@ -19,7 +20,6 @@ import { isDefined } from 'twenty-shared/utils';
import { TRIGGER_STEP_ID } from 'twenty-shared/workflow';
import { IconLego, IconSettings, IconTrash, IconUsers } from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
export const WorkflowStepFooter = ({
@@ -131,35 +131,32 @@ export const WorkflowStepFooter = ({
itemId={WORKFLOW_STEP_OPTIONS_MENU_ITEM_IDS.nodeSettings}
onEnter={handleNodeSettings}
>
- <MenuItem
+ <ListItem
focused={
selectedItemId ===
WORKFLOW_STEP_OPTIONS_MENU_ITEM_IDS.nodeSettings
}
onClick={handleNodeSettings}
- text={t`Node settings`}
- LeftIcon={IconSettings}
- />
+ startIcon={<IconSettings />}
+ >{t`Node settings`}</ListItem>
</SelectableListItem>
) : null}
{hasViewAgentOption ? (
<SelectableListItem itemId="view-agent" onEnter={handleViewAgent}>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'view-agent'}
onClick={handleViewAgent}
- text={t`View Agent`}
- LeftIcon={IconLego}
- />
+ startIcon={<IconLego />}
+ >{t`View Agent`}</ListItem>
</SelectableListItem>
) : null}
{hasViewRoleOption ? (
<SelectableListItem itemId="view-role" onEnter={handleViewRole}>
- <MenuItem
+ <ListItem
focused={selectedItemId === 'view-role'}
onClick={handleViewRole}
- text={t`View Role`}
- LeftIcon={IconUsers}
- />
+ startIcon={<IconUsers />}
+ >{t`View Role`}</ListItem>
</SelectableListItem>
) : null}
</WorkflowStepOptionsMenuItems>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepOptionsMenuItems.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepOptionsMenuItems.tsx
index bbe8dd700a5..0424dcea06c 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepOptionsMenuItems.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/components/WorkflowStepOptionsMenuItems.tsx
@@ -1,10 +1,10 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { SelectableListItem } from '@/ui/layout/selectable-list/components/SelectableListItem';
import { WORKFLOW_STEP_OPTIONS_MENU_ITEM_IDS } from '@/workflow/workflow-steps/constants/WorkflowStepOptionsMenuItemIds';
import { useLingui } from '@lingui/react/macro';
import { type ReactNode } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconCopyPlus, IconPencil, IconTrash } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type WorkflowStepOptionsMenuItemsProps = {
selectedItemId: string | null;
@@ -31,29 +31,29 @@ export const WorkflowStepOptionsMenuItems = ({
itemId={WORKFLOW_STEP_OPTIONS_MENU_ITEM_IDS.changeNode}
onEnter={onChangeNode}
>
- <MenuItem
- LeftIcon={IconPencil}
- text={changeNodeText}
+ <ListItem
+ startIcon={<IconPencil />}
focused={
selectedItemId === WORKFLOW_STEP_OPTIONS_MENU_ITEM_IDS.changeNode
}
onClick={onChangeNode}
- />
+ >
+ {changeNodeText}
+ </ListItem>
</SelectableListItem>
{isDefined(onDuplicateNode) ? (
<SelectableListItem
itemId={WORKFLOW_STEP_OPTIONS_MENU_ITEM_IDS.duplicateNode}
onEnter={onDuplicateNode}
>
- <MenuItem
- LeftIcon={IconCopyPlus}
- text={t`Duplicate node`}
+ <ListItem
+ startIcon={<IconCopyPlus />}
focused={
selectedItemId ===
WORKFLOW_STEP_OPTIONS_MENU_ITEM_IDS.duplicateNode
}
onClick={onDuplicateNode}
- />
+ >{t`Duplicate node`}</ListItem>
</SelectableListItem>
) : null}
{children}
@@ -62,15 +62,14 @@ export const WorkflowStepOptionsMenuItems = ({
itemId={WORKFLOW_STEP_OPTIONS_MENU_ITEM_IDS.deleteNode}
onEnter={onDeleteNode}
>
- <MenuItem
- LeftIcon={IconTrash}
- text={t`Delete node`}
- accent="danger"
+ <ListItem
+ startIcon={<IconTrash />}
+ color="danger"
focused={
selectedItemId === WORKFLOW_STEP_OPTIONS_MENU_ITEM_IDS.deleteNode
}
onClick={onDeleteNode}
- />
+ >{t`Delete node`}</ListItem>
</SelectableListItem>
) : null}
</>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterAddFilterRuleSelect.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterAddFilterRuleSelect.tsx
index 88ef20fc5fc..0104437b711 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterAddFilterRuleSelect.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterAddFilterRuleSelect.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { CommandMenuButton } from '@/command-menu/components/CommandMenuButton';
import { getAdvancedFilterAddFilterRuleSelectDropdownId } from '@/object-record/advanced-filter/utils/getAdvancedFilterAddFilterRuleSelectDropdownId';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
@@ -12,7 +13,6 @@ import { StepLogicalOperator, type StepFilterGroup } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
import { t } from '@lingui/core/macro';
import { IconLibraryPlus, IconPlus } from 'twenty-ui/icon';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { v4 } from 'uuid';
type WorkflowStepFilterAddFilterRuleSelectProps = {
@@ -101,17 +101,15 @@ export const WorkflowStepFilterAddFilterRuleSelect = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconPlus}
- text={t`Add rule`}
+ <ListItem
+ startIcon={<IconPlus />}
onClick={handleAddFilter}
- />
+ >{t`Add rule`}</ListItem>
{isFilterRuleGroupOptionVisible && (
- <MenuItem
- LeftIcon={IconLibraryPlus}
- text={t`Add rule group`}
+ <ListItem
+ startIcon={<IconLibraryPlus />}
onClick={handleAddFilterGroup}
- />
+ >{t`Add rule group`}</ListItem>
)}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterGroupOptionsDropdown.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterGroupOptionsDropdown.tsx
index 257b7dcc955..f40a9ae73cf 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterGroupOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterGroupOptionsDropdown.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { DEFAULT_ADVANCED_FILTER_DROPDOWN_OFFSET } from '@/object-record/advanced-filter/constants/DefaultAdvancedFilterDropdownOffset';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
@@ -8,7 +9,6 @@ import { useContext } from 'react';
import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { IconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type WorkflowStepFilterGroupOptionsDropdownProps = {
stepFilterGroupId: string;
@@ -36,12 +36,11 @@ export const WorkflowStepFilterGroupOptionsDropdown = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconTrash}
- text={t`Delete group`}
+ <ListItem
+ startIcon={<IconTrash />}
onClick={() => removeStepFilterGroup(stepFilterGroupId)}
- accent="danger"
- />
+ color="danger"
+ >{t`Delete group`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterOptionsDropdown.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterOptionsDropdown.tsx
index d3836c4d3a6..723c06a71ec 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterOptionsDropdown.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/filters/components/WorkflowStepFilterOptionsDropdown.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { DEFAULT_ADVANCED_FILTER_DROPDOWN_OFFSET } from '@/object-record/advanced-filter/constants/DefaultAdvancedFilterDropdownOffset';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
@@ -8,7 +9,6 @@ import { useContext } from 'react';
import { t } from '@lingui/core/macro';
import { IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { IconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type WorkflowStepFilterOptionsDropdownProps = {
stepFilterId: string;
@@ -36,12 +36,11 @@ export const WorkflowStepFilterOptionsDropdown = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconTrash}
- text={t`Delete`}
+ <ListItem
+ startIcon={<IconTrash />}
onClick={() => removeStepFilter(stepFilterId)}
- accent="danger"
- />
+ color="danger"
+ >{t`Delete`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowOutputSchemaBuilder.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowOutputSchemaBuilder.tsx
index 5e0b7076944..0d37fe7867e 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowOutputSchemaBuilder.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/ai-agent-action/components/WorkflowOutputSchemaBuilder.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { FormFieldInputContainer } from '@/ui/input/components/FormFieldInputContainer';
import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/components/FormTextFieldInput';
@@ -11,7 +12,6 @@ import { isNonEmptyString } from '@sniptt/guards';
import { isValidAgentResponseSchemaPropertyKey } from 'twenty-shared/ai';
import { IconPlus } from 'twenty-ui/icon';
import { AnimatedExpandableContainer } from 'twenty-ui/primitives/layout';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { WorkflowOutputFieldTypeSelector } from './WorkflowOutputFieldTypeSelector';
import { WorkflowOutputSchemaFieldHeader } from './WorkflowOutputSchemaFieldHeader';
@@ -215,11 +215,10 @@ export const WorkflowOutputSchemaBuilder = ({
{!readonly && (
<StyledAddFieldButtonContainer>
- <MenuItem
- LeftIcon={IconPlus}
- text={t`Add Output Field`}
+ <ListItem
+ startIcon={<IconPlus />}
onClick={addField}
- />
+ >{t`Add Output Field`}</ListItem>
</StyledAddFieldButtonContainer>
)}
</StyledOutputSchemaContainer>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionEmailBase.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionEmailBase.tsx
index e6a5b09823d..fa544e44dd2 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionEmailBase.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/components/WorkflowEditActionEmailBase.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { type ConnectedAccount } from '@/accounts/types/ConnectedAccount';
import { buildConnectedAccountSenderOptions } from '@/accounts/utils/buildConnectedAccountSenderOptions';
import { getMissingDraftEmailScopes } from '@/accounts/utils/hasMissingDraftEmailScopes';
@@ -43,7 +44,6 @@ import { Callout } from 'twenty-ui/primitives/feedback';
import { IconPlus } from 'twenty-ui/icon';
import { isNonEmptyString } from '@sniptt/guards';
import { Button } from 'twenty-ui/primitives/input';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { useNavigateSettings } from '~/hooks/useNavigateSettings';
type WorkflowEditActionEmailBaseProps = {
@@ -331,8 +331,7 @@ export const WorkflowEditActionEmailBase = ({
>
<DropdownMenuItemsContainer>
{!visibleAdvancedFields.cc && (
- <MenuItem
- text={t`Add CC`}
+ <ListItem
onClick={() => {
setVisibleAdvancedFields((prev) => ({
...prev,
@@ -340,11 +339,10 @@ export const WorkflowEditActionEmailBase = ({
}));
closeDropdown(advancedOptionsDropdownId);
}}
- />
+ >{t`Add CC`}</ListItem>
)}
{!visibleAdvancedFields.bcc && (
- <MenuItem
- text={t`Add BCC`}
+ <ListItem
onClick={() => {
setVisibleAdvancedFields((prev) => ({
...prev,
@@ -352,11 +350,10 @@ export const WorkflowEditActionEmailBase = ({
}));
closeDropdown(advancedOptionsDropdownId);
}}
- />
+ >{t`Add BCC`}</ListItem>
)}
{!visibleAdvancedFields.inReplyTo && (
- <MenuItem
- text={t`Add In-Reply-To`}
+ <ListItem
onClick={() => {
setVisibleAdvancedFields((prev) => ({
...prev,
@@ -364,7 +361,7 @@ export const WorkflowEditActionEmailBase = ({
}));
closeDropdown(advancedOptionsDropdownId);
}}
- />
+ >{t`Add In-Reply-To`}</ListItem>
)}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowObjectDropdownContent.tsx b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowObjectDropdownContent.tsx
index c32ed53850e..8b58da11ddb 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowObjectDropdownContent.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-steps/workflow-actions/find-records-action/components/WorkflowObjectDropdownContent.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { ObjectMetadataIcon } from '@/object-metadata/components/ObjectMetadataIcon';
import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
@@ -10,7 +11,6 @@ import { SelectableListItem } from '@/ui/layout/selectable-list/components/Selec
import { selectedItemIdComponentState } from '@/ui/layout/selectable-list/states/selectedItemIdComponentState';
import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomComponentStateValue';
import { useState } from 'react';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type WorkflowObjectDropdownContentProps = {
dropdownId: string;
@@ -104,14 +104,15 @@ export const WorkflowObjectDropdownContent = ({
itemId={objectMetadataItem.nameSingular}
onEnter={() => onOptionClick(objectMetadataItem.nameSingular)}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === objectMetadataItem.nameSingular}
- LeftIcon={() => (
+ startIcon={
<ObjectMetadataIcon objectMetadataItem={objectMetadataItem} />
- )}
- text={objectMetadataItem.labelPlural}
+ }
onClick={() => onOptionClick(objectMetadataItem.nameSingular)}
- />
+ >
+ {objectMetadataItem.labelPlural}
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx
index f3939e5e58a..511909ce6d5 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-trigger/components/WorkflowEditTriggerDatabaseEventForm.tsx
@@ -1,3 +1,5 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
+import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { useFilteredObjectMetadataItems } from '@/object-metadata/hooks/useFilteredObjectMetadataItems';
import { useObjectMetadataSelectHelpers } from '@/object-metadata/hooks/useObjectMetadataSelectHelpers';
import { type FieldMultiSelectValue } from '@/object-record/record-field/ui/types/FieldMetadata';
@@ -26,7 +28,6 @@ import { useMemo, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { TRIGGER_STEP_ID } from 'twenty-shared/workflow';
import { type SelectOption } from 'twenty-ui/primitives/input';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
const StyledLabel = styled.span`
@@ -242,12 +243,15 @@ export const WorkflowEditTriggerDatabaseEventForm = ({
itemId={option.value}
onEnter={() => handleOptionClick(option.value)}
>
- <MenuItem
+ <ListItem
focused={selectedItemId === option.value}
- LeftIcon={option.Icon}
- text={option.label}
+ startIcon={
+ <SelectOptionIcon Icon={option.Icon} />
+ }
onClick={() => handleOptionClick(option.value)}
- />
+ >
+ {option.label}
+ </ListItem>
</SelectableListItem>
))}
</SelectableList>
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariableSearchResultItems.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariableSearchResultItems.tsx
index f61900e2bee..af5d09bddcf 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariableSearchResultItems.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariableSearchResultItems.tsx
@@ -1,5 +1,4 @@
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
-import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
import { type WorkflowVariableSearchResult } from '@/workflow/workflow-variables/types/WorkflowVariableSearchResult';
import { useIcons } from 'twenty-ui/icon';
import { ListItem } from 'twenty-ui/primitives/navigation';
@@ -38,7 +37,7 @@ export const WorkflowVariableSearchResultItems = ({
/>
}
>
- <OverflowingTextWithTooltip text={result.label} />
+ {result.label}
</ListItem>
));
};
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownStepItems.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownStepItems.tsx
index 6aa12beec29..828f7063ad7 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownStepItems.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownStepItems.tsx
@@ -171,7 +171,7 @@ export const WorkflowVariablesDropdownStepItems = ({
<SelectOptionIcon Icon={getIcon(specialItem.iconName)} />
}
>
- <OverflowingTextWithTooltip text={specialItem.label} />
+ {specialItem.label}
</ListItem>
))}
{shouldDisplaySubStepObject && (
@@ -191,9 +191,7 @@ export const WorkflowVariablesDropdownStepItems = ({
/>
}
>
- <OverflowingTextWithTooltip
- text={displayedSubStepObjectDisplay?.label ?? ''}
- />
+ {displayedSubStepObjectDisplay?.label ?? ''}
</ListItem>
)}
{options.length > 0 &&
@@ -232,7 +230,7 @@ export const WorkflowVariablesDropdownStepItems = ({
/>
}
>
- <OverflowingTextWithTooltip text={subStep.label || key} />
+ {subStep.label || key}
</ListItem>
);
})}
diff --git a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownSteps.tsx b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownSteps.tsx
index ea43adc6e27..51ee1137dfe 100644
--- a/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownSteps.tsx
+++ b/packages/twenty-front/src/modules/workflow/workflow-variables/components/WorkflowVariablesDropdownSteps.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { SelectOptionIcon } from '@/ui/input/components/SelectOptionIcon';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuHeader } from '@/ui/layout/dropdown/components/DropdownMenuHeader/DropdownMenuHeader';
@@ -21,7 +22,6 @@ import { t } from '@lingui/core/macro';
import { useState } from 'react';
import { IconX, useIcons } from 'twenty-ui/icon';
import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/surfaces';
-import { MenuItem, ListItem } from 'twenty-ui/primitives/navigation';
type WorkflowVariablesDropdownStepsProps = {
dropdownId: string;
@@ -106,24 +106,18 @@ export const WorkflowVariablesDropdownSteps = ({
aria-selected={false}
selected={false}
indicator="check"
- hasSubmenu={true}
+ hasSubmenu
startIcon={
<SelectOptionIcon
Icon={item.icon ? getIcon(item.icon) : undefined}
/>
}
>
- <OverflowingTextWithTooltip text={item.name} />
+ {item.name}
</ListItem>
))}
{matchingVariables.length === 0 && availableSteps.length === 0 && (
- <MenuItem
- key="no-steps"
- onClick={() => {}}
- text={t`No variables available`}
- LeftIcon={undefined}
- hasSubMenu={false}
- />
+ <ListItem disabled>{t`No variables available`}</ListItem>
)}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentEvalsTab.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentEvalsTab.tsx
index 18d4e7e05cd..fe2e116e408 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentEvalsTab.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsAgentEvalsTab.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { RUN_EVALUATION_INPUT } from '@/ai/graphql/mutations/runEvaluationInput';
import { GET_AGENT_TURNS } from '@/ai/graphql/queries/getAgentTurns';
import { SettingsListCard } from '@/settings/components/SettingsListCard';
@@ -26,7 +27,6 @@ import {
} from 'twenty-ui/icon';
import { Button } from 'twenty-ui/primitives/input';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { v4 as uuidv4 } from 'uuid';
import { SETTINGS_AGENT_DETAIL_TABS } from '~/pages/settings/ai/constants/SettingsAgentDetailTabs';
@@ -177,17 +177,15 @@ export const SettingsAgentEvalsTab = ({
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconPlayerPlay}
- text={t`Run`}
+ <ListItem
+ startIcon={<IconPlayerPlay />}
onClick={() => handleRunInput(item.text, item.id)}
- />
- <MenuItem
- accent="danger"
- LeftIcon={IconTrash}
- text={t`Delete`}
+ >{t`Run`}</ListItem>
+ <ListItem
+ color="danger"
+ startIcon={<IconTrash />}
onClick={() => openDeleteModal(item.id)}
- />
+ >{t`Delete`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillInactiveMenuDropDown.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillInactiveMenuDropDown.tsx
index 77a904fbaf1..1d79ed481f5 100644
--- a/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillInactiveMenuDropDown.tsx
+++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsSkillInactiveMenuDropDown.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
@@ -6,7 +7,6 @@ import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
import { t } from '@lingui/core/macro';
import { IconArchiveOff, IconDotsVertical, IconTrash } from 'twenty-ui/icon';
import { LightIconButton } from 'twenty-ui/components';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
type SettingsSkillInactiveMenuDropDownProps = {
isCustomSkill: boolean;
@@ -49,18 +49,16 @@ export const SettingsSkillInactiveMenuDropDown = ({
dropdownComponents={
<DropdownContent widthInPixels={GenericDropdownContentWidth.Narrow}>
<DropdownMenuItemsContainer>
- <MenuItem
- text={t`Activate`}
- LeftIcon={IconArchiveOff}
+ <ListItem
+ startIcon={<IconArchiveOff />}
onClick={handleActivate}
- />
+ >{t`Activate`}</ListItem>
{isCustomSkill && (
- <MenuItem
- text={t`Delete`}
- LeftIcon={IconTrash}
- accent="danger"
+ <ListItem
+ startIcon={<IconTrash />}
+ color="danger"
onClick={handleDelete}
- />
+ >{t`Delete`}</ListItem>
)}
</DropdownMenuItemsContainer>
</DropdownContent>
diff --git a/packages/twenty-front/src/pages/settings/members/tabs/SettingsWorkspaceMembersTeamTab.tsx b/packages/twenty-front/src/pages/settings/members/tabs/SettingsWorkspaceMembersTeamTab.tsx
index 71cdd0481ef..f891964e2ba 100644
--- a/packages/twenty-front/src/pages/settings/members/tabs/SettingsWorkspaceMembersTeamTab.tsx
+++ b/packages/twenty-front/src/pages/settings/members/tabs/SettingsWorkspaceMembersTeamTab.tsx
@@ -1,3 +1,4 @@
+import { ListItem } from 'twenty-ui/primitives/navigation';
import { TooltipDelay } from '@/ui/layout/tooltip/constants/TooltipDelay';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { styled } from '@linaria/react';
@@ -31,7 +32,6 @@ import {
} from 'twenty-ui/icon';
import { Tooltip } from 'twenty-ui/primitives/surfaces';
import { Button, SearchInput } from 'twenty-ui/primitives/input';
-import { MenuItem } from 'twenty-ui/primitives/navigation';
import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableRow } from '@/ui/layout/table/components/TableRow';
@@ -189,26 +189,24 @@ export const SettingsWorkspaceMembersTeamTab = () => {
dropdownComponents={
<DropdownContent>
<DropdownMenuItemsContainer>
- <MenuItem
- LeftIcon={IconListDetails}
- text={t`See records`}
+ <ListItem
+ startIcon={<IconListDetails />}
onClick={() => {
navigateApp(AppPath.RecordIndexPage, {
objectNamePlural: 'workspaceMembers',
});
closeDropdown('workspace-members-open-dropdown');
}}
- />
- <MenuItem
- LeftIcon={IconHierarchy}
- text={t`See data model settings`}
+ >{t`See records`}</ListItem>
+ <ListItem
+ startIcon={<IconHierarchy />}
onClick={() => {
navigateSettings(SettingsPath.ObjectDetail, {
objectNamePlural: 'workspaceMembers',
});
closeDropdown('workspace-members-open-dropdown');
}}
- />
+ >{t`See data model settings`}</ListItem>
</DropdownMenuItemsContainer>
</DropdownContent>
}
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.module.scss b/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.module.scss
index fda1d36465a..275d7f3ccec 100644
--- a/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.module.scss
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.module.scss
@@ -49,6 +49,12 @@
cursor: default;
transition: none;
+
+ // Hidden rather than removed so a disabled row keeps the same trailing
+ // width as its enabled siblings in the same menu.
+ .submenuIcon {
+ visibility: hidden;
+ }
}
}
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.tsx
index aa8c367af55..55009448f53 100644
--- a/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.tsx
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/ListItem.tsx
@@ -1,10 +1,12 @@
import { useRender } from '@base-ui/react/use-render';
-import { isNonEmptyArray } from '@sniptt/guards';
+import { isNonEmptyArray, isString } from '@sniptt/guards';
import { clsx } from 'clsx';
import { type MouseEvent } from 'react';
import { IconCheck, IconChevronRight } from '@ui/icon';
import { MenuItemHotKeys } from '@ui/primitives/navigation/MenuItemHotKeys/MenuItemHotKeys';
+import { OverflowingTextWithTooltip } from '@ui/primitives/surfaces/OverflowingTextWithTooltip/OverflowingTextWithTooltip';
+import { isDefined } from '@ui/utilities/utils/isDefined';
import { isRenderableSlot } from './internal/isRenderableSlot';
import { ListItemCheckboxIndicator } from './internal/ListItemCheckboxIndicator';
@@ -39,7 +41,12 @@ export const ListItem = ({
return;
}
- onClick?.(event);
+ if (!isDefined(onClick)) {
+ return;
+ }
+
+ event.stopPropagation();
+ onClick(event);
};
return useRender({
@@ -60,7 +67,13 @@ export const ListItem = ({
<span className={styles.startIcon}>{startIcon}</span>
)}
<span className={styles.label}>
- <span className={styles.text}>{children}</span>
+ <span className={styles.text}>
+ {isString(children) ? (
+ <OverflowingTextWithTooltip text={children} />
+ ) : (
+ children
+ )}
+ </span>
{hasDescription && descriptionPlacement === 'inline' && (
<span
className={clsx(styles.description, styles.inlineDescription)}
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItem.stories.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItem.stories.tsx
index a701fd66dbe..6ad065702af 100644
--- a/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItem.stories.tsx
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/__stories__/ListItem.stories.tsx
@@ -1,5 +1,6 @@
import { type Meta, type StoryObj } from '@storybook/react-vite';
import { action } from 'storybook/actions';
+import { expect, userEvent, within } from 'storybook/test';
import {
A11Y_DEFER_COLOR_CONTRAST,
@@ -44,6 +45,23 @@ export const Default: Story = {
args: { startIcon: START_ICON },
};
+export const OverflowingLabel: Story = {
+ decorators: [ComponentDecorator],
+ parameters: { container: { width: 160 } },
+ args: { children: 'A workspace preference with a long label' },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+ const page = within(canvasElement.ownerDocument.body);
+ const label = canvas.getByText('A workspace preference with a long label');
+
+ await userEvent.hover(label);
+
+ expect(await page.findByRole('tooltip')).toHaveTextContent(
+ 'A workspace preference with a long label',
+ );
+ },
+};
+
export const WithDescription: Story = {
decorators: [ComponentDecorator],
parameters: {
diff --git a/packages/twenty-ui/src/primitives/navigation/ListItem/__tests__/ListItem.test.tsx b/packages/twenty-ui/src/primitives/navigation/ListItem/__tests__/ListItem.test.tsx
index b4f6b6d9b31..06a452cdd9a 100644
--- a/packages/twenty-ui/src/primitives/navigation/ListItem/__tests__/ListItem.test.tsx
+++ b/packages/twenty-ui/src/primitives/navigation/ListItem/__tests__/ListItem.test.tsx
@@ -1,3 +1,7 @@
+import { render, screen } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
+import { describe, expect, it, vi } from 'vitest';
+
import { runComponentConformance } from '@test-utilities/conformance/runComponentConformance';
import { ListItem } from '../ListItem';
@@ -9,3 +13,75 @@ runComponentConformance({
refInstanceOf: HTMLDivElement,
ownClassName: styles.root,
});
+
+describe('ListItem clicks', () => {
+ it('consumes the click when the row owns an action', async () => {
+ const user = userEvent.setup();
+ const onParentClick = vi.fn();
+ const onAction = vi.fn();
+
+ render(
+ <a href="#parent" onClick={onParentClick}>
+ <ListItem onClick={onAction}>Archive</ListItem>
+ </a>,
+ );
+
+ await user.click(screen.getByText('Archive'));
+
+ expect(onAction).toHaveBeenCalledTimes(1);
+ expect(onParentClick).not.toHaveBeenCalled();
+ });
+
+ it('lets a row without an action activate its containing trigger', async () => {
+ const user = userEvent.setup();
+ const onTriggerClick = vi.fn();
+
+ render(
+ <a href="#parent" onClick={onTriggerClick}>
+ <ListItem>Open menu</ListItem>
+ </a>,
+ );
+
+ await user.click(screen.getByText('Open menu'));
+
+ expect(onTriggerClick).toHaveBeenCalledTimes(1);
+ });
+
+ it('keeps disabled rows inactive without consuming the click', async () => {
+ const user = userEvent.setup();
+ const onParentClick = vi.fn();
+ const onAction = vi.fn();
+
+ render(
+ <a href="#parent" onClick={onParentClick}>
+ <ListItem disabled onClick={onAction}>
+ Delete
+ </ListItem>
+ </a>,
+ );
+
+ await user.click(screen.getByText('Delete'));
+
+ expect(onAction).not.toHaveBeenCalled();
+ expect(onParentClick).toHaveBeenCalledTimes(1);
+ });
+});
+
+describe('ListItem content', () => {
+ it('gives a text label a tooltip and leaves other content untouched', () => {
+ render(
+ <>
+ <ListItem>Rename</ListItem>
+ <ListItem>
+ <span data-testid="custom-label">Custom</span>
+ </ListItem>
+ </>,
+ );
+
+ expect(screen.getByText('Rename')).toHaveAttribute(
+ 'data-testid',
+ 'tooltip',
+ );
+ expect(screen.getByTestId('custom-label')).toBeInTheDocument();
+ });
+});