Skip to content

The open alternative to Salesforce, designed for AI.

fix(front): page header title overlap, Cmd+K on page layout pages & stable tooltip id (#22678)

Marie5f3f734b3477
diff --git a/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx b/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx
index 4c565aab1d9..6e277d833a4 100644
--- a/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx
+++ b/packages/twenty-front/src/modules/app/effect-components/PageChangeEffect.tsx
@@ -227,6 +227,22 @@ export const PageChangeEffect = () => {
}
break;
}
+ case isMatchingLocation(location, AppPath.PageLayoutPage): {
+ resetFocusStackToFocusItem({
+ focusStackItem: {
+ focusId: PageFocusId.PageLayoutPage,
+ componentInstance: {
+ componentType: FocusComponentType.PAGE,
+ componentInstanceId: PageFocusId.PageLayoutPage,
+ },
+ globalHotkeysConfig: {
+ enableGlobalHotkeysWithModifiers: true,
+ enableGlobalHotkeysConflictingWithKeyboard: true,
+ },
+ },
+ });
+ break;
+ }
case isMatchingLocation(location, AppPath.SignInUp): {
resetFocusStackToFocusItem({
focusStackItem: {
diff --git a/packages/twenty-front/src/modules/types/PageFocusId.ts b/packages/twenty-front/src/modules/types/PageFocusId.ts
index c2e739fefd1..3956eb97383 100644
--- a/packages/twenty-front/src/modules/types/PageFocusId.ts
+++ b/packages/twenty-front/src/modules/types/PageFocusId.ts
@@ -8,4 +8,5 @@ export enum PageFocusId {
PlanRequired = 'plan-required',
RecordShowPage = 'record-show-page',
RecordIndex = 'record-index',
+ PageLayoutPage = 'page-layout-page',
}
diff --git a/packages/twenty-front/src/modules/ui/layout/page/components/PageCardHeader.tsx b/packages/twenty-front/src/modules/ui/layout/page/components/PageCardHeader.tsx
index 9f598b0f807..c82ae45c509 100644
--- a/packages/twenty-front/src/modules/ui/layout/page/components/PageCardHeader.tsx
+++ b/packages/twenty-front/src/modules/ui/layout/page/components/PageCardHeader.tsx
@@ -32,7 +32,7 @@ const StyledHeader = styled.div<{ centerTitle?: boolean }>`
display: grid;
grid-template-columns: ${({ centerTitle }) =>
centerTitle
- ? 'minmax(0, 1fr) auto minmax(0, 1fr)'
+ ? 'minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr)'
: 'minmax(0, auto) minmax(0, 1fr)'};
min-height: ${SIDE_PANEL_TOP_BAR_HEIGHT}px;
padding: 0 ${themeCssVariables.spacing[3]};
@@ -63,8 +63,9 @@ const StyledTitle = styled.div<{ titleColor?: string }>`
const StyledCenteredTitle = styled(StyledTitle)`
grid-column: 2;
justify-content: center;
- justify-self: center;
+ justify-self: stretch;
max-width: 100%;
+ min-width: 0;
overflow: hidden;
`;
diff --git a/packages/twenty-ui/src/surfaces/OverflowingTextWithTooltip/OverflowingTextWithTooltip.tsx b/packages/twenty-ui/src/surfaces/OverflowingTextWithTooltip/OverflowingTextWithTooltip.tsx
index 136ae9707b2..f9db9d040c8 100644
--- a/packages/twenty-ui/src/surfaces/OverflowingTextWithTooltip/OverflowingTextWithTooltip.tsx
+++ b/packages/twenty-ui/src/surfaces/OverflowingTextWithTooltip/OverflowingTextWithTooltip.tsx
@@ -1,4 +1,10 @@
-import { type CSSProperties, type ReactNode, useRef, useState } from 'react';
+import {
+ type CSSProperties,
+ type ReactNode,
+ useId,
+ useRef,
+ useState,
+} from 'react';
import { createPortal } from 'react-dom';
import { isNonEmptyString } from '@sniptt/guards';
@@ -35,7 +41,7 @@ export const OverflowingTextWithTooltip = ({
tooltipDelay = TooltipDelay.mediumDelay,
alwaysShowTooltip = false,
}: OverflowingTextWithTooltipProps) => {
- const textElementId = `title-id-${+new Date()}`;
+ const textElementId = `title-id-${useId().replace(/:/g, '')}`;
const textRef = useRef<HTMLDivElement>(null);