Side Panel Sub Page Framework® (#18579)

Replace hard-coded implementations for sub pages in the side panel with
a proper framework
This commit is contained in:
Baptiste Devessier
2026-03-12 16:17:29 +01:00
committed by GitHub
parent 5bfa4c5c39
commit 2a6fcfcfb3
45 changed files with 824 additions and 551 deletions
@@ -0,0 +1,30 @@
import { SidePanelSubPages } from '@/side-panel/types/SidePanelSubPages';
import { t } from '@lingui/core/macro';
import { assertUnreachable } from 'twenty-shared/utils';
export const getSidePanelSubPageTitle = (
subPage: SidePanelSubPages,
): string => {
switch (subPage) {
case SidePanelSubPages.PageLayoutGraphFilter:
return t`Filters`;
case SidePanelSubPages.PageLayoutFieldsLayout:
return t`Layout`;
case SidePanelSubPages.NewSidebarItemViewObjectPicker:
return t`Pick an object`;
case SidePanelSubPages.NewSidebarItemViewPicker:
return t`Pick a view`;
case SidePanelSubPages.NewSidebarItemViewSystemPicker:
return t`System objects`;
case SidePanelSubPages.NewSidebarItemObjectPicker:
return t`Pick an object`;
case SidePanelSubPages.NewSidebarItemObjectSystemPicker:
return t`System objects`;
case SidePanelSubPages.NewSidebarItemRecord:
return t`Add a record`;
case SidePanelSubPages.EditFolderPicker:
return t`Move to a folder`;
default:
assertUnreachable(subPage);
}
};