From 3c2b139697f147c0808ab036d5a777434b2e647e Mon Sep 17 00:00:00 2001 From: Tim Fish Date: Sat, 11 Jan 2025 15:39:23 +0100 Subject: [PATCH] Use `rendering_system` to enable absolute positioning of view hierarchy layout --- static/app/components/events/viewHierarchy/index.tsx | 2 +- static/app/components/events/viewHierarchy/wireframe.tsx | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/static/app/components/events/viewHierarchy/index.tsx b/static/app/components/events/viewHierarchy/index.tsx index 949f8a27df1307..7bfb1b19ca739c 100644 --- a/static/app/components/events/viewHierarchy/index.tsx +++ b/static/app/components/events/viewHierarchy/index.tsx @@ -219,7 +219,7 @@ function ViewHierarchy({viewHierarchy, project}: ViewHierarchyProps) { hierarchy={hierarchy} selectedNode={userHasSelected ? selectedNode : undefined} onNodeSelect={onWireframeNodeSelect} - project={project} + system={viewHierarchy.rendering_system} /> )} diff --git a/static/app/components/events/viewHierarchy/wireframe.tsx b/static/app/components/events/viewHierarchy/wireframe.tsx index 26d32e686837df..2a64515777f2a3 100644 --- a/static/app/components/events/viewHierarchy/wireframe.tsx +++ b/static/app/components/events/viewHierarchy/wireframe.tsx @@ -14,7 +14,6 @@ import { import {IconAdd, IconSubtract} from 'sentry/icons'; import {t} from 'sentry/locale'; import {space} from 'sentry/styles/space'; -import type {Project} from 'sentry/types/project'; import {getCenterScaleMatrixFromConfigPosition} from 'sentry/utils/profiling/gl/utils'; import type {Rect} from 'sentry/utils/profiling/speedscope'; @@ -29,11 +28,11 @@ export interface ViewNode { type WireframeProps = { hierarchy: ViewHierarchyWindow[]; onNodeSelect: (node?: ViewHierarchyWindow) => void; - project: Project; + system: string; selectedNode?: ViewHierarchyWindow; }; -function Wireframe({hierarchy, selectedNode, onNodeSelect, project}: WireframeProps) { +function Wireframe({hierarchy, selectedNode, onNodeSelect, system}: WireframeProps) { const theme = useTheme(); const [canvasRef, setCanvasRef] = useState(null); const [overlayRef, setOverlayRef] = useState(null); @@ -50,9 +49,9 @@ function Wireframe({hierarchy, selectedNode, onNodeSelect, project}: WireframePr () => getHierarchyDimensions( hierarchy, - ['flutter', 'dart-flutter'].includes(project?.platform ?? '') + system === 'flutter' || system.includes('absolute') ), - [hierarchy, project.platform] + [hierarchy, system] ); const nodeLookupMap = useMemo(() => { const map = new Map();