diff --git a/ui/packages/shared/profile/src/MetricsGraphStrips/index.tsx b/ui/packages/shared/profile/src/MetricsGraphStrips/index.tsx index 638e2b1ba61..0dacc8952ca 100644 --- a/ui/packages/shared/profile/src/MetricsGraphStrips/index.tsx +++ b/ui/packages/shared/profile/src/MetricsGraphStrips/index.tsx @@ -28,6 +28,7 @@ interface Props { bounds: NumberDuo; }; onSelectedTimeline: (index: number, bounds: NumberDuo | undefined) => void; + width?: number; } const getTimelineGuideHeight = (cpus: string[], collapsedIndices: number[]): number => { @@ -39,6 +40,7 @@ export const MetricsGraphStrips = ({ data, selectedTimeline, onSelectedTimeline, + width, }: Props): JSX.Element => { const [collapsedIndices, setCollapsedIndices] = useState([]); @@ -57,17 +59,17 @@ export const MetricsGraphStrips = ({ }, [data]); return ( -
+
{cpus.map((cpu, i) => { const isCollapsed = collapsedIndices.includes(i); return ( -
+
{ @@ -87,7 +89,7 @@ export const MetricsGraphStrips = ({ { @@ -64,6 +66,7 @@ const ProfileIcicleGraph = function ProfileIcicleGraphNonMemo({ width, isHalfScreen, metadataMappingFiles, + showTimelineGuide = false, }: ProfileIcicleGraphProps): JSX.Element { const {onError, authenticationErrorMessage, isDarkMode} = useParcaContext(); const {compareMode} = useProfileViewContext(); @@ -165,20 +168,31 @@ const ProfileIcicleGraph = function ProfileIcicleGraphNonMemo({ if (arrow !== undefined) return ( - +
+ {showTimelineGuide && ( + + )} + +
); }, [ isLoading, @@ -196,6 +210,7 @@ const ProfileIcicleGraph = function ProfileIcicleGraphNonMemo({ isDarkMode, mappingsList, isCompareAbsolute, + showTimelineGuide, ]); if (error != null) { diff --git a/ui/packages/shared/profile/src/ProfileView/components/DashboardItems/index.tsx b/ui/packages/shared/profile/src/ProfileView/components/DashboardItems/index.tsx index 2171c1ec714..7f3c30215ba 100644 --- a/ui/packages/shared/profile/src/ProfileView/components/DashboardItems/index.tsx +++ b/ui/packages/shared/profile/src/ProfileView/components/DashboardItems/index.tsx @@ -47,6 +47,7 @@ interface GetDashboardItemProps { perf?: { onRender?: ProfilerOnRenderCallback; }; + showTimelineGuide?: boolean; } export const getDashboardItem = ({ @@ -66,6 +67,7 @@ export const getDashboardItem = ({ setSearchString, callgraphSVG, perf, + showTimelineGuide, }: GetDashboardItemProps): JSX.Element => { switch (type) { case 'icicle': @@ -98,6 +100,7 @@ export const getDashboardItem = ({ } metadataMappingFiles={flamegraphData.metadataMappingFiles} metadataLoading={flamegraphData.metadataLoading} + showTimelineGuide={showTimelineGuide} /> ); diff --git a/ui/packages/shared/profile/src/ProfileView/components/VisualizationContainer/index.tsx b/ui/packages/shared/profile/src/ProfileView/components/VisualizationContainer/index.tsx index 73efadc2c71..7b74d80c399 100644 --- a/ui/packages/shared/profile/src/ProfileView/components/VisualizationContainer/index.tsx +++ b/ui/packages/shared/profile/src/ProfileView/components/VisualizationContainer/index.tsx @@ -50,7 +50,7 @@ export const VisualizationContainer: FC = ({ {...provided.draggableProps} className={cx( 'w-full min-h-96', - snapshot.isDragging ? 'bg-gray-200 dark:bg-gray-500' : 'bg-white dark:bg-gray-900', + snapshot.isDragging ? 'bg-gray-200 dark:bg-gray-500' : 'bg-inherit dark:bg-gray-900', isMultiPanelView ? 'border-2 border-gray-100 dark:border-gray-700 rounded-md p-3' : '' )} > diff --git a/ui/packages/shared/profile/src/ProfileView/index.tsx b/ui/packages/shared/profile/src/ProfileView/index.tsx index b28cb88b779..c8414131ddc 100644 --- a/ui/packages/shared/profile/src/ProfileView/index.tsx +++ b/ui/packages/shared/profile/src/ProfileView/index.tsx @@ -42,6 +42,7 @@ export const ProfileView = ({ pprofDownloading, compare, showVisualizationSelector, + showTimelineGuide, }: ProfileViewProps): JSX.Element => { const { timezone, @@ -109,6 +110,7 @@ export const ProfileView = ({ setSearchString, callgraphSVG, perf, + showTimelineGuide, }); }; diff --git a/ui/packages/shared/profile/src/ProfileView/types/visualization.ts b/ui/packages/shared/profile/src/ProfileView/types/visualization.ts index 5a64459e4ea..79cfe83ee8c 100644 --- a/ui/packages/shared/profile/src/ProfileView/types/visualization.ts +++ b/ui/packages/shared/profile/src/ProfileView/types/visualization.ts @@ -72,4 +72,5 @@ export interface ProfileViewProps { onDownloadPProf: () => void; pprofDownloading?: boolean; showVisualizationSelector?: boolean; + showTimelineGuide?: boolean; } diff --git a/ui/packages/shared/profile/src/ProfileViewWithData.tsx b/ui/packages/shared/profile/src/ProfileViewWithData.tsx index 869f981410a..4b4529c200d 100644 --- a/ui/packages/shared/profile/src/ProfileViewWithData.tsx +++ b/ui/packages/shared/profile/src/ProfileViewWithData.tsx @@ -28,12 +28,14 @@ interface ProfileViewWithDataProps { profileSource: ProfileSource; compare?: boolean; showVisualizationSelector?: boolean; + showTimelineGuide?: boolean; } export const ProfileViewWithData = ({ queryClient, profileSource, showVisualizationSelector, + showTimelineGuide, }: ProfileViewWithDataProps): JSX.Element => { const metadata = useGrpcMetadata(); const [dashboardItems] = useURLState('dashboard_items', { @@ -242,6 +244,7 @@ export const ProfileViewWithData = ({ onDownloadPProf={() => void downloadPProfClick()} pprofDownloading={pprofDownloading} showVisualizationSelector={showVisualizationSelector} + showTimelineGuide={showTimelineGuide} /> ); };