From 6dbec4a7e2c0091684ce5097a689c61407fea4f5 Mon Sep 17 00:00:00 2001 From: Abdul Rahman Date: Thu, 9 Apr 2026 06:56:42 +0530 Subject: [PATCH] Refactor variable names for clarity in NavigationDrawerItemForObjectMetadataItem - Updated variable names to improve readability and maintainability, changing `isOnRecordShowPage` to `isOnObjectRecordShowPage` and `isOnIndexPage` to `isOnObjectIndexPage`. - Enhanced the logic for determining the current path matching object metadata, contributing to clearer navigation handling within the component. --- .../NavigationDrawerItemForObjectMetadataItem.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/twenty-front/src/modules/navigation-menu-item/display/object/components/NavigationDrawerItemForObjectMetadataItem.tsx b/packages/twenty-front/src/modules/navigation-menu-item/display/object/components/NavigationDrawerItemForObjectMetadataItem.tsx index a91c811435b..ebf115bdd38 100644 --- a/packages/twenty-front/src/modules/navigation-menu-item/display/object/components/NavigationDrawerItemForObjectMetadataItem.tsx +++ b/packages/twenty-front/src/modules/navigation-menu-item/display/object/components/NavigationDrawerItemForObjectMetadataItem.tsx @@ -98,18 +98,19 @@ export const NavigationDrawerItemForObjectMetadataItem = ({ const activeNavigationItem = useAtomStateValue(activeNavigationItemState); const setActiveNavigationItem = useSetAtomState(activeNavigationItemState); - const isOnRecordShowPage = matchesRecordShowPathForObject( + const isOnObjectRecordShowPage = matchesRecordShowPathForObject( currentPath, objectMetadataItem.nameSingular, ); - const isOnIndexPage = + const isOnObjectIndexPage = currentPath === getAppPath(AppPath.RecordIndexPage, { objectNamePlural: objectMetadataItem.namePlural, }); - const isCurrentPathMatchingObject = isOnIndexPage || isOnRecordShowPage; + const isCurrentPathMatchingObject = + isOnObjectIndexPage || isOnObjectRecordShowPage; const shouldUseExplicitActiveItem = isDefined(activeNavigationItem) && @@ -131,7 +132,7 @@ export const NavigationDrawerItemForObjectMetadataItem = ({ const isActiveByUrl = matchesNavigationMenuItemLink || - (isObject && isOnRecordShowPage) || + (isObject && isOnObjectRecordShowPage) || (!hasCustomLink && isCurrentPathMatchingObject); const isActive =