Fix deactivated tabs not visible in new tab action (#19811)

## Context
On custom objects, clicking "+ New Tab" on a record page layout never
exposed deactivated tabs for reactivation, even though isActive: false
tabs were correctly returned by the API. Standard objects worked fine.

## Fix
isReactivatableTab gated reactivation on tab.applicationId ===
objectMetadata.applicationId. For custom objects these two ids are
intentionally different.
This check was unnecessary after all, we simply want to check if a tab
is inactive (only non-custom entities can be de-activated) 👍

<img width="694" height="551" alt="Screenshot 2026-04-17 at 18 14 28"
src="https://github.com/user-attachments/assets/42485cb2-8be5-4a55-a311-479ed3226908"
/>
This commit is contained in:
Weiko
2026-04-17 19:10:14 +02:00
committed by GitHub
parent 6095798434
commit a18840f3cd
5 changed files with 10 additions and 73 deletions
@@ -1,7 +1,6 @@
import { STANDARD_PAGE_LAYOUT_TAB_TITLE_TRANSLATIONS } from '@/page-layout/constants/StandardPageLayoutTabTitleTranslations';
import { useCurrentPageLayoutOrThrow } from '@/page-layout/hooks/useCurrentPageLayoutOrThrow';
import { useIsCurrentObjectCustom } from '@/page-layout/hooks/useIsCurrentObjectCustom';
import { useRecordPageLayoutObjectApplicationId } from '@/page-layout/hooks/useRecordPageLayoutObjectApplicationId';
import { useUpdatePageLayoutTab } from '@/page-layout/hooks/useUpdatePageLayoutTab';
import { pageLayoutTabSettingsOpenTabIdComponentState } from '@/page-layout/states/pageLayoutTabSettingsOpenTabIdComponentState';
import { isReactivatableTab } from '@/page-layout/utils/isReactivatableTab';
@@ -39,7 +38,6 @@ export const PageLayoutTabListNewTabDropdownContent = ({
const shouldTranslateTabTitles = !isCustom;
const { currentPageLayout } = useCurrentPageLayoutOrThrow();
const { objectApplicationId } = useRecordPageLayoutObjectApplicationId();
const { updatePageLayoutTab } = useUpdatePageLayoutTab();
const setActiveTabId = useSetAtomComponentState(activeTabIdComponentState);
@@ -49,13 +47,8 @@ export const PageLayoutTabListNewTabDropdownContent = ({
const { navigatePageLayoutSidePanel } = useNavigatePageLayoutSidePanel();
const inactiveTabs = useMemo(
() =>
sortTabsByPosition(
currentPageLayout.tabs.filter((tab) =>
isReactivatableTab({ tab, objectApplicationId }),
),
),
[currentPageLayout.tabs, objectApplicationId],
() => sortTabsByPosition(currentPageLayout.tabs.filter(isReactivatableTab)),
[currentPageLayout.tabs],
);
const handleCreateEmptyTab = useCallback(() => {